/**
 * Marketing/Navigation Header Styles
 * Used on all pages except training.php
 * Fully responsive with mobile menu
 * Fixed: CTA button now works correctly on mobile
 */

/* Header Container */
.main-header {
    background: linear-gradient(135deg, #003366 0%, #0066b2 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Navigation Container */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Logo */
.header-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 1001;
}

.header-logo:hover {
    transform: scale(1.05);
}

.header-logo .accent {
    color: #cc0000;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 35px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 8px 0;
    position: relative;
}

.nav-menu a:hover {
    color: #ffffff;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #cc0000;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu a.active {
    color: #ffffff;
    font-weight: 600;
}

.nav-menu a.active::after {
    width: 100%;
}

/* Hide mobile CTA wrapper on desktop */
.mobile-cta-wrapper {
    display: none;
}

/* CTA Button - Animated */
.nav-cta {
    background: linear-gradient(135deg, #cc0000 0%, #ff0000 100%);
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

/* Pulse animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(204, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(204, 0, 0, 0.7), 0 0 0 8px rgba(204, 0, 0, 0.1);
    }
}

.nav-cta {
    animation: pulse 2s ease-in-out infinite;
}

/* Shimmer effect */
.nav-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.nav-cta:hover::before {
    left: 100%;
}

/* Hover state */
.nav-cta:hover {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(204, 0, 0, 0.6);
    animation: none; /* Stop pulse on hover */
}

/* Arrow animation */
.nav-cta i {
    transition: transform 0.3s ease;
}

.nav-cta:hover i {
    transform: translateX(5px);
}

/* Active/Click state */
.nav-cta:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.5);
}

/* Hide mobile CTA on desktop */
.mobile-cta {
    display: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: #cc0000;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .nav-container {
        padding: 15px 20px;
    }

    .nav-menu {
        gap: 25px;
    }

    .nav-menu a {
        font-size: 0.95rem;
    }

    .nav-cta {
        padding: 12px 26px;
        font-size: 0.95rem;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 12px 15px;
    }

    .header-logo {
        font-size: 1.3rem;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
    }

    /* Hide desktop CTA */
    .desktop-cta {
        display: none;
    }

    /* Hide desktop menu by default */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, #003366 0%, #002244 100%);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 30px 30px;
        gap: 0;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
        transition: right 0.4s ease;
        overflow-y: auto;
    }

    /* Show menu when active */
    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 18px 0;
        font-size: 1.1rem;
        width: 100%;
    }

    .nav-menu a::after {
        display: none;
    }

    .nav-menu a.active {
        color: #cc0000;
    }

    /* Show mobile CTA wrapper */
    .mobile-cta-wrapper {
        display: block;
        width: 100%;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 2px solid rgba(204, 0, 0, 0.3);
    }

    /* Mobile CTA styling */
    .mobile-cta {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        width: 100%;
        padding: 16px 20px;
        font-size: 1.1rem;
        animation: pulse 2s ease-in-out infinite;
    }

    /* Mobile menu overlay */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header-logo {
        font-size: 1.1rem;
    }

    .mobile-menu-toggle {
        font-size: 1.6rem;
    }

    .nav-menu {
        width: 100%;
        padding: 70px 20px 20px;
    }

    .nav-menu a {
        font-size: 1rem;
        padding: 15px 0;
    }

    .mobile-cta {
        padding: 14px 20px;
        font-size: 1rem;
    }
}

/* Accessibility improvements */
.nav-menu a:focus,
.nav-cta:focus,
.mobile-menu-toggle:focus {
    outline: 2px solid #cc0000;
    outline-offset: 4px;
}

/* Animation for mobile menu icon */
.mobile-menu-toggle .fa-bars,
.mobile-menu-toggle .fa-times {
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:hover .fa-bars,
.mobile-menu-toggle:hover .fa-times {
    transform: rotate(90deg);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .nav-cta {
        animation: none;
    }
    
    .nav-cta::before {
        display: none;
    }
    
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Print styles */
@media print {
    .main-header {
        position: static;
        box-shadow: none;
    }

    .mobile-menu-toggle,
    .nav-cta {
        display: none;
    }
}