/* ===========================================
   MOBILE LAYOUT - Index Page (City List)
   Only applies on screens <= 768px
   Matches the mobile design system from city pages
   =========================================== */

/* Hide mobile layout on desktop by default */
.mobile-index {
    display: none;
}

/* =========================================== 
   MOBILE STYLES - Active on small screens
   =========================================== */
@media (max-width: 768px) {

    /* Hide desktop layout completely */
    body>h1,
    body>div:not(.mobile-index) {
        display: none !important;
    }

    /* Override desktop body padding */
    body {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Show mobile container */
    .mobile-index {
        display: block;
        padding: 0;
        margin: 0;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
        min-height: 100vh;
        background: #f8f9fa;
    }

    /* Mobile Header */
    .mobile-index-header {
        position: sticky;
        top: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-bottom: 1px solid #dee2e6;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .mobile-index-title {
        font-size: 20px;
        font-weight: 600;
        color: #212529;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-index-title::before {
        content: '🎥';
        font-size: 24px;
    }

    /* Search Container */
    .mobile-city-search-container {
        padding: 12px 16px;
        background: #fff;
        border-bottom: 1px solid #e9ecef;
    }

    .mobile-city-search-input {
        width: 100%;
        padding: 12px 16px;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        font-size: 16px;
        box-sizing: border-box;
        transition: border-color 0.2s, box-shadow 0.2s;
        background: #f8f9fa;
    }

    .mobile-city-search-input:focus {
        outline: none;
        border-color: #0070f3;
        box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.1);
        background: #fff;
    }

    .mobile-city-search-input::placeholder {
        color: #adb5bd;
    }

    /* City List */
    .mobile-city-list {
        padding: 8px 12px 24px;
    }

    /* Letter Group */
    .mobile-city-group {
        margin-bottom: 16px;
    }

    .mobile-city-group.hidden {
        display: none;
    }

    .mobile-city-letter {
        font-size: 14px;
        font-weight: 600;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 8px 4px 4px;
        margin-bottom: 8px;
        border-bottom: 1px solid #e9ecef;
    }

    .mobile-city-cards {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* City Card */
    .mobile-city-card {
        display: block;
        padding: 14px 16px;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
        text-decoration: none;
        color: #212529;
        font-size: 16px;
        font-weight: 500;
        transition: all 0.2s;
        border: 1px solid transparent;
    }

    .mobile-city-card:hover,
    .mobile-city-card:active {
        background: #e7f5ff;
        border-color: #0070f3;
        color: #0070f3;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 112, 243, 0.15);
    }

    .mobile-city-card.hidden {
        display: none;
    }

    /* No Results Message */
    .mobile-no-cities {
        display: none;
        text-align: center;
        padding: 40px 20px;
        color: #6c757d;
    }

    .mobile-no-cities.active {
        display: block;
    }

    .mobile-no-cities p {
        margin: 0;
        font-size: 16px;
    }

    /* Footer */
    .mobile-index-footer {
        padding: 20px 16px 32px;
        text-align: center;
        border-top: 1px solid #e9ecef;
        margin-top: 16px;
        background: #fff;
    }

    .mobile-index-footer a {
        color: #6c757d;
        text-decoration: none;
        font-size: 14px;
        transition: color 0.2s;
    }

    .mobile-index-footer a:hover,
    .mobile-index-footer a:active {
        color: #0070f3;
    }
}

/* =========================================== 
   DARK MODE - Mobile Index
   =========================================== */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .mobile-index {
        background: #121212;
    }

    .mobile-index-header {
        background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
        border-bottom-color: #333;
    }

    .mobile-index-title {
        color: #f5f5f5;
    }

    .mobile-city-search-container {
        background: #1e1e1e;
        border-bottom-color: #333;
    }

    .mobile-city-search-input {
        background: #2d2d2d;
        border-color: #444;
        color: #f5f5f5;
    }

    .mobile-city-search-input:focus {
        border-color: #4a9eff;
        box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
        background: #333;
    }

    .mobile-city-search-input::placeholder {
        color: #6c757d;
    }

    .mobile-city-letter {
        color: #868e96;
        border-bottom-color: #333;
    }

    .mobile-city-card {
        background: #1e1e1e;
        color: #f5f5f5;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    }

    .mobile-city-card:hover,
    .mobile-city-card:active {
        background: #252525;
        border-color: #4a9eff;
        color: #4a9eff;
    }

    .mobile-no-cities {
        color: #868e96;
    }

    .mobile-index-footer {
        background: #1e1e1e;
        border-top-color: #333;
    }

    .mobile-index-footer a {
        color: #868e96;
    }

    .mobile-index-footer a:hover,
    .mobile-index-footer a:active {
        color: #4a9eff;
    }
}