/* WP TI MovieList V2 Plugin Styles - Using WordPress Global Variables */
.wpti-movies-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: var(--roboto-regular), Arial, sans-serif;
    color: var(--text-color);
}

.wpti-movie-row {
    display: flex;
    margin-bottom: 30px;
    background: var(--dark-card-backgroundcolor);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    min-height: 320px;
    align-items: stretch;
    border: 1px solid var(--border-tab-color);
    position: relative;
}

.wpti-movie-row .row-genres {
    position: absolute;
    top: -10px;
    left: 500px;
    right: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 10;
}

/* Poster Section - Fixed size */
.wpti-poster-section {
    flex: 0 0 220px;
    position: relative;
    height: 320px;
    margin-right: 15px;
    align-self: flex-start;
}

.wpti-poster-container {
    position: relative;
    width: 220px;
    height: 320px;
    overflow: visible;
    border-radius: 8px;
}

.wpti-poster-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.wpti-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.wpti-poster-link:hover .wpti-poster {
    transform: scale(1.02);
}

.wpti-poster-placeholder {
    width: 100%;
    height: 100%;
    background: var(--darker-gray-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--disabled-color);
    font-size: var(--text-xs);
    font-family: var(--roboto-regular);
    border-radius: 8px;
}

/* Version Badges - positioned on edge */
.wpti-version-badges {
    position: absolute;
    top: 8px;
    right: -15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.wpti-version-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: var(--text-xxs);
    font-family: var(--roboto-bold);
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Swapped colors: 2D gets the orange/red color, 3D gets the teal color */
.wpti-version-badge.wpti-2d {
    background: var(--ticket-color-hover);
    /* Orange/red color */
    color: var(--white-color);
}

.wpti-version-badge.wpti-3d {
    background: var(--ticket-color);
    /* Teal color */
    color: var(--white-color);
}

/* Frame Badges */
.wpti-frame-badges {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.wpti-frame-badge {
    background: var(--timeout-color);
    color: var(--white-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: var(--text-3xs);
    font-family: var(--roboto-bold);
    text-transform: uppercase;
}

/* Details Section - Can grow vertically */
.wpti-details-section {
    flex: 1;
    padding: 0px 20px 0px 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 320px;
}

.wpti-movie-title {
    font-size: var(--text-xl);
    font-family: var(--roboto-black);
    margin: 0 0 15px 0;
    color: var(--white-color);
    line-height: 1.1;
}

.wpti-title-link {
    color: var(--white-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.wpti-title-link:hover {
    color: var(--ticket-color);
}

.wpti-movie-description {
    flex: 1;
    font-size: var(--text-xs);
    font-family: var(--roboto-regular);
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 15px;
    overflow: hidden;
}

.wpti-movie-description p {
    margin: 0 0 8px 0;
}

.wpti-movie-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.wpti-rating {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: var(--text-3xs);
    font-family: var(--roboto-condensed-black) !important;
    font-weight: 700;
}

.wpti-rating-label {
    margin-right: 4px;
}

.wpti-rating-value {
    font-size: var(--text-3xs);
}

.wpti-rating-text {
    font-size: var(--text-3xs);
}

/* FSK Color System */
.wpti-fsk-0 {
    background: var(--white-color);
    color: var(--background-color);
}

.wpti-fsk-6 {
    background: var(--fsk6-color);
    color: var(--background-color);
}

.wpti-fsk-12 {
    background: var(--fsk12-color);
    color: var(--background-color);
}

.wpti-fsk-16 {
    background: var(--fsk16-color);
    color: var(--background-color);
}

.wpti-fsk-18 {
    background: var(--fsk18-color);
    color: var(--background-color);
}

.wpti-fsk-unknown {
    background: var(--disabled-color);
    color: var(--white-color);
}

.wpti-length {
    color: var(--text-color-hover);
    font-size: var(--text-xs);
    font-family: var(--roboto-medium);
}

.wpti-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.vip-saal {
    color: #ffd76b !important;
}

.vip-hinweis {
    position: absolute;
    left: 300px;
    bottom: -2px;
}

.wpti-genre {
    background: var(--ticket-color-hover);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: var(--text-3xs);
    font-family: var(--roboto-medium);
    color: var(--white-color);
}

/* Showtimes Section - Overlay Technique */
.wpti-showtimes-section {
    /* flex: 0 0 400px; */
    flex: 0 0 671px;
    padding: 20px;
    background: var(--background-color);
    border-left: 1px solid var(--border-tab-color);
    overflow: hidden;
    border-radius: 0 12px 12px 0;
    position: relative;
    min-height: 320px;
}

.wpti-showtimes-slider {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Master Scroll Container */
.wpti-showtimes-scroll-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.wpti-showtimes-scroll {
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-tab-color) transparent;
    height: auto;
    padding-bottom: 10px;
}

.wpti-showtimes-scroll::-webkit-scrollbar {
    height: 4px;
}

.wpti-showtimes-scroll::-webkit-scrollbar-track {
    background: var(--darker-gray-color);
    border-radius: 2px;
}

.wpti-showtimes-scroll::-webkit-scrollbar-thumb {
    background: var(--border-tab-color);
    border-radius: 2px;
}

.wpti-showtimes-content {
    min-width: max-content;
    position: relative;
}

/* Scrolling Date Headers */
.wpti-dates-header {
    display: flex;
    margin-bottom: 20px;
    min-width: max-content;
}

.wpti-date-header {
    flex: 0 0 80px;
    font-size: 12px;
    font-family: var(--roboto-black);
    /* Changed from roboto-bold to roboto-black for more emphasis */
    text-align: center;
    color: var(--text-color-hover);
    text-transform: uppercase;
    margin-right: 10px;
    font-weight: 700;
    letter-spacing: 0.1rem;
}

.wpti-date-header::before {
    content: " ";
}

/* Remove hidden headers - we'll position based on times rows directly */
.wpti-version-header-hidden {
    display: none;
}

/* Fixed Overlay Version Headers - Visible and stationary */
.wpti-version-overlay {
    position: absolute;
    left: 0;
    background: var(--quickticket-color);
    /* Swapped: 2D overlay gets orange */
    color: var(--white-color);
    padding: 2px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-family: var(--roboto-bold);
    text-align: center;
    text-transform: uppercase;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    height: 20px;
    line-height: 16px;
    white-space: nowrap;
    pointer-events: none;
    transition: top 0.2s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpti-version-overlay.wpti-3d-overlay {
    background: var(--ticket-color);
    /* Swapped: 3D overlay gets teal */
}

.wpti-version-overlay.wpti-2d-overlay {
    background: transparent;
    border: 1px solid var(--ticket-color);
}

/* Times Row - All scroll together */
.wpti-version-times-row {
    display: flex;
    min-width: max-content;
    margin-bottom: 25px;
    min-height: 28px;
    align-items: flex-start;
    padding-top: 5px;
}

.wpti-date-times {
    flex: 0 0 80px;
    display: grid;
    grid-template-rows: repeat(auto-fit, 25px);
    gap: 3px;
    margin-right: 10px;
    min-height: 28px;
    align-content: start;
    width: 80px;
}

/* Refined Time Buttons - Now as links */
.wpti-time-button {
    background: var(--ticket-color);
    color: var(--white-color);
    border: none;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: var(--text-2xs);
    font-family: var(--roboto-condensed);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
    width: 100%;
    box-sizing: border-box;
    grid-row: span 1;
    margin-top: 10px;
}

.wpti-time-button i {
    margin-right: 3px;
    font-size: 10px;
    opacity: 0.9;
    vertical-align: middle;
    line-height: 1;
}

.wpti-time-button:hover:not(.wpti-disabled) {
    background: var(--ticket-color-hover);
    transform: none;
    /* Remove translateY to prevent jumping */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    color: var(--white-color);
}

.wpti-time-button:active:not(.wpti-disabled) {
    transform: none;
    /* Remove translateY here too */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wpti-time-button.wpti-disabled {
    background: var(--disabled-color);
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
    pointer-events: none;
}

.wpti-time-button.wpti-past {
    background: var(--darker-gray-color);
    color: var(--disabled-color);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    pointer-events: none;
}

.wpti-time-button.wpti-past:hover {
    background: var(--darker-gray-color);
    color: var(--disabled-color);
    transform: none;
    box-shadow: none;
}

.wpti-time-placeholder {
    background: transparent;
    color: var(--disabled-color);
    border: none;
    padding: 4px 8px;
    border-radius: 0;
    font-size: var(--text-xs);
    font-family: var(--roboto-bold);
    text-align: center;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    opacity: 0.4;
    pointer-events: none;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
    grid-row: span 1;
    margin-top: 10px;
}

/* Navigation Arrows for master scroll */
.wpti-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--payment-button-background);
    color: var(--swiper-chevron-color);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.wpti-nav-arrow:hover {
    background: var(--border-tab-color);
    transform: translateY(-50%) scale(1.1);
}

.wpti-nav-left {
    left: 5px;
}

.wpti-nav-right {
    right: 5px;
}

/* New Badge */
.wpti-new-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white-color);
    color: var(--ticket-color);
    text-align: center;
    padding: 8px;
    font-family: var(--roboto-black);
    font-size: var(--text-xs);
    text-transform: uppercase;
    border-radius: 0 0 8px 8px;
    line-height: 0.8rem;
}

/* Responsive Design - Fixed Mobile Layout */
@media (max-width: 768px) {
    .wpti-movie-row {
        flex-direction: column;
        min-height: auto;
    }

    .wpti-poster-section {
        flex: none;
        width: 100%;
        height: 280px;
        /* Fixed height for mobile */
        display: flex;
        justify-content: center;
        align-items: center;
        /* Center the poster vertically */
        margin-right: 0;
        margin-bottom: 15px;
        padding: 15px;
        /* Add padding around the poster */
    }

    .wpti-poster-container {
        width: 180px;
        /* Larger poster on mobile */
        height: 250px;
        /* Proper aspect ratio */
        position: relative;
    }

    /* Fix badge positioning on mobile */
    .wpti-version-badges {
        right: -10px;
        /* Adjust for mobile */
        top: 10px;
    }

    .wpti-showtimes-section {
        flex: 1;
        border-left: none;
        border-top: 1px solid var(--border-tab-color);
        border-radius: 0;
        min-height: auto;
    }

    .wpti-details-section {
        min-height: auto;
        padding: 15px 20px;
        /* Adjust padding for mobile */
    }

    .wpti-date-header,
    .wpti-date-times {
        flex: 0 0 60px;
    }

    .wpti-movie-title {
        font-size: var(--text-md-lg);
    }

    .wpti-movie-description {
        font-size: var(--text-xxs);
    }

    .wpti-nav-left {
        left: 10px;
    }

    .wpti-nav-right {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .wpti-movies-container {
        padding: 10px;
    }

    .wpti-movie-row {
        margin-bottom: 20px;
    }

    .wpti-poster-section {
        height: 240px;
        /* Smaller on very small screens */
        padding: 10px;
    }

    .wpti-poster-container {
        width: 150px;
        /* Smaller poster for very small screens */
        height: 200px;
    }

    .wpti-version-badges {
        right: -8px;
        top: 8px;
    }

    .wpti-movie-title {
        font-size: var(--text-md-sm);
    }

    .wpti-movie-description {
        font-size: var(--text-xxs);
    }

    .wpti-date-header,
    .wpti-date-times {
        flex: 0 0 52px;
    }

    .wpti-time-button {
        font-size: var(--text-3xs);
        padding: 3px 6px;
        min-height: 20px;
    }
}