/* ===========================================
   MOBILE LAYOUT - Wszystkie Kina
   Only applies on screens <= 768px
   =========================================== */

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

/* Hide mobile modal on desktop by default (it's outside .mobile-container) */
.mobile-modal,
.mobile-modal-overlay {
    display: none;
}

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

    /* Hide desktop layout completely */
    .main-grid {
        display: none !important;
    }

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

    /* Show mobile container */
    .mobile-container {
        display: block;
        padding: 0;
        margin: 0;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    }

    /* Mobile Header */
    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 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-home-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: #fff;
        color: #0070f3;
        text-decoration: none;
        font-size: 18px;
        line-height: 1;
        padding-bottom: 2px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        transition: all 0.2s;
    }

    .mobile-home-btn:hover,
    .mobile-home-btn:active {
        background: #0070f3;
        color: #fff;
    }

    .mobile-city-name {
        font-size: 18px;
        font-weight: 600;
        color: #212529;
    }

    .mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: none;
        border-radius: 8px;
        background: #0070f3;
        color: #fff;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
        transition: all 0.2s;
        box-shadow: 0 2px 4px rgba(0, 112, 243, 0.3);
    }

    .mobile-filter-btn:active {
        transform: scale(0.97);
        background: #0051d4;
    }

    .mobile-filter-btn.active {
        background: #ff6b35;
        box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
    }

    /* Movie List */
    .mobile-movie-list {
        padding: 4px;
    }

    /* Movie Card - Collapsed */
    .mobile-movie-card {
        background: #fff;
        border-radius: 12px;
        margin-bottom: 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        transition: box-shadow 0.2s;
    }

    .mobile-movie-card.expanded {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }

    .mobile-card-collapsed {
        display: flex;
        align-items: stretch;
        padding: 12px;
        cursor: pointer;
        gap: 12px;
    }

    .mobile-poster {
        width: 70px;
        height: 105px;
        object-fit: cover;
        border-radius: 6px;
        flex-shrink: 0;
        background: #e9ecef;
    }

    .mobile-card-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-width: 0;
    }

    .mobile-card-info h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #212529;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mobile-meta {
        font-size: 13px;
        color: #6c757d;
        margin-top: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mobile-summary {
        font-size: 14px;
        color: #0070f3;
        font-weight: 500;
        margin-top: auto;
        padding-top: 8px;
    }

    /* Details button row - hidden by default, shown when expanded */
    .mobile-details-row {
        display: none;
        padding: 0 12px 12px;
    }

    .mobile-movie-card.expanded .mobile-details-row {
        display: block;
    }

    .mobile-details-row .mobile-details-btn {
        padding: 8px 16px;
        font-size: 13px;
        font-weight: 500;
        background: #e7f5ff;
        color: #0070f3;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .mobile-details-row .mobile-details-btn:active {
        background: #0070f3;
        color: #fff;
    }

    .mobile-expand-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        color: #adb5bd;
        font-size: 12px;
        transition: transform 0.3s;
        flex-shrink: 0;
    }

    .mobile-movie-card.expanded .mobile-expand-icon {
        transform: rotate(180deg);
    }

    /* Movie Card - Expanded */
    .mobile-card-expanded {
        display: none;
        border-top: 1px solid #e9ecef;
    }

    .mobile-movie-card.expanded .mobile-card-expanded {
        display: block;
    }

    /* Day Navigation Tabs - HIDDEN (info already in day headers) */
    .mobile-day-tabs {
        display: none;
    }

    .mobile-day-tabs::-webkit-scrollbar {
        display: none;
    }

    .mobile-day-tab {
        flex: 0 0 auto;
        padding: 12px 16px;
        font-size: 13px;
        font-weight: 500;
        color: #6c757d;
        background: transparent;
        border: none;
        border-bottom: 2px solid transparent;
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s;
    }

    .mobile-day-tab.active {
        color: #0070f3;
        border-bottom-color: #0070f3;
        background: #fff;
    }

    /* Day Slider with Snap */
    .mobile-day-slider {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-day-slider::-webkit-scrollbar {
        display: none;
    }

    .mobile-day-pane {
        flex: 0 0 85%;
        scroll-snap-align: start;
        padding: 16px;
        min-height: 100px;
    }

    /* Show peek of adjacent days */
    .mobile-day-pane:first-child {
        padding-left: 16px;
    }

    .mobile-day-pane:last-child {
        flex: 0 0 85%;
        padding-right: 16px;
    }

    /* Scroll Indicator Dots */
    .mobile-scroll-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 8px 0 4px;
        background: #f8f9fa;
    }

    .mobile-scroll-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #868e96;
        transition: all 0.3s ease;
    }

    .mobile-scroll-dot.empty {
        background: #dee2e6;
    }

    .mobile-scroll-dot.active {
        width: 18px;
        border-radius: 3px;
        background: #0070f3;
    }

    /* Scroll Arrows - Minimal transparent style */
    .mobile-slider-container {
        position: relative;
    }

    .mobile-scroll-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        padding: 8px 4px;
        color: rgba(0, 112, 243, 0.5);
        font-size: 24px;
        font-weight: 300;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 10;
    }

    .mobile-scroll-arrow.visible {
        opacity: 1;
    }

    .mobile-scroll-arrow-left {
        left: 0;
    }

    .mobile-scroll-arrow-right {
        right: 0;
    }

    .mobile-day-header {
        font-size: 14px;
        font-weight: 600;
        color: #495057;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid #e9ecef;
    }

    /* Cinema Section within Day */
    .mobile-cinema-section {
        margin-bottom: 16px;
    }

    .mobile-cinema-section:last-child {
        margin-bottom: 0;
    }

    .mobile-cinema-name {
        font-size: 13px;
        font-weight: 600;
        color: #495057;
        margin-bottom: 8px;
    }

    .mobile-screenings {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-screening {
        display: inline-block;
        padding: 6px 12px;
        background: #e7f5ff;
        color: #0070f3;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.2s;
    }

    .mobile-screening:hover,
    .mobile-screening:active {
        background: #0070f3;
        color: #fff;
    }

    .mobile-screening.past-showtime {
        background: #f1f3f4;
        color: #888;
        text-decoration: line-through;
        opacity: 0.7;
    }

    .mobile-screening-tags {
        display: block;
        font-size: 10px;
        color: #6c757d;
        margin-top: 2px;
    }

    .mobile-no-screenings {
        color: #adb5bd;
        font-size: 14px;
        font-style: italic;
        padding: 8px 0;
    }

    /* Filter Bottom Sheet */
    .mobile-filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 200;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .mobile-filter-overlay.active {
        display: block;
        opacity: 1;
    }

    .mobile-filter-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-radius: 20px 20px 0 0;
        z-index: 201;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        max-height: 80vh;
        overflow-y: auto;
    }

    .mobile-filter-sheet.active {
        transform: translateY(0);
    }

    .mobile-filter-handle {
        width: 100%;
        padding: 16px 0;
        cursor: grab;
        touch-action: none;
    }

    .mobile-filter-handle::after {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #dee2e6;
        border-radius: 2px;
        margin: 0 auto;
    }

    .mobile-filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px 16px;
        border-bottom: 1px solid #e9ecef;
    }

    .mobile-filter-title {
        font-size: 18px;
        font-weight: 600;
        color: #212529;
    }

    .mobile-filter-clear {
        color: #0070f3;
        background: none;
        border: none;
        font-size: 14px;
        cursor: pointer;
        padding: 4px 8px;
    }

    .mobile-filter-content {
        padding: 16px 20px;
    }

    .mobile-filter-section {
        margin-bottom: 24px;
    }

    .mobile-filter-section:last-child {
        margin-bottom: 0;
    }

    .mobile-filter-section-title {
        font-size: 14px;
        font-weight: 600;
        color: #495057;
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Search Input in Filter */
    .mobile-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;
    }

    .mobile-search-input:focus {
        outline: none;
        border-color: #0070f3;
    }

    /* Filter Chips */
    .mobile-filter-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-filter-chip {
        display: inline-flex;
        align-items: center;
        padding: 8px 14px;
        background: #f1f3f4;
        border: 1px solid transparent;
        border-radius: 20px;
        font-size: 14px;
        color: #495057;
        cursor: pointer;
        transition: all 0.2s;
    }

    .mobile-filter-chip.selected {
        background: #e7f5ff;
        border-color: #0070f3;
        color: #0070f3;
    }

    .mobile-filter-chip input {
        display: none;
    }

    /* Ukryte Perełki Toggle */
    .mobile-ukryte-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
    }

    .mobile-ukryte-label {
        font-size: 15px;
        color: #212529;
    }

    .mobile-toggle-switch {
        position: relative;
        width: 50px;
        height: 28px;
        background: #dee2e6;
        border-radius: 14px;
        cursor: pointer;
        transition: background 0.3s;
    }

    .mobile-toggle-switch.active {
        background: #0070f3;
    }

    .mobile-toggle-switch::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 24px;
        height: 24px;
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s;
    }

    .mobile-toggle-switch.active::after {
        transform: translateX(22px);
    }

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

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

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

    /* Hidden class */
    .mobile-hidden {
        display: none !important;
    }


    /* Mobile Movie Modal */
    .mobile-modal-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 300;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .mobile-modal-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-modal {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 90vh;
        background: #fff;
        border-radius: 20px 20px 0 0;
        z-index: 301;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        overflow-y: auto;
    }

    .mobile-modal.active {
        transform: translateY(0);
    }

    .mobile-modal-handle {
        width: 100%;
        padding: 12px 0;
        cursor: grab;
        touch-action: none;
    }

    .mobile-modal-handle::after {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #dee2e6;
        border-radius: 2px;
        margin: 0 auto;
    }

    .mobile-modal-header {
        display: flex;
        align-items: flex-start;
        padding: 0 20px 16px;
        gap: 16px;
    }

    .mobile-modal-poster {
        width: 100px;
        height: 150px;
        object-fit: cover;
        border-radius: 8px;
        flex-shrink: 0;
        background: #e9ecef;
    }

    .mobile-modal-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-modal-title {
        margin: 0 0 8px;
        font-size: 20px;
        font-weight: 600;
        color: #212529;
        line-height: 1.3;
    }

    .mobile-modal-meta {
        font-size: 14px;
        color: #6c757d;
        margin-bottom: 8px;
    }

    .mobile-modal-meta-item {
        display: flex;
        gap: 8px;
        margin-bottom: 4px;
    }

    .mobile-modal-meta-label {
        color: #868e96;
    }

    .mobile-modal-meta-value {
        color: #212529;
    }

    .mobile-modal-google {
        display: inline-block;
        margin-top: 8px;
        padding: 8px 12px;
        background: #f1f3f4;
        color: #0070f3;
        border-radius: 6px;
        font-size: 13px;
        text-decoration: none;
    }

    .mobile-modal-google:active {
        background: #0070f3;
        color: #fff;
    }

    .mobile-modal-description {
        padding: 16px 20px;
        border-top: 1px solid #e9ecef;
    }

    .mobile-modal-description h4 {
        margin: 0 0 8px;
        font-size: 14px;
        font-weight: 600;
        color: #495057;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-modal-description p {
        margin: 0;
        font-size: 15px;
        color: #495057;
        line-height: 1.6;
    }
}

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

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

    .mobile-home-btn {
        background: #333;
        color: #4a9eff;
    }

    .mobile-home-btn:hover,
    .mobile-home-btn:active {
        background: #0070f3;
        color: #fff;
    }

    .mobile-city-name {
        color: #f5f5f5;
    }

    .mobile-movie-card {
        background: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .mobile-movie-card.expanded {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .mobile-card-info h3 {
        color: #f5f5f5;
    }

    .mobile-meta {
        color: #888;
    }

    .mobile-summary {
        color: #4a9eff;
    }

    .mobile-expand-icon {
        color: #666;
    }

    .mobile-card-expanded {
        border-top-color: #333;
    }

    .mobile-day-tabs {
        background: #2d2d2d;
        border-bottom-color: #333;
    }

    .mobile-day-tab {
        color: #888;
    }

    .mobile-day-tab.active {
        color: #4a9eff;
        border-bottom-color: #4a9eff;
        background: #1e1e1e;
    }

    .mobile-scroll-dots {
        background: #2d2d2d;
    }

    .mobile-scroll-dot {
        background: #888;
    }

    .mobile-scroll-dot.empty {
        background: #444;
    }

    .mobile-scroll-dot.active {
        background: #4a9eff;
    }

    .mobile-scroll-arrow {
        color: rgba(74, 158, 255, 0.5);
    }

    .mobile-day-header {
        color: #ccc;
        border-bottom-color: #333;
    }

    .mobile-cinema-name {
        color: #ccc;
    }

    .mobile-screening {
        background: #2d3a4d;
        color: #4a9eff;
    }

    .mobile-screening:hover,
    .mobile-screening:active {
        background: #0070f3;
        color: #fff;
    }

    .mobile-screening.past-showtime {
        background: #2d2d2d;
        color: #666;
    }

    .mobile-screening-tags {
        color: #888;
    }

    .mobile-no-screenings {
        color: #666;
    }

    .mobile-filter-sheet {
        background: #1e1e1e;
    }

    .mobile-filter-handle::after {
        background: #444;
    }

    .mobile-filter-header {
        border-bottom-color: #333;
    }

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

    .mobile-filter-clear {
        color: #4a9eff;
    }

    .mobile-filter-section-title {
        color: #ccc;
    }

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

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

    .mobile-search-input:focus {
        border-color: #4a9eff;
    }

    .mobile-filter-chip {
        background: #2d2d2d;
        color: #ccc;
    }

    .mobile-filter-chip.selected {
        background: #2d3a4d;
        border-color: #4a9eff;
        color: #4a9eff;
    }

    .mobile-ukryte-label {
        color: #f5f5f5;
    }

    .mobile-toggle-switch {
        background: #444;
    }

    .mobile-toggle-switch.active {
        background: #0070f3;
    }

    .mobile-poster {
        background: #2d2d2d;
    }

    .mobile-no-movies {
        color: #888;
    }

    /* Details Button - Dark Mode */
    .mobile-details-row .mobile-details-btn {
        background: #2d3a4d;
        color: #4a9eff;
    }

    .mobile-details-row .mobile-details-btn:active {
        background: #0070f3;
        color: #fff;
    }

    /* Mobile Modal - Dark Mode */
    .mobile-modal {
        background: #1e1e1e;
    }

    .mobile-modal-handle::after {
        background: #444;
    }

    .mobile-modal-poster {
        background: #2d2d2d;
    }

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

    .mobile-modal-meta-label {
        color: #888;
    }

    .mobile-modal-meta-value {
        color: #ccc;
    }

    .mobile-modal-google {
        background: #2d2d2d;
        color: #4a9eff;
    }

    .mobile-modal-google:active {
        background: #0070f3;
        color: #fff;
    }

    .mobile-modal-description {
        border-top-color: #333;
    }

    .mobile-modal-description h4 {
        color: #ccc;
    }

    .mobile-modal-description p {
        color: #aaa;
    }
}