/* Responsive Navigation and Header Styles */

/* Base responsive styles */
* {
    box-sizing: border-box;
}

/* Navigation responsive improvements */
nav {
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

nav .max-w-7xl {
    transition: padding 0.3s ease;
}

/* Logo responsive adjustments */
.logo-container {
    flex-shrink: 0;
}

.logo-container .w-6 {
    width: 1.5rem;
    height: 1.5rem;
}

.logo-container .w-8 {
    width: 2rem;
    height: 2rem;
}

/* Desktop navigation improvements */
@media (min-width: 1024px) {
    .desktop-nav {
        gap: 2rem;
    }

    .desktop-nav a {
        position: relative;
        padding: 0.5rem 0;
        font-weight: 500;
        transition: color 0.2s ease;
    }

    .desktop-nav a::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 0;
        height: 2px;
        background: linear-gradient(to right, #38bdf8, #4ade80);
        transition: width 0.3s ease;
    }

    .desktop-nav a:hover::after,
    .desktop-nav a.active::after {
        width: 100%;
    }
}

/* Mobile menu improvements */
.mobile-menu,
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 0.75rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(55, 65, 81, 0.3);
}

.mobile-menu.show,
#mobile-menu.show {
    max-height: 500px;
    opacity: 1;
}

.mobile-nav-link {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    transform: translateX(-5px);
    opacity: 0;
    animation: slideInFromLeft 0.3s ease forwards;
}

.mobile-nav-link:nth-child(1) {
    animation-delay: 0.05s;
}

.mobile-nav-link:nth-child(2) {
    animation-delay: 0.1s;
}

.mobile-nav-link:nth-child(3) {
    animation-delay: 0.15s;
}

.mobile-nav-link:nth-child(4) {
    animation-delay: 0.2s;
}

.mobile-nav-link:nth-child(5) {
    animation-delay: 0.25s;
}

.mobile-nav-link:nth-child(6) {
    animation-delay: 0.3s;
}

.mobile-nav-link:nth-child(7) {
    animation-delay: 0.35s;
}

.mobile-nav-link:nth-child(8) {
    animation-delay: 0.4s;
}

@keyframes slideInFromLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mobile-nav-link:hover {
    background-color: rgba(55, 65, 81, 0.5);
    border-left-color: #38bdf8;
}

.mobile-nav-link.active {
    background-color: rgba(55, 65, 81, 0.7);
    color: white;
    border-left-color: #38bdf8;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.mobile-menu-toggle:hover {
    background-color: rgba(55, 65, 81, 0.5);
}

.mobile-menu-toggle:focus {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

/* Icon transitions */
.menu-icon,
.close-icon {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hamburger icon animation */
#mobile-menu-toggle {
    transform-origin: center;
    transition: transform 0.2s ease;
    position: relative;
}

#mobile-menu-toggle:active {
    transform: scale(0.95);
}

#mobile-menu-toggle:hover {
    background-color: rgba(55, 65, 81, 0.5);
}

/* Add a subtle pulse effect when menu is active */
#mobile-menu-toggle.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(56, 189, 248, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    }
}

/* Icon rotation animation */
#menu-icon {
    transform: rotate(0deg);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#close-icon {
    transform: rotate(180deg);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#mobile-menu-toggle.active #menu-icon {
    transform: rotate(180deg);
    opacity: 0;
}

#mobile-menu-toggle.active #close-icon {
    transform: rotate(0deg);
    opacity: 1;
}

/* Mobile menu slide animation */
#mobile-menu {
    transform: translateY(-10px);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.show {
    transform: translateY(0);
}

/* CTA Button responsive */
.cta-button {
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px 0 rgba(56, 189, 248, 0.25);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px 0 rgba(56, 189, 248, 0.4);
}

.cta-button:active {
    transform: scale(0.98);
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }

    .desktop-cta {
        display: none;
    }
}

@media (max-width: 768px) {
    nav .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .mobile-cta {
        margin-top: 1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .mobile-cta .cta-button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 640px) {
    nav .max-w-7xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .logo-text {
        font-size: 1.125rem;
        /* text-lg */
    }

    .mobile-nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    nav .max-w-7xl {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .mobile-nav-link {
        font-size: 0.875rem;
    }
}

/* Smooth scrolling and focus management */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.nav-link:focus,
.mobile-nav-link:focus {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Animation for header loading */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-loaded {
    animation: slideDown 0.5s ease-out forwards;
}

/* Backdrop blur fallback */
@supports not (backdrop-filter: blur(12px)) {
    nav {
        background-color: rgba(0, 0, 0, 0.95);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {

    .nav-link,
    .mobile-nav-link {
        border: 1px solid transparent;
    }

    .nav-link:hover,
    .mobile-nav-link:hover,
    .nav-link.active,
    .mobile-nav-link.active {
        border-color: currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .mobile-menu {
        transition: none;
    }
}

/* Print styles */
@media print {
    nav {
        display: none;
    }

    .mobile-menu {
        display: none;
    }
}