/* ========================================
 * AILA Tech Solutions - Professional Header & Navigation
 * ======================================== */

/* ========================================
 * 1. MAIN HEADER STYLES
 * ======================================== */

.main-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 38px;
    left: 0;
    right: 0;
    z-index: 990;
    padding: 0;
    transition: all 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    position: relative;
}

/* ========================================
 * 2. LOGO STYLES
 * ======================================== */

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
    z-index: 1001;
}

.logo img {
    height: 36px;
    width: auto;
    vertical-align: middle;
}

/* ========================================
 * 3. DESKTOP NAVIGATION
 * ======================================== */

.main-nav {
    display: flex;
    justify-content: center;
    flex-grow: 1;
    margin: 0 20px;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 32px;
    align-items: center;
    height: 100%;
}

.nav-links li {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

/* ========================================
 * 4. DROPDOWN MENU STYLES
 * ======================================== */

.dropdown-menu {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.dropdown-icon {
    margin-left: 4px;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.dropdown-menu:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--gray-200);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 8px 0;
}

.dropdown-menu:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-radius: 0;
}

.dropdown-content a:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.dropdown-arrow {
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

/* ========================================
 * 5. AUTH BUTTONS
 * ======================================== */

.auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    height: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    min-height: 36px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* ========================================
 * 6. MOBILE MENU BUTTON
 * ======================================== */

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* ========================================
 * 7. MOBILE NAVIGATION OVERLAY
 * ======================================== */

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.mobile-nav-overlay.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    width: 100%;
    max-width: 300px;
    padding: 2rem;
}

