/* ===== BASE STYLES ===== */
:root {
    --blue-dark: #002f6c;
    --blue-mid: #003f88;
    --blue-link: #123c9a;
    --green: #0ca572;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    margin: 0; 
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
}
/* header starts */
/* ===== TOP BLUE NAV ===== */
.top-blue-nav {
    background: var(--blue-dark);
    color: white;
    font-size: 14px;
    padding: 10px 0;
}

.top-blue-container {
    max-width: 1400px;
    margin: auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-blue-left ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.top-blue-left a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.top-blue-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-blue-right a {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

/* ===== MAIN HEADER ===== */
header {
    background: white;
    border-bottom: 1px solid #ddd;
    position: relative;
}

.main-header {
    max-width: 1400px;
    padding: 18px 30px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.logo {
    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.logo span:first-child { color: var(--blue-link); }
.logo span:last-child { color: var(--green); }

/* Desktop Navigation */
nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 35px;
}

nav a {
    text-decoration: none;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    padding-bottom: 6px;
    transition: .2s;
    white-space: nowrap;
}

nav a:hover {
    color: var(--blue-link);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.search-icon {
    font-size: 18px;
    cursor: pointer;
    color: #444;
    transition: color 0.2s;
}

.search-icon:hover {
    color: var(--blue-link);
}

.btn-login {
    padding: 8px 22px;
    border: 1px solid var(--blue-link);
    color: var(--blue-link);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: .2s;
    white-space: nowrap;
}

.btn-login:hover {
    background: var(--blue-link);
    color: white;
}

.btn-start {
    padding: 8px 22px;
    background: var(--green);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: .2s;
    white-space: nowrap;
}

.btn-start:hover {
    background: #0a875c;
}

/* ===== MOBILE MENU ===== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 5px;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #ddd;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

.mobile-nav.show {
    display: block;
}

.mobile-nav ul {
    list-style: none;
}

.mobile-nav li {
    border-bottom: 1px solid #eee;
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: background .2s;
}

.mobile-nav a:hover {
    background: #f5f5f5;
    color: var(--blue-link);
}

.mobile-auth-buttons {
    display: none;
    padding: 20px;
    border-top: 1px solid #eee;
    gap: 10px;
}

.mobile-auth-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 12px;
}

/* ===== SEARCH MODAL ===== */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.search-modal.active {
    display: flex;
}

.search-container {
    width: 100%;
    max-width: 700px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.search-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    flex-shrink: 0;
}

.search-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 0 15px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.2s;
}

.search-input-container:focus-within {
    border-color: var(--blue-link);
}

.search-input-container i {
    color: #666;
    margin-right: 10px;
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 0;
    font-size: 16px;
    background: transparent;
    width: 100%;
    color: #333;
}

#searchInput::placeholder {
    color: #888;
}

.close-search {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    margin-left: 20px;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-search:hover {
    color: #333;
    background: #f0f0f0;
}

.search-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.search-loading {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    display: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.search-loading.active {
    display: flex;
}

.no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    display: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-results.active {
    display: flex;
}

.no-results i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.search-result-item {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: block;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f8fafd;
}

.result-category {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--blue-link);
    font-size: 16px;
}

.result-excerpt {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    line-height: 1.5;
}

.recent-searches {
    padding: 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.recent-searches h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.recent-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.recent-tag {
    background: #f0f0f0;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.recent-tag:hover {
    background: #e0e0e0;
    border-color: var(--blue-link);
    color: var(--blue-link);
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--blue-link);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Tablets and below */
@media (max-width: 900px) {
    .main-header {
        padding: 15px 20px;
    }
    
    nav ul {
        gap: 20px;
    }
    
    .header-actions {
        gap: 15px;
    }
}

/* Mobile devices (768px and below) */
@media (max-width: 768px) {
    .top-blue-nav {
        font-size: 12px;
        padding: 8px 0;
    }
    
    .top-blue-container {
        padding: 0 15px;
    }
    
    .top-blue-left ul {
        gap: 15px;
    }
    
    .top-blue-right {
        gap: 15px;
    }
    
    /* Hide desktop navigation */
    nav {
        display: none;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
        order: 1;
    }
    
    /* Reorder header items */
    .main-header {
        flex-wrap: wrap;
    }
    
    .logo {
        order: 0;
        flex: 1;
    }
    
    .header-actions {
        order: 2;
    }
    
    /* Show mobile auth buttons */
    .mobile-auth-buttons {
        display: flex;
    }
    
    /* Hide desktop auth buttons */
    .header-actions .btn-login,
    .header-actions .btn-start {
        display: none;
    }
    
    /* Adjust search icon */
    .search-icon {
        font-size: 20px;
    }
}

/* Small phones (600px and below) */
@media (max-width: 600px) {
    .top-blue-left {
        display: none;
    }
    
    .top-blue-container {
        justify-content: center;
    }
    
    .top-blue-right {
        gap: 25px;
    }
    
    .main-header {
        padding: 12px 15px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .header-actions {
        gap: 15px;
    }
    
    /* Search modal adjustments */
    .search-modal {
        padding: 10px;
    }
    
    .search-container {
        max-height: 95vh;
    }
    
    .search-header {
        padding: 15px;
    }
    
    .search-input-container {
        padding: 0 12px;
    }
    
    #searchInput {
        padding: 12px 0;
        font-size: 16px;
    }
    
    .close-search {
        margin-left: 12px;
        font-size: 22px;
    }
    
    .search-result-item {
        padding: 14px 16px;
    }
    
    .recent-searches {
        padding: 16px;
    }
    
    .recent-tags {
        gap: 8px;
    }
    
    .recent-tag {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .top-blue-nav {
        font-size: 11px;
    }
    
    .main-header {
        padding: 10px 12px;
    }
    
    .logo {
        font-size: 22px;
    }
    
    .mobile-menu-toggle {
        font-size: 22px;
    }
    
    .mobile-auth-buttons {
        flex-direction: column;
    }
    
    .mobile-auth-buttons .btn {
        width: 100%;
    }
}

/* Touch-friendly targets */
@media (max-width: 768px) {
    nav a,
    .btn-login,
    .btn-start,
    .mobile-nav a,
    .search-icon,
    .mobile-menu-toggle,
    .recent-tag {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-nav a {
        padding: 16px 20px;
    }
    
    .search-icon,
    .mobile-menu-toggle {
        padding: 10px;
    }
}

/* Landscape mode */
@media (max-height: 600px) and (orientation: landscape) {
    .search-modal {
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .search-container {
        max-height: 85vh;
    }
}


