/* General & Fonts */
body {
    /* Push content down because navbar is fixed */
    padding-top: 90px;
    font-family: 'Poppins', sans-serif;
    background-color: #fff;
}

/* ================================================= */
/* STICKY FOOTER LOGIC */
/* ================================================= */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto; /* Main content takes up available space */
}

footer {
    flex-shrink: 0; /* Prevent footer from shrinking */
    width: 100%;
}

/* ================================================= */


/* Glassmorphism Navigation Bar Effect */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030; /* Bootstrap fixed-top default Z-index */

    /* Glass Effect */
    background-color: rgba(255, 255, 255, 0.85); /* Semi-transparent white */
    backdrop-filter: blur(6px); /* Apply blur to background elements */
    -webkit-backdrop-filter: blur(6px); /* Safari support */

    /* Subtle bottom line replacement for border-bottom */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
}


/* Base.html - Messages */
.alert {
    border-radius: 0.5rem;
}

/* Hero Banner Styling (Full Background Image Overlay) */
.hero-banner {
    /* Use background image properties */
    min-height: 350px;
    margin-top: 0; /* Flush to the top (under navbar) */
    margin-bottom: 0rem;

    /* ADDED rounded corners based on image */
    border-radius: 0rem;
    position: relative;

    /* Center the container content vertically */
    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 1;
    transition: transform 0.5s ease;
}

/* Ensure the inner content is always centered */
.hero-banner .hero-content {
    text-align: center;

    position: relative;
    color: #343a40;
    z-index: 3;
    max-width: 100%;
}

/* Pseudo element for darkening overlay for text readability */
.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.0);
    z-index: 2;
    border-radius: 0.75rem;
}

/* Blog detail hero: rounded image with stronger fade for text readability */
.blog-hero-banner {
    border-radius: 0.75rem;
    overflow: hidden;
}

.hero-content {
    position: relative;
    color: #343a40;
    z-index: 3;
    max-width: 100%;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 45rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .hero-content h1 {
        font-size: 3.75rem;
    }
}

@media (max-width: 768px) {
    .hero-banner {
        min-height: 200px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }
}

.trailer-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 20; /* Higher than image-overlay (z-index: 10) */
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s;
    line-height: 1.5;
}

.trailer-button:hover {
    background-color: rgba(0, 0, 0, 1);
}


/* Movie List Page: templates/bookings/movie_list.html */
.page-title {
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    font-weight: 600;
    color: #343a40;
}

.movie-card {
    transition: transform .2s ease-in-out, box-shadow .2s ease-in-out;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #fff;
}

.movie-card:hover {
    border-color: #A62124 !important;
}

.movie-card .card-title {
    font-weight: 600;
    color: #212529;
}

.movie-poster-container {
    position: relative;
    overflow: hidden;
    /* Reduced min-height to help with mobile stacking in list view */
    min-height: 200px;
}

.movie-card .poster-image {
    width: 100%; /* Ensure full width */
    object-fit: cover;
    object-position: top; /* Ensure the image is positioned from the top when cropped */
    height: 100%;
    transition: transform 0.3s ease;
}

@media (max-width: 991px) {
    /* Only apply max-height on small/medium screens for list view */
    #movie-list-container.list-view .movie-poster-container {
        min-height: 300px;
    }
}


.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    cursor: pointer;
}

.movie-poster-container:hover .image-overlay {
    opacity: 1;
}

.overlay-icon-wrapper {
    width: 65px;
    height: 65px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.overlay-icon-wrapper:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.overlay-icon {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    padding-left: 5px;
}

.movie-poster-container:hover .poster-image {
    transform: scale(1.05);
}

.screenings-title {
    font-weight: 600;
}


.video-modal .modal-dialog {
    max-width: 900px;
}

.video-modal .modal-body {
    padding: 0;
    position: relative;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
}

.video-modal iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Booking Form Page: templates/bookings/booking_form.html */
.booking-container {
    margin: 0px;
}

.summary-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #dee2e6;
    position: sticky;
    top: 2rem;
}

.summary-card .poster {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #dee2e6;
    padding: 2rem;
}

.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
}

.navbar {
    /* Use border-bottom for a controllable underline */
    border-bottom: 3px solid #A62124; /* Use the primary red color */
    padding-bottom: 2px; /* Small gap between text and line */
    /* Ensure it behaves like inline text */
    display: inline-block;
    /* Optional: to make the text bold if desired */
    /* font-weight: 700; */
}

.alert-info {
    /* Pastel Yellow Background: A light, soft yellow */
    --bs-alert-bg: #fffbe6;
    /* Darker text for readability */
    --bs-alert-color: #664d03;
    /* Soft border */
    --bs-alert-border-color: #ffecb5;
}