.mobile-nav-menu a {
    color: white;
    font-size: 1.25rem;
    font-weight: 500;
    padding: 1rem 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-nav-menu a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mobile-nav-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
 * 8. RESPONSIVE DESIGN
 * ======================================== */

/* Tablet and below */
@media (max-width: 1024px) {
    .nav-links {
        gap: 20px;
    }
    
    .nav-links a {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .auth-buttons {
        gap: 8px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Mobile devices - DigitalOcean inspired design */
@media (max-width: 768px) {
    .main-header {
        top: 38px;
        padding: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    .container {
        padding: 0 20px;
        max-width: 100%;
    }
    
    .navbar {
        padding: 16px 0;
        height: 64px;
        align-items: center;
    }
    
    .logo {
        z-index: 10001;
    }
    
    .logo img {
        height: 36px;
        transition: all 0.2s ease;
    }
    
    /* Hide desktop navigation on mobile */
    .main-nav {
        display: none;
    }
    
    .auth-buttons {
        display: none;
    }
    
    /* Professional mobile menu button inspired by DigitalOcean */
    .mobile-menu-btn {
        display: flex;
        z-index: 10001;
        background: none;
        border: none;
        color: var(--primary);
        font-size: 20px;
        cursor: pointer;
        padding: 12px;
        border-radius: 8px;
        transition: all 0.2s ease;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    .mobile-menu-btn:hover {
        background: rgba(26, 50, 186, 0.08);
        transform: scale(1.02);
    }
    
    .mobile-menu-btn:active {
        transform: scale(0.98);
    }
    
    /* Professional mobile nav overlay - DigitalOcean inspired */
    .mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 9999;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0;
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-nav-overlay.active {
        display: flex;
        opacity: 1;
    }
    
    /* Mobile nav close button - DigitalOcean style */
    .mobile-nav-close {
        position: absolute;
        top: 54px;
        right: 20px;
        background: none;
        border: none;
        color: var(--text-dark);
        font-size: 24px;
        cursor: pointer;
        padding: 12px;
        border-radius: 8px;
        transition: all 0.2s ease;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10002;
    }
    
    .mobile-nav-close:hover {
        background: rgba(0, 0, 0, 0.05);
        transform: scale(1.02);
    }
    
    .mobile-nav-close:active {
        transform: scale(0.98);
    }
    
    /* Mobile navigation menu - Clean DigitalOcean style */
    .mobile-nav-menu {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 120px 20px 40px 20px;
        transform: translateY(20px);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .mobile-nav-overlay.active .mobile-nav-menu {
        transform: translateY(0);
    }
    
    /* Professional mobile navigation links */
    .mobile-nav-menu a {
        display: flex;
        align-items: center;
        color: var(--text-dark);
        font-size: 18px;
        font-weight: 500;
        padding: 16px 20px;
        border-radius: 12px;
        transition: all 0.2s ease;
        text-decoration: none;
        background: transparent;
        border: none;
        text-align: left;
        min-height: 56px;
        margin-bottom: 4px;
        position: relative;
    }
    
    .mobile-nav-menu a:hover,
    .mobile-nav-menu a:focus {
        background: rgba(26, 50, 186, 0.08);
        color: var(--primary);
        transform: translateX(4px);
        outline: none;
    }
    
    .mobile-nav-menu a:active {
        transform: translateX(2px) scale(0.98);
    }
    
    /* Professional mobile auth buttons - DigitalOcean inspired */
    .mobile-auth-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 40px;
        padding: 0 20px 20px 20px;
        width: 100%;
    }
    
    .mobile-auth-buttons .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
        font-weight: 600;
        min-height: 52px;
        border-radius: 8px;
        transition: all 0.2s ease;
        text-align: center;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid transparent;
        cursor: pointer;
    }
    
    /* Primary button - DigitalOcean blue style */
    .mobile-auth-buttons .btn-primary {
        background: linear-gradient(135deg, #0066ff 0%, #004dcf 100%);
        color: white;
        border: none;
        box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
    }
    
    .mobile-auth-buttons .btn-primary:hover {
        background: linear-gradient(135deg, #0052cc 0%, #003d99 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 102, 255, 0.4);
    }
    
    .mobile-auth-buttons .btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 1px 4px rgba(0, 102, 255, 0.3);
    }
    
    /* Outline button - Clean DigitalOcean style */
    .mobile-auth-buttons .btn-outline {
        background: transparent;
        color: var(--text-dark);
        border: 2px solid rgba(0, 0, 0, 0.15);
    }
    
    .mobile-auth-buttons .btn-outline:hover {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.25);
        transform: translateY(-1px);
    }
    
    .mobile-auth-buttons .btn-outline:active {
        transform: translateY(0);
        background: rgba(0, 0, 0, 0.08);
    }
    
    /* Mobile dropdown styles */
    .mobile-links .dropdown-content {
        position: static;
        background: transparent;
        box-shadow: none;
        border: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding: 0;
        margin-top: 0.5rem;
    }
    
    .mobile-links .dropdown-content a {
        background: rgba(255, 255, 255, 0.05);
        margin: 0.25rem 0;
        font-size: 1rem;
    }
    
    .mobile-links .dropdown-content a:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .navbar {
        padding: 10px 0;
    }
    
    .logo img {
        height: 28px;
    }
    
    .mobile-menu-btn {
        font-size: 1.1rem;
        padding: 6px;
    }
    
    .mobile-links a {
        font-size: 1.1rem;
        padding: 0.875rem 1.5rem;
    }
    
    .mobile-auth-buttons .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* ========================================
 * 9. ANIMATIONS
 * ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
 * 10. ACCESSIBILITY
 * ======================================== */

/* Focus indicators */
.mobile-menu-btn:focus,
.nav-links a:focus,
.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .main-header {
        border-bottom: 2px solid #000;
    }
    
    .nav-links a {
        border: 1px solid transparent;
    }
    
    .nav-links a:hover {
        border-color: #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nav-links a,
    .btn,
    .mobile-menu-btn,
    .dropdown-content {
        transition: none;
    }
    
    .mobile-nav-overlay.active,
    .mobile-menu.active {
        animation: none;
    }
}

/* ========================================
 * 11. DARK MODE SUPPORT
 * ======================================== */

@media (prefers-color-scheme: dark) {
    .main-header {
        background-color: rgba(0, 0, 0, 0.95);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-links a {
        color: white;
    }
    
    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-content {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .dropdown-content a {
        color: white;
    }
    
    .dropdown-content a:hover {
        background: #333;
    }
    
    .dropdown-arrow {
        background: #1a1a1a;
        border-color: #333;
    }
}