/* css/search.css */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz@14..32&display=swap');

* {
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f4f7fb;
}

/* custom navy/teal palette */
.bg-navy-sidebar {
    background-color: #0c2538;
}
.bg-navy-deep { background-color: #0b1f33; }
.text-teal-logo { color: #5ee0d0; }
.border-teal-light { border-color: #2aa79b33; }

/* hover effect for nav items */
.hover-nav:hover {
    background-color: #1f4e5e;
    color: white;
}

/* active navigation item */
.active-nav {
    background-color: #1a4450;
    border-left: 4px solid #2aa79b;
}

/* stat card styles */
.stat-card {
    transition: all 0.2s ease;
    border: 1px solid #eef2f6;
    background-color: white;
    border-radius: 0.75rem;
}
.stat-card:hover {
    box-shadow: 0 8px 20px -8px rgba(18, 79, 86, 0.15);
}

/* dashboard background */
.bg-dashboard-bg {
    background-color: #f4f7fb;
}

/* badge styles */
.badge-approved, .badge-pending, .badge-draft, .badge-rejected, .badge-locked,
.badge-validated, .badge-pending-validation, .badge-pending-approval {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}
.badge-approved { background-color: #e3f7ec; color: #0f7b4b; }
.badge-pending, .badge-pending-validation, .badge-pending-approval { background-color: #fef9e7; color: #b78103; }
.badge-validated { background-color: #dbeafe; color: #1e40af; }
.badge-draft { background-color: #edf2f7; color: #385d7a; }
.badge-rejected { background-color: #fee2e2; color: #dc2626; }
.badge-locked { background-color: #f3f4f6; color: #6b7280; }

/* Category badges */
.badge-instruction {
    background-color: #dbeafe;
    color: #1d4ed8;
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}

.badge-research {
    background-color: #dcfce7;
    color: #15803d;
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}

.badge-extension {
    background-color: #fef3c7;
    color: #b45309;
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}

.badge-employment {
    background-color: #f3e8ff;
    color: #7e22ce;
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}

/* Department tags */
.badge-department {
    background-color: #f1f5f9;
    color: #475569;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
}

/* utility classes */
.text-teal-300 { color: #5eead4; }
.text-teal-300\/70 { color: rgba(94, 234, 212, 0.7); }
.bg-teal-800\/40 { background-color: rgba(17, 94, 89, 0.4); }
.border-teal-400 { border-color: #2dd4bf; }

/* button styling */
.bg-teal-700 { background-color: #0f766e; }
.bg-teal-700:hover { background-color: #115e59; }

/* search result styling */
.search-result {
    transition: all 0.2s ease;
    cursor: pointer;
}
.search-result:hover {
    background-color: #f9fafb;
}

/* line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* view toggle buttons */
.view-toggle {
    transition: all 0.2s ease;
    cursor: pointer;
}
.view-toggle.active-view {
    background-color: #0f766e;
    color: white;
}

/* action buttons */
.btn-view, .btn-details {
    padding: 0.3rem 0.85rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-view {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
}
.btn-view:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
}
.btn-details {
    background-color: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0369a1;
}
.btn-details:hover {
    background-color: #bae6fd;
    border-color: #7dd3fc;
}
.btn-view:active, .btn-details:active {
    transform: scale(0.97);
}

/* recent search tags */
.bg-gray-100 { background-color: #f3f4f6; }
.remove-search {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 12px;
}

/* mobile header spacer */
.mobile-header-spacer { height: 60px; width: 100%; }

/* focus states */
input:focus, select:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 1px #14b8a6;
}

/* transitions */
.transition, .transition-colors { transition: all 0.2s ease; }

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #0d9488;
    border-radius: 10px;
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

/* Sidebar - Mobile */
@media (max-width: 768px) {
    .w-72 {
        width: 280px;
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    .w-72.open { left: 0; }
    main { width: 100%; margin-left: 0; }
    
    .menu-toggle {
        display: block;
        position: fixed;
        top: 14px;
        left: 14px;
        z-index: 1001;
        background: #0c2538;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 8px 12px;
        cursor: pointer;
        font-size: 1.25rem;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar-overlay.active { display: block; }
}

@media (min-width: 769px) {
    .menu-toggle { display: none; }
    .sidebar-overlay { display: none !important; }
    .w-72 { position: relative; left: 0 !important; }
    .mobile-header-spacer { display: none; }
}

/* Cards responsive */
@media (max-width: 640px) {
    .stat-card { padding: 0.75rem; }
    h1 { font-size: 1.5rem; }
}

/* Filter bar responsive */
@media (max-width: 640px) {
    .grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-3 { grid-template-columns: 1fr; }
    .grid-cols-1.sm\:grid-cols-2 { grid-template-columns: 1fr; }
}

/* Results header responsive */
@media (max-width: 640px) {
    .flex.flex-col.sm\:flex-row { flex-direction: column; align-items: stretch; }
    .view-toggle { padding: 0.5rem 1rem; }
}

/* Search result responsive */
@media (max-width: 640px) {
    .search-result { padding: 0.75rem; }
    .flex.flex-col.md\:flex-row { flex-direction: column; }
    .btn-view, .btn-details { width: 100%; text-align: center; }
}

/* Recent searches responsive */
@media (max-width: 640px) {
    .bg-gray-100.px-3.py-1\.5.rounded-full { font-size: 0.7rem; padding: 0.3rem 0.7rem; }
}

/* Touch-friendly */
@media (max-width: 768px) {
    button, a, .btn-view, .btn-details { min-height: 44px; min-width: 44px; }
    body { font-size: 14px; }
    input, select { font-size: 16px !important; }
}

/* Grid view items */
#gridView .search-result {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Document Details Modal */
#docDetailsModal {
    backdrop-filter: blur(2px);
}
#docDetailsContent {
    scrollbar-width: thin;
}
#docDetailsContent::-webkit-scrollbar {
    width: 6px;
}
#docDetailsContent::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}
#docDetailsContent::-webkit-scrollbar-thumb {
    background: #0d9488;
    border-radius: 10px;
}