/**
 * responsive.css - Mobile and responsive design enhancements
 * Additional responsive styles and mobile optimizations
 */

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Extra small devices (phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small devices (landscape phones, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .search-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .image-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vintage-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Medium devices (tablets, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .image-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .feature-highlights {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large devices (desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* ==========================================================================
   MOBILE NAVIGATION ENHANCEMENTS
   ========================================================================== */

@media (max-width: 767px) {
    /* Enhanced mobile navigation */
    #navcontainer {
        position: relative;
    }
    
    #navlist {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c3e50;
        flex-direction: column;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    #navcontainer.mobile-open #navlist {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    #navlist li {
        width: 100%;
        border-bottom: 1px solid rgba(236, 240, 241, 0.1);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    #navcontainer.mobile-open #navlist li {
        transform: translateX(0);
    }
    
    /* Stagger animation for menu items */
    #navcontainer.mobile-open #navlist li:nth-child(1) { transition-delay: 0.1s; }
    #navcontainer.mobile-open #navlist li:nth-child(2) { transition-delay: 0.15s; }
    #navcontainer.mobile-open #navlist li:nth-child(3) { transition-delay: 0.2s; }
    #navcontainer.mobile-open #navlist li:nth-child(4) { transition-delay: 0.25s; }
    #navcontainer.mobile-open #navlist li:nth-child(5) { transition-delay: 0.3s; }
    #navcontainer.mobile-open #navlist li:nth-child(6) { transition-delay: 0.35s; }
    #navcontainer.mobile-open #navlist li:nth-child(7) { transition-delay: 0.4s; }
    #navcontainer.mobile-open #navlist li:nth-child(8) { transition-delay: 0.45s; }
}

/* ==========================================================================
   MOBILE TOUCH OPTIMIZATIONS
   ========================================================================== */

@media (max-width: 767px) {
    /* Larger touch targets */
    .btn,
    .form-control,
    #navlist a,
    #navlist button {
        min-height: 44px;
    }
    
    /* Better spacing for touch */
    .stat-item,
    .member-list li,
    #setlist p {
        padding: 15px 10px;
    }
    
    /* Improved form controls for mobile */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 15px;
    }
    
    /* Better button sizing */
    .btn {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    /* Mobile-friendly table alternative */
    .result-row {
        display: block;
        background: white;
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .result-row > div {
        display: block;
        margin-bottom: 8px;
        padding: 0;
    }
    
    .result-row > div:last-child {
        margin-bottom: 0;
    }
}

/* ==========================================================================
   TABLET SPECIFIC ADJUSTMENTS
   ========================================================================== */

@media (min-width: 768px) and (max-width: 991px) {
    .search-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lineup-content {
        grid-template-columns: 250px 1fr;
        gap: 25px;
    }
    
    .lineup-image img {
        max-width: 250px;
    }
    
    .timeline-nav {
        position: static;
        margin-bottom: 20px;
    }
}

/* ==========================================================================
   LANDSCAPE PHONE OPTIMIZATIONS
   ========================================================================== */

@media (max-width: 767px) and (orientation: landscape) {
    .welcome-section,
    .content {
        padding: 30px 0;
    }
    
    .about-header,
    .timeline-header,
    .ahc-header {
        padding: 20px;
    }
    
    .about-header h1,
    .timeline-header h1,
    .ahc-header h1 {
        font-size: 1.8em;
    }
    
    /* Compact navigation for landscape */
    #navlist a,
    #navlist button {
        padding: 10px 20px;
        min-height: 50px;
    }
}

/* ==========================================================================
   VERY SMALL SCREENS (320px and below)
   ========================================================================== */

@media (max-width: 320px) {
    .container,
    .search-container,
    .results-container,
    .setlist-container,
    .song-details,
    .stats-container,
    .about-container,
    .timeline-container,
    .misc-container,
    .ahc-container,
    .contact-container {
        padding: 10px;
    }
    
    .content-section,
    .lineup-section,
    .stat-section,
    .search-form,
    .contact-form {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.4em;
    }
    
    .btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .form-control {
        padding: 12px;
    }
}

/* ==========================================================================
   HIGH DPI / RETINA DISPLAY OPTIMIZATIONS
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders and shadows for high DPI displays */
    .content-section,
    .lineup-section,
    .stat-section,
    .search-form,
    .contact-form {
        box-shadow: 0 1px 5px rgba(0,0,0,0.15);
    }
    
    .form-control {
        border-width: 1px;
    }
}

/* ==========================================================================
   DARK MODE SUPPORT
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --card-bg: #2d2d2d;
        --border-color: #404040;
    }
    
    body {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .content-section,
    .lineup-section,
    .stat-section,
    .search-form,
    .contact-form,
    .show-details,
    .setlist-section,
    .song-info {
        background-color: var(--card-bg);
        color: var(--text-color);
    }
    
    .form-control {
        background-color: var(--card-bg);
        border-color: var(--border-color);
        color: var(--text-color);
    }
    
    .form-control::placeholder {
        color: #999;
    }
}

/* ==========================================================================
   PRINT RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media print {
    /* Responsive print layout */
    .search-grid,
    .stats-grid,
    .image-gallery,
    .vintage-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .lineup-content {
        grid-template-columns: 1fr !important;
    }
    
    .timeline-nav,
    .mobile-menu-toggle,
    .form-actions {
        display: none !important;
    }
    
    /* Ensure text is readable when printed */
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
    }
    
    p, li, span {
        color: #333 !important;
    }
    
    /* Page break adjustments */
    .content-section,
    .lineup-section,
    .stat-section {
        page-break-inside: avoid;
        margin-bottom: 20px !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY RESPONSIVE ENHANCEMENTS
   ========================================================================== */

@media (max-width: 767px) {
    /* Larger focus indicators on mobile */
    .form-control:focus,
    .btn:focus,
    a:focus {
        outline: 3px solid #3498db;
        outline-offset: 2px;
    }
    
    /* Better spacing for screen readers */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

/* ==========================================================================
   KEYBOARD NAVIGATION SUPPORT
   ========================================================================== */

.keyboard-navigation *:focus {
    outline: 2px solid #3498db !important;
    outline-offset: 2px !important;
}

/* ==========================================================================
   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;
    }
    
    /* Remove transform transitions that might cause motion sickness */
    .gallery-item:hover,
    .vintage-item:hover,
    .stat-card:hover,
    .lineup-image img:hover {
        transform: none !important;
    }
}