/* ===================================================================
   RESPONSIVE.CSS - Mobile-First Responsive Styles
   Comprehensive responsive fixes for all breakpoints
   =================================================================== */

/* Add box-sizing globally */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent horizontal scrolling */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===================================================================
   FLUID CONTAINERS & RESPONSIVE WIDTHS
   =================================================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Remove all fixed widths - use max-width instead */
.hero-container,
.nav-container,
.footer-content {
    width: 100%;
    max-width: 100%;
}

/* ===================================================================
   RESPONSIVE IMAGES
   =================================================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Maintain aspect ratio for images */
.responsive-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ===================================================================
   CUSTOM FOCUS RINGS (Accessibility)
   =================================================================== */

/* Never remove outlines - use custom focus rings instead */
*:focus {
    outline: 3px solid #0b76ef;
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 3px solid #0b76ef;
    outline-offset: 2px;
}

/* Custom focus for interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #0b76ef;
    outline-offset: 2px;
}

/* ===================================================================
   MINIMUM TAP TARGET SIZES (44px minimum)
   =================================================================== */

a, button, .btn, .nav-link, .dropdown-item {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
}

/* Ensure form inputs have adequate tap targets */
input, select, textarea {
    min-height: 44px;
    padding: 0.75rem 1rem;
}

/* ===================================================================
   IMPROVED LINE HEIGHT & READABILITY
   =================================================================== */

body {
    line-height: 1.7;
}

p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
}

/* ===================================================================
   RESPONSIVE TYPOGRAPHY SCALING
   =================================================================== */

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h5 {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
}

h6 {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
}

/* ===================================================================
   SPACING SCALE (8px base, 12px, 16px system)
   =================================================================== */

.spacing-xs { margin: 0.5rem; padding: 0.5rem; } /* 8px */
.spacing-sm { margin: 0.75rem; padding: 0.75rem; } /* 12px */
.spacing-md { margin: 1rem; padding: 1rem; } /* 16px */
.spacing-lg { margin: 1.5rem; padding: 1.5rem; } /* 24px */
.spacing-xl { margin: 2rem; padding: 2rem; } /* 32px */

/* ===================================================================
   MOBILE NAVIGATION (Hamburger Menu)
   =================================================================== */

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 8px;
        min-height: 44px;
        min-width: 44px;
        transition: all 0.3s ease;
    }

    .mobile-menu-btn:hover {
        background: var(--light-green, #ecfdf5);
    }

    .mobile-menu-btn span {
        width: 25px;
        height: 3px;
        background: var(--gray-600, #4b5563);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

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

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

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

    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white, #ffffff);
        border-top: 1px solid var(--gray-200, #e5e7eb);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        z-index: 999;
    }

    .nav-menu.active {
        max-height: 100vh;
        animation: slideDown 0.3s ease-in-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem 2rem;
        border-radius: 0;
        min-height: 48px;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--gray-200, #e5e7eb);
        border-radius: 0;
        min-width: auto;
    }

    .dropdown-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   BREAKPOINT: 480px (Small Mobile)
   =================================================================== */

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    /* Hero section adjustments */
    .hero-section,
    .state-hero-section {
        padding: 2rem 0;
    }

    .hero-title,
    .state-hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* Card grid - single column */
    .states-grid,
    .features-grid,
    .quick-nav-grid,
    .monthly-links-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Table responsive */
    .holidays-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .holidays-table {
        font-size: 0.875rem;
    }

    .holidays-table th,
    .holidays-table td {
        padding: 0.5rem;
    }

    /* Buttons stack on small screens */
    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    /* Footer stacks */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 0 1rem;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

/* ===================================================================
   BREAKPOINT: 768px (Tablet Portrait)
   =================================================================== */

@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    /* Two-column grids */
    .states-grid,
    .features-grid,
    .monthly-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
    }

    .hero-visual {
        margin-top: 2rem;
    }
}

/* ===================================================================
   BREAKPOINT: 1024px (Tablet Landscape / Small Desktop)
   =================================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    .states-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .monthly-links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===================================================================
   BREAKPOINT: 1280px (Large Desktop)
   =================================================================== */

@media (min-width: 1025px) and (max-width: 1280px) {
    .container {
        max-width: 1140px;
    }

    .states-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .monthly-links-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===================================================================
   BREAKPOINT: 1280px+ (Extra Large Desktop)
   =================================================================== */

@media (min-width: 1281px) {
    .container {
        max-width: 1200px;
    }

    .states-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .monthly-links-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ===================================================================
   GRID LAYOUTS - Responsive Flexbox/Grid
   =================================================================== */

.states-grid,
.features-grid,
.quick-nav-grid,
.monthly-links-grid,
.related-states-grid {
    display: grid;
    gap: 1.5rem;
    width: 100%;
}

/* Default desktop layout */
@media (min-width: 1025px) {
    .states-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .monthly-links-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* ===================================================================
   PREVENT OVERLAPPING SECTIONS
   =================================================================== */

section {
    margin-bottom: 2rem;
    padding: 2rem 0;
}

@media (max-width: 768px) {
    section {
        margin-bottom: 1rem;
        padding: 1.5rem 0;
    }
}

/* ===================================================================
   SMOOTH ANIMATIONS
   =================================================================== */

.smooth-transition {
    transition: all 0.3s ease-in-out;
}

/* Smooth scroll for anchor links */
html {
    scroll-behavior: smooth;
}

/* ===================================================================
   HOVER & FOCUS STATES
   =================================================================== */

a:hover,
button:hover,
.btn:hover,
.card:hover,
.nav-link:hover,
.state-card-modern:hover,
.month-card:hover,
.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Focus states with proper outline */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 3px solid #0b76ef;
    outline-offset: 2px;
}

/* ===================================================================
   RESPONSIVE TABLES
   =================================================================== */

.holidays-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: 12px;
}

.holidays-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

@media (max-width: 768px) {
    .holidays-table {
        min-width: 500px;
        font-size: 0.875rem;
    }

    .holidays-table th,
    .holidays-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ===================================================================
   VIDEO/IFRAME EMBEDS - Responsive Aspect Ratio
   =================================================================== */

.video-container,
.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container video,
.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

@media (max-width: 768px) {
    .d-none-mobile { display: none !important; }
    .d-block-mobile { display: block !important; }
}

@media (min-width: 769px) {
    .d-none-desktop { display: none !important; }
    .d-block-desktop { display: block !important; }
}

/* ===================================================================
   SHADOW SEPARATION BETWEEN BLOCKS
   =================================================================== */

.card,
.status-card,
.info-card,
.feature-card,
.state-card-modern,
.month-card,
.nav-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ===================================================================
   PRINT STYLES
   =================================================================== */

@media print {
    .modern-navbar,
    .modern-footer,
    .mobile-menu-btn,
    .btn {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
    }
}