.text-primary {
    color: #A62124 !important
}

.bg-primary {
    background-color: #A62124 !important;
    border-color: #A62124 !important;
}

.btn-outline-primary {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: #000; /* Text is the primary color */
    background-color: transparent;
    border-color: #A62124;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary:not(:disabled):not(.disabled):active {
    color: #fff !important; /* Text turns white for contrast */
    background-color: #8C1C1F !important;
    border-color: #8C1C1F !important;
}

.btn-outline-primary:focus {
    /* Uses the same focus shadow color as the solid button */
    box-shadow: 0 0 0 0.25rem rgba(166, 33, 36, 0.5) !important;
}


.btn-outline-secondary {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
}

/* Custom Primary Button Color (Deep Red from Image) */
.btn-primary {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    background-color: #A62124;
    border-color: #A62124;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: #8C1C1F !important;
    border-color: #8C1C1F !important;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(166, 33, 36, 0.5) !important; /* Custom focus shadow */
}

h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #343a40;
}

.genre-badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Make sure Django form errors are visible */
.invalid-feedback {
    display: block;
}

.alert ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

/* Success/Failed Pages */
.success-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
}

.failed-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
}

/* New styles for Check-in Dashboard */
.stat-box {
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    min-width: 150px;
    margin: 0 5px; /* Add slight margin between boxes */
}

.stat-box h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-capacity {
    background-color: #f8f9fa; /* Light background */
    border: 1px solid #e9ecef;
}

.stat-expected {
    background-color: #e9f7fe; /* Light Blue background */
    border: 1px solid #bce6fb;
}

.stat-checked-in {
    background-color: #e6f9ed; /* Light Green background */
    border: 1px solid #a3e0b5;
}

.back-button {
    /* Appearance */
    display: inline-flex;
    align-items: center;
    background-color: #212529; /* Dark Gray/Black */
    color: #ffffff; /* White text */
    text-decoration: none;
    font-weight: 600;

    /* Spacing and Shape */
    padding: 0.3rem 1rem;
    border-radius: 0.3rem;
    margin-top: 1rem; /* Space from the navbar */
    margin-bottom: 0.5rem; /* Space above content */
}

.back-button:hover {
    background-color: #000000; /* Pure black on hover */
    color: #ffffff;
    text-decoration: none;
}

.back-button .arrow {
    margin-right: 8px;
    font-size: 1.2em;
    font-family: Arial, sans-serif; /* Ensure arrow symbol renders correctly */
}


/* ================================================= */
/* MOVIE LIST TOGGLE STYLES */
/* ================================================= */

.view-toggle-buttons {
    display: flex; /* Default display for desktop */
}

@media (max-width: 767.98px) {
    .view-toggle-buttons {
        /* Hide the container for the buttons on mobile */
        display: none !important;
    }
}

/* List View (Default: Wide Cards) */
#movie-list-container.list-view .movie-card {
    margin-bottom: 3rem !important; /* Retain original vertical spacing */
}

#movie-list-container.list-view .movie-card .row.g-0 {
    display: flex;
}

/* Grid View Styles */
#movie-list-container.grid-view {
    display: grid;
    /* Responsive Grid Columns */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 3rem;
}

#movie-list-container.grid-view .movie-card {
    margin-bottom: 0 !important;
    height: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

#movie-list-container.grid-view .movie-card .row.g-0 {
    display: block; /* Stack image and content vertically */
    height: 100%;
}

/* FIX: Ensure columns stack cleanly in Grid View mode */
#movie-list-container.grid-view .movie-poster-col,
#movie-list-container.grid-view .movie-info-col {
    /* Forces columns to 100% width, overriding col-sm-4/8, for proper grid stacking */
    width: 100%;
    padding: 0 !important;
}


#movie-list-container.grid-view .movie-poster-container {
    height: 350px;
    min-height: 250px;
}

#movie-list-container.grid-view .movie-poster-container img {
    width: 100%;
    height: 100%;
}

#movie-list-container.grid-view .card-body {
    padding: 1rem !important;
    /* Ensure card body is set up as flex column for content distribution */
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* FIX: Enforce minimum height for the variable content area (genres)
   This pushes the Screening area down consistently. */
#movie-list-container.grid-view .movie-static-content {
    min-height: 100px;
}


/* Equal Height Logic: The screening area expands to fill the remaining space */
#movie-list-container.grid-view .screenings-display-area {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Ensures the screenings area sits at the bottom edge */
    justify-content: flex-end;
}

#movie-list-container.grid-view .movie-description {
    /* Hide long description in grid view for compactness */
    display: none;
}

