/* Enhanced Responsive Design - Smooth Transitions Between Breakpoints */

/* Add fluid scaling to prevent abrupt changes */
:root {
    --fluid-padding: clamp(1rem, 3vw, 2rem);
    --fluid-gap: clamp(1rem, 2vw, 2rem);
    --fluid-font-base: clamp(1rem, 1.5vw, 1.125rem);
}

/* Smooth container transitions */
.container {
    padding-left: var(--fluid-padding);
    padding-right: var(--fluid-padding);
    transition: padding 0.3s ease;
}

/* Fluid typography scaling */
h1, .hero-title {
    font-size: clamp(1.75rem, 4vw, 4rem);
    line-height: 1.2;
}

h2, .section-header h2 {
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.125rem, 2.5vw, 1.75rem);
    line-height: 1.4;
}

p, .hero-subtitle {
    font-size: clamp(0.95rem, 1.25vw, 1.25rem);
    line-height: 1.6;
}

/* Smooth grid transitions - use auto-fit with fluid minmax */
.values-grid,
.practice-grid,
.benefits-grid,
.differences-grid,
.approach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: var(--fluid-gap);
    transition: gap 0.3s ease;
}

/* Enhanced two-column layouts with better breakpoints */
.hero-layout,
.why-choose-layout,
.contact-intro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: var(--fluid-gap);
    align-items: center;
}

/* Smooth CTA section transitions */
.cta-section {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: var(--fluid-gap);
}

/* Better case carousel responsive behavior */
.cases-carousel .case-item {
    flex: 0 0 clamp(280px, 33.333%, 400px);
    min-width: clamp(280px, 33.333%, 400px);
}

/* Intermediate breakpoint for tablets (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-layout,
    .why-choose-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .cases-carousel .case-item {
        flex: 0 0 calc(50% - 1rem);
        min-width: calc(50% - 1rem);
    }

    .nav-list {
        gap: 1.5rem;
    }

    .logo-img {
        height: 55px;
    }
}

/* Enhanced mobile navigation transitions */
@media (max-width: 768px) {
    .nav-menu {
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .logo-img {
        height: 50px;
    }

    /* Stack carousels on mobile */
    .cases-carousel .case-item,
    .article-slide {
        flex: 0 0 100%;
        min-width: 100%;
    }

    /* Prevent overflow */
    body {
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Better form responsiveness */
.hero-form,
.contact-form,
.hero-contact-form {
    padding: clamp(1.5rem, 3vw, 3rem);
    transition: padding 0.3s ease;
}

.form-row,
.form-grid,
.date-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 1rem;
}

/* CTA buttons fluid behavior */
.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.cta-primary,
.cta-secondary {
    flex: 1 1 auto;
    min-width: min(200px, 100%);
    max-width: 300px;
    text-align: center;
    white-space: nowrap;
}

/* Smooth image scaling */
img {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

/* Better stat cards responsive behavior */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: var(--fluid-gap);
}

/* Enhanced hero section responsiveness */
.hero {
    min-height: clamp(500px, 100vh - 70px, 100vh);
    padding: clamp(2rem, 5vh, 4rem) 0;
}

/* Fluid case details layout */
.case-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: var(--fluid-gap);
}

/* Better knowledge article grid */
.articles-grid,
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: var(--fluid-gap);
}

/* Smooth section padding */
section {
    padding: clamp(3rem, 8vh, 6rem) 0;
}

/* Enhanced eligibility carousel */
.eligibility-carousel-track {
    gap: var(--fluid-gap);
}

.eligibility-option {
    flex: 0 0 clamp(280px, 30%, 350px);
    min-width: clamp(280px, 30%, 350px);
}

/* Better mission section responsiveness */
.mission-content {
    padding: clamp(2rem, 4vw, 4rem);
}

/* Smooth practice area cards */
.practice-card {
    padding: clamp(1.5rem, 3vw, 2.5rem);
    transition: all 0.3s ease;
}

/* Enhanced footer responsiveness */
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: var(--fluid-gap);
}

/* Better approach items */
.approach-item {
    padding: clamp(1.5rem, 2.5vw, 2rem);
}

/* Smooth value items */
.value-item {
    padding: clamp(1.5rem, 2.5vw, 2rem);
}

/* Enhanced spacing utilities */
.section-spacing {
    margin: clamp(2rem, 5vh, 4rem) 0;
}

/* Prevent layout shift on orientation change */
@media (orientation: landscape) and (max-height: 600px) {
    .hero {
        min-height: 600px;
    }
}

/* Very small screens (< 400px) */
@media (max-width: 400px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-form,
    .contact-form {
        padding: 1.25rem;
    }

    .cta-primary,
    .cta-secondary {
        width: 100%;
        max-width: none;
    }
}

/* Large screens optimization (> 1400px) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }

    .cases-carousel .case-item {
        flex: 0 0 calc(25% - 1.5rem);
        min-width: calc(25% - 1.5rem);
    }
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

* {
    max-width: 100%;
}

/* Better focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

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

/* Reduce motion for users who prefer it */
@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;
    }
}

