/* Cyberuptive Header Styles */

/* CSS Variables */
:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --highlight: #e94560;
    --text: #f5f5f5;
    --text-secondary: #b8b8b8;
    --success: #00d25b;
    --warning: #ffab00;
    --danger: #f5365c;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root {
        --logo-gray: #d4d6d9;
        --logo-dark-gray: #b8b8b8;
        --logo-medium-gray: #9a9b9d;
    }
}

/* Light mode variables */
@media (prefers-color-scheme: light) {
    :root {
        --logo-gray: #a7a9ac;
        --logo-dark-gray: #414042;
        --logo-medium-gray: #5c5d60;
    }
}

/* Manual dark mode class */
.dark-mode {
    --logo-gray: #d4d6d9;
    --logo-dark-gray: #b8b8b8;
    --logo-medium-gray: #9a9b9d;
}

.light-mode {
    --logo-gray: #a7a9ac;
    --logo-dark-gray: #414042;
    --logo-medium-gray: #5c5d60;
}

/* Header Styles */
header {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(233, 69, 96, 0.1);
}

header.scrolled {
    background: rgba(26, 26, 46, 0.98);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo Styles */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
    z-index: 1001;
    position: relative;
}

.logo:hover {
    transform: scale(1.05);
}

.logo:focus {
    outline: 2px solid var(--highlight);
    outline-offset: 4px;
    border-radius: 4px;
}

/* SVG Logo Styles */
.logo-svg {
    height: 32px;
    width: auto;
    max-width: 220px;
    display: block;
}

/* Desktop logo shown by default */
.logo-desktop {
    display: block;
}

.logo-mobile {
    display: none;
}

/* Dynamic color classes for SVG */
.logo-svg .cls-9, /* Added cls-9 */
.logo-svg .cls-10 {
    fill: var(--logo-gray);
    transition: fill 0.3s ease;
}

.logo-svg .cls-12 {
    fill: var(--logo-dark-gray);
    transition: fill 0.3s ease;
}

.logo-svg .cls-13 {
    fill: var(--logo-medium-gray);
    transition: fill 0.3s ease;
}

/* Hover effect for logo colors */
.logo:hover .cls-9, /* Added cls-9 */
.logo:hover .cls-10,
.logo:hover .cls-12,
.logo:hover .cls-13 {
    fill: var(--highlight);
}

/* Logo text fallback (hidden by default, shown if SVG fails) */
.logo-text-fallback {
    position: absolute;
    left: -9999px;
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--highlight), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Show fallback text if SVG is not supported */
.no-svg .logo-svg {
    display: none;
}

.no-svg .logo-text-fallback {
    position: static;
    left: auto;
}

/* Desktop Navigation */
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover {
    color: var(--highlight);
    background: rgba(233, 69, 96, 0.1);
}

.nav-links a:focus {
    outline: 2px solid var(--highlight);
    outline-offset: 2px;
}

/* Active page indicator */
.nav-links a.active {
    color: var(--highlight);
    background: rgba(233, 69, 96, 0.15);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--highlight);
    border-radius: 50%;
}

/* Dropdown Arrow */
.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Styles */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 10px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    padding: 0.5rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
    position: relative; /* Needed for nested dropdown positioning */
}

/* Style for the links that are themselves dropdown triggers within a dropdown */
.dropdown-menu a.nav-link-sub-dropdown {
    display: flex;
    justify-content: space-between; /* Pushes arrow to the right */
    align-items: center;
}

/* Nested dropdown menu (sub-menu) styling */
.dropdown-menu .has-dropdown > .sub-menu {
    position: absolute;
    left: 100%; /* Position to the right of the parent li */
    top: 0; /* Align with the top of the parent li */
    min-width: 200px; /* Or match parent, or content-based */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px); /* Initial animation state */
    background: rgba(22, 33, 62, 0.95); /* Same as main dropdown */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0;
    margin: 0;
    transition: all 0.3s ease; /* Same transition as main dropdown */
}

.dropdown-menu .has-dropdown:hover > .sub-menu,
.dropdown-menu .has-dropdown:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    border-radius: 0;
    margin: 0;
    transition: all 0.3s ease;
    background: none;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus {
    background: rgba(233, 69, 96, 0.1);
    color: var(--highlight);
    padding-left: 2rem;
}

/* CTA Button */
.cta-button {
    background: linear-gradient(135deg, var(--highlight), #ff6b6b) !important;
    color: white !important;
    padding: 0.7rem 1.5rem !important;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
    border: none;
    cursor: pointer;
}

.cta-button:hover,
.cta-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
    background: linear-gradient(135deg, #ff6b6b, var(--highlight)) !important;
    color: white !important;
    outline: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
    background: rgba(233, 69, 96, 0.1);
    outline: none;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: var(--text);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(22, 33, 62, 0.98);
    backdrop-filter: blur(10px);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 999;
}

.mobile-nav[aria-hidden="false"] {
    transform: translateX(0);
}

.mobile-nav-list {
    list-style: none;
    padding: 2rem 0 1rem;
    margin: 0;
}

.mobile-nav-list > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-list a {
    display: block;
    padding: 1rem 2rem;
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.mobile-nav-list a:hover,
.mobile-nav-list a:focus,
.mobile-nav-list a.active {
    background: rgba(233, 69, 96, 0.1);
    color: var(--highlight);
    padding-left: 2.5rem;
    outline: none;
}

/* Mobile Dropdown */
.mobile-dropdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.mobile-dropdown .mobile-nav-link {
    flex: 1;
}

.mobile-dropdown-toggle {
    width: 60px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.mobile-dropdown-toggle:hover,
.mobile-dropdown-toggle:focus {
    background: rgba(233, 69, 96, 0.1);
    color: var(--highlight);
    outline: none;
}

.mobile-arrow {
    transition: transform 0.3s ease;
}

.mobile-dropdown-toggle[aria-expanded="true"] .mobile-arrow {
    transform: rotate(45deg);
}

.mobile-dropdown-content {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(15, 52, 96, 0.3);
}

.mobile-dropdown-toggle[aria-expanded="true"] ~ .mobile-dropdown-content {
    max-height: 400px;
}

.mobile-dropdown-content a {
    padding-left: 3rem;
    background: rgba(15, 52, 96, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-dropdown-content a:hover,
.mobile-dropdown-content a:focus {
    padding-left: 3.5rem;
}

/* Mobile CTA */
.mobile-cta {
    margin: 2rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--highlight), #ff6b6b);
    color: white;
    text-align: center;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.mobile-cta:hover,
.mobile-cta:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
    color: white;
    outline: none;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .nav-links {
        gap: 1.5rem;
    }
    
    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.95rem;
    }
    
    .logo-svg {
        height: 28px;
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    nav {
        padding: 0.8rem 5%;
    }
    
    /* Switch to mobile logo */
    .logo-desktop {
        display: none;
    }
    
    .logo-mobile {
        display: block;
        height: 24px;
        max-width: 180px;
    }
    
    .logo-text-fallback {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.8rem 3%;
    }
    
    .logo-mobile {
        height: 22px;
        max-width: 160px;
    }
    
    .logo-text-fallback {
        font-size: 1.2rem;
    }
    
    .mobile-nav-list a {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .mobile-dropdown-toggle {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .mobile-cta {
        margin: 1.5rem;
        padding: 0.8rem 1.5rem;
    }
}

/* Print styles */
@media print {
    header {
        position: static;
        background: white;
        color: black;
    }
    
    .logo-svg {
        filter: grayscale(1);
    }
    
    .mobile-menu-toggle,
    .mobile-nav {
        display: none !important;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}