#movie-list-container.grid-view .screenings-title {
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem !important;
    font-size: 1.1rem;
    padding-top: 0.5rem; /* Add padding above title */
    border-top: 1px solid #eee; /* Add separator line */
}

#movie-list-container.grid-view .location-group {
    margin-bottom: 0.5rem !important;
}

#movie-list-container.grid-view .location-group p.small {
    /* Hide location details in small grid cards
    display: none;*/
}

#movie-list-container.grid-view .card-title {
    font-size: 1.5rem;
}

#movie-list-container.grid-view .movie-meta {
    font-size: 0.8rem;
}

.btn-screening {
    width: 130px!important;
    text-align: center;
    line-height: 1.2;
    padding: 1rem 0.6rem;
    font-size: 0.85rem;
}

/* 1. Ρυθμίζουμε το κουμπί ως σχετική θέση για να τοποθετήσουμε τη γραμμή */
.sold-out-button {
    position: relative;
    /* Προαιρετικά: Εξασφαλίζει ότι η γραμμή μένει μέσα στα όρια του κουμπιού */
    overflow: hidden;
}

/* 2. Δημιουργούμε τη διαγώνια γραμμή */
.sold-out-button::before {
    content: ""; /* Κενό περιεχόμενο, το χρησιμοποιούμε μόνο ως σχήμα */
    position: absolute;
    top: 50%; /* Ξεκινά περίπου στο μέσον */
    left: -10%; /* Ξεκινά λίγο έξω για να καλύψει όλο το πλάτος διαγώνια */
    width: 120%; /* Πλάτος μεγαλύτερο από το κουμπί */
    height: 3px; /* Πάχος της γραμμής */
    background-color: #9FA4AA; /* Χρώμα: Κόκκινο (Bootstrap danger color) */
    transform: rotate(-30deg); /* Περιστρέφουμε 30 μοίρες (μπορείτε να αλλάξετε τη γωνία) */
    z-index: 10; /* Το βάζουμε μπροστά από το περιεχόμενο */
    opacity: 0.3; /* Ελαφριά διαφάνεια */
}

/* Seat layout / stage box */
.seat-stage {
    border: 2px solid #dee2e6;
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.4rem 0.75rem;
    background-color: #f8f9fa;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #495057;
}

#seat-map {
    border: 2px solid #dee2e6;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 0.75rem;
    background-color: #ffffff;
    max-width: 100%;
    overflow-x: hidden; /* Prevent scroll, force shrinking */
}

/* Each row of seats stays on a single line; scroll horizontally if needed */
.seat-row {
    display: flex;          /* each row is its own horizontal flex line */
    flex-wrap: nowrap;      /* do not wrap seats to the next line */
    align-items: center;
    white-space: nowrap;    /* prevent label+seats from breaking */
    width: 100%; /* Ensure row fits within container */
    justify-content: center; /* Align items to start */
}

/* Base seat button look */
.seat-btn {
    display: inline-block;
    flex: 1; /* Allow grow/shrink */
    min-width: 0; /* Allow shrinking below content size */
    max-width: 15px; /* Cap max size */
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1; /* Maintain square shape */
    padding: 0; 
    border-radius: 15%; /* Rounded square */
    font-size: 10px;
    line-height: 1.2;
    margin-right: 2px;
    display: flex; 
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Hide text if too small */
}

/* Highlight selected seats */
.seat-btn.seat-selected {
    background-color: #198754; /* Bootstrap success green */
    color: #fff;
    border-color: #198754;
}

/* Grey out unavailable seats */
.seat-btn.seat-unavailable {
    background-color: #e9ecef;
    color: #6c757d;
    border-color: #ced4da;
}

/* Make excluded seats effectively invisible/empty */
.seat-btn.seat-excluded {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #ffffff;
    cursor: default;
    box-shadow: none;
    pointer-events: none;
}

/* Responsive adjustments to make seat map fit on small screens */
@media (max-width: 576px) {
    #seat-map {
        padding: 0.5rem;
        max-width: 100%; /* Ensure it doesn't overflow */
        overflow-x: hidden; /* avoid horizontal scroll */
    }

    .seat-stage {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .seat-row {
        flex-wrap: nowrap; /* Keep on one line, but shrink items */
        width: 100%;
        justify-content: center; /* Distribute space evenly if possible */
    }

    /* Smaller seats on mobile, scale down to fit */
    .seat-btn {
        /* Grow/Shrink to fill space evenly, but cap at 30px */
        flex: 1; 
        max-width: 15px; 
        min-width: 0; /* Allow shrinking below content */
        width: auto;
        height: auto;
        aspect-ratio: 1 / 1; /* Keep square */
        margin: 1px; 
        border-radius: 15%; /* Rounded square */
        font-size: 0; 
        line-height: 1;
    }
}
