/* === Global layout === */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
    font-family: "Poppins", sans-serif;
    color: #222;
    overflow-y: auto;
    position: relative;

    /* Helps smooth scroll on some engines */
    -webkit-overflow-scrolling: touch;
}

/* Animated background particles (DISABLED IN KIOSK MODE because it repaints during scroll) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 0, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 0, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: particleFloat 20s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

/* === Top header === */
.top-section {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 32px 32px 24px;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);

    /* Lighter shadow to reduce paint cost */
    /* box-shadow: 0 6px 18px rgba(255, 0, 0, 0.25); */

    transition: padding 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

/* Shine effect on header (DISABLED IN KIOSK MODE) */
.top-section::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: headerShine 6s linear infinite;
}

@keyframes headerShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.top-section.shrink {
    padding: 18px 24px 14px;
    /* box-shadow: 0 5px 14px rgba(255, 0, 0, 0.28); */
}

/* Main title */
.title-wrapper {
    text-align: center;
    color: #ffffff;
    letter-spacing: 4px;
    position: relative;
    z-index: 1;
}

.title-main {
    font-size: 64px;
    font-weight: 900;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.6);
    background: linear-gradient(to bottom, #ffffff 0%, #ffe0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    /* Remove float animation in kiosk mode via overrides below */
    animation: titleFloat 2s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Scrolling tagline */
.subtitle-ticker {
    margin-top: 10px;
    width: 100%;
    max-width: 800px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 20px;
    font-weight: 500;
    color: #ffe9b0;
    opacity: 0.95;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.subtitle-ticker span {
    display: inline-block;
    padding-left: 100%;
    animation: marqueeSlide 18s linear infinite;
}

@keyframes marqueeSlide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* === Shows Grid === */
.shows-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding: 50px 60px 60px;
    position: relative;
    z-index: 1;
}

/* === Show Card === */
.show-card {
    background: linear-gradient(135deg, #ffffff 0%, #fffafa 100%);
    border-radius: 28px;
    padding: 20px 20px 24px;
    cursor: pointer;

    /* Lighter shadows */
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;

    /* Keep reveal animation for normal browsers; kiosk disables via override */
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: cardReveal 0.6s ease forwards;

    position: relative;
    overflow: hidden;

    /* Reduce transition workload */
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Shine effect on cards (DISABLED IN KIOSK MODE) */
.show-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 40%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 60%
    );
    transform: translateX(-100%) translateY(-100%);
    transition: transform 0.6s ease;
}

.show-card:hover::before {
    transform: translateX(0) translateY(0);
}

/* Stagger animation */
.show-card:nth-child(1) { animation-delay: 0.05s; }
.show-card:nth-child(2) { animation-delay: 0.10s; }
.show-card:nth-child(3) { animation-delay: 0.15s; }
.show-card:nth-child(4) { animation-delay: 0.20s; }
.show-card:nth-child(5) { animation-delay: 0.25s; }
.show-card:nth-child(6) { animation-delay: 0.30s; }

.show-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: #ff0000;
    box-shadow: 0 14px 28px rgba(255, 0, 0, 0.18);
}

/* Tap feedback for kiosk */
.show-card:active {
    transform: translateY(-4px) scale(0.99);
    transition: transform 0.08s ease;
}

/* Poster */
.poster-frame {
    border-radius: 20px;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.show-card:hover .poster-frame {
    box-shadow: 0 10px 20px rgba(255, 0, 0, 0.15);
    transform: scale(1.01);
}

.poster-frame img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    /* Reduce layout shifts */
    background: #f0f0f0;
}

/* Text */
.show-info {
    text-align: center;
    padding-top: 16px;
    position: relative;
    z-index: 1;
}

.show-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.show-details {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* No Shows */
.no-shows-msg {
    text-align: center;
    font-size: 24px;
    margin-top: 60px;
    color: #999;
    font-weight: 600;
    grid-column: 1 / -1;
}

@keyframes cardReveal {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive */
@media (max-width: 1024px) {
    .shows-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 40px 30px 50px;
        gap: 28px;
    }

    .title-main {
        font-size: 52px;
    }
}

/* Smooth scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    border-radius: 6px;
    border: 2px solid #f5f5f5;
}

/* =========================================================
   KIOSK MODE (Chromium 56 performance)
   ========================================================= */
body.kiosk::before {
    animation: none !important;
}

body.kiosk .top-section,
body.kiosk .title-main,
body.kiosk .subtitle-ticker span,
body.kiosk .show-card,
body.kiosk .show-card::before {
    animation: none !important;
}

body.kiosk .top-section::before {
    display: none !important;
}

body.kiosk .show-card {
    opacity: 1 !important;
    transform: none !important;
}

body.kiosk .show-card:hover,
body.kiosk .show-card:active {
    /* Avoid expensive hover scaling on kiosk */
    transform: none !important;
}
