/* ==============================================
   RESPONSIVE NAVIGATION STYLES
   Replace your /css/navigation.css with this
   ============================================== */

/* Prevent horizontal overflow */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* Header container constraints */
header {
    max-width: 100vw;
    overflow-x: hidden;
    position: sticky;
    top: 0;
    z-index: 9999 !important;
}

header .max-w-7xl {
    width: 100%;
}

/* Logo container fix */
header img {
    display: block;
    width: 40px;
    height: 40px;
    max-width: 100%;
    object-fit: contain;
}

@media (min-width: 768px) {
    header img {
        width: 48px;
        height: 48px;
    }
}

/* Prevent text overflow on small screens */
@media (max-width: 640px) {
    header .font-heading {
        font-size: 0.75rem !important;
        line-height: 1.1 !important;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    header .font-heading {
        font-size: 0.9rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    header .font-heading {
        font-size: 1rem !important;
    }
}

/* Navigation Link Base Styles */
.nav-link {
    display: block;
    padding: 0.65rem 0.75rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, #7c3aed, #eab308);
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: #7c3aed;
    background: #faf5ff;
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Active/Current Page */
.nav-link.active,
.nav-link[style*="border-primary"] {
    color: #7c3aed;
    background: #faf5ff;
    font-weight: 600;
}

.nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* Call-to-Action Link (Contact Us) */
.nav-link-cta {
    display: block;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3);
    white-space: nowrap;
}

.nav-link-cta:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(124, 58, 237, 0.4);
    color: white;
}

/* Mobile Navigation Drawer */
@media (max-width: 1023px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
        display: flex !important;
        flex-direction: column;
        padding: 6rem 1.5rem 2rem;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.2);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    /* Dark overlay when menu is open */
    .nav-links.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        z-index: -1;
        animation: fadeIn 0.3s ease;
    }
    
    .nav-links li {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 1.25rem !important;
        margin: 0 !important;
        font-size: 1.05rem;
        border-radius: 0.75rem;
        border-left: 4px solid transparent;
        transition: all 0.3s ease;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-link:hover,
    .nav-link.active {
        padding-left: 1.5rem !important;
        background: white;
        border-left-color: #7c3aed;
        box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
    }
    
    .nav-link-cta {
        margin-top: 1rem;
        text-align: center;
        box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    }
}

/* Desktop Navigation */
@media (min-width: 1024px) {
    .nav-links {
        display: flex !important;
        position: static;
        flex-direction: row;
        width: auto;
        height: auto;
        padding: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
        gap: 0.5rem;
    }
    
    .nav-links li {
        border: none;
    }
}

/* Hamburger Button Styles */
.hamburger {
    z-index: 1000;
    position: relative;
}

.hamburger i {
    transition: all 0.3s ease;
}

.hamburger:hover {
    background: #faf5ff;
}

.hamburger:active i {
    transform: scale(0.9);
}

/* Close icon when menu is open */
.nav-links.active ~ nav .hamburger i::before {
    content: '\f00d'; /* Font Awesome times/close icon */
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Header Shadow on Scroll */
header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

/* Mobile header padding fix */
@media (max-width: 640px) {
    header .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    header a {
        gap: 0.5rem !important;
    }
    
    header img {
        width: 35px !important;
        height: 35px !important;
        margin-left: 0.25rem;
    }
}

/* Hero section mobile fixes */
@media (max-width: 640px) {
    .carousel-slide h1 {
        font-size: 2rem !important;
        padding: 0 1rem;
        line-height: 1.2 !important;
    }
    
    .carousel-slide p {
        font-size: 1rem !important;
        padding: 0 1rem;
    }
    
    .carousel-slide .text-2xl {
        font-size: 1.25rem !important;
    }
    
    .carousel-slide > div {
        padding: 1.5rem !important;
    }
    
    .carousel-slide .space-x-4 {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin: 0 1rem;
    }
    
    .carousel-slide .space-x-4 a {
        margin: 0 !important;
        width: 100%;
        text-align: center;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .carousel-slide h1 {
        font-size: 2.5rem !important;
        padding: 0 1.5rem;
    }
    
    .carousel-slide p {
        padding: 0 1.5rem;
    }
}

/* About page and other page hero sections mobile fixes */
@media (max-width: 640px) {
    /* Page hero sections (non-carousel) */
    section.h-80 h1 {
        font-size: 2rem !important;
        padding: 0 1.5rem !important;
        line-height: 1.2 !important;
    }
    
    section.h-80 p {
        font-size: 1rem !important;
        padding: 0 1.5rem !important;
    }
    
    section.h-80 .max-w-4xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    section.h-80 h1 {
        font-size: 2.5rem !important;
        padding: 0 1.5rem;
    }
    
    section.h-80 p {
        font-size: 1.1rem !important;
        padding: 0 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    section.h-80 h1 {
        font-size: 3rem !important;
    }
}