/* --- 1. Variables & Root --- */
:root {
    --bg-deep: #020508;
    --bg-card: #050c14;
    --gold: #f6d167;
    --teal-glow: #0de7bc;
    --text-primary: #fcfcfc;
    --text-dim: #94a3b8;
    --sidebar-width: 300px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. Branded Scrollbar --- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { 
    background: linear-gradient(var(--teal-glow), var(--gold)); 
    border-radius: 10px; 
    border: 3px solid var(--bg-deep);
}

/* --- 3. Global Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Cinzel', serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
}

/* --- 4. Sidebar Navigation (Desktop) --- */
.theater-sidebar {
    /* Your existing properties will be here (width, position, etc.) */
    width: var(--sidebar-width); /* or whatever width you have set */
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background: var(--bg-card); /* or your specific background */
    border-right: 1px solid rgba(13, 231, 188, 0.1);
    padding: 40px 25px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    overflow-x: hidden; 
}


.theater-sidebar p, 
.theater-sidebar a, 
.theater-sidebar span {
    overflow-wrap: break-word; /* Modern standard */
    word-wrap: break-word;     /* Fallback for older browsers */
}

.logo-wrapper img, 
.sidebar-logo img {
    max-width: 100%; /* Ensures it never breaks out of the sidebar */
    height: auto;
    object-fit: contain;
}


nav ul { list-style: none; }
nav a {
    display: block;
    padding: 15px 40px;
    color: var(--text-dim);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

nav a:hover, nav a.active {
    color: var(--gold);
    background: rgba(246, 209, 103, 0.05);
    border-left-color: var(--gold);
}

.sidebar-spacer { flex-grow: 1; }

.sidebar-contact-block {
    padding: 30px;
    background: rgba(5, 12, 20, 0.8);
    border-top: 1px solid rgba(13, 231, 188, 0.1);
}

.sidebar-info-section h4 { font-size: 0.7rem; letter-spacing: 2px; color: var(--gold); margin-bottom: 10px; }
.sidebar-info-section p { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 5px; }

/* --- 5. Main Content Layout --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

.container {
    max-width: 950px;
    margin: 0 auto;
    padding: 60px 20px;
}

.section-title {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 30px;
}

/* --- 6. Unified Table Design --- */
.table-card {
    background: var(--bg-card);
    padding: 20px;
    border: 1px solid rgba(13, 231, 188, 0.1);
    margin-bottom: 60px;
}

.theater-table {
    width: 100%;
    border-collapse: collapse;
}

.theater-table thead tr {
    border-bottom: 1px solid rgba(13, 231, 188, 0.3);
    text-align: left;
}

.theater-table th {
    padding: 15px;
    color: var(--gold);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.theater-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.theater-table tr:last-child td { border-bottom: none; }

/* Specific Cell Content */
.col-main-info { font-weight: 700; font-size: 1.1rem; color: #fff; }
.col-sub-info { font-size: 0.85rem; color: var(--text-dim); margin-top: 5px; }

.col-poster img {
    width: 16vh;
    height: 16vh;
    object-fit: contain;
    border: 1px solid var(--teal-glow);
    display: block;
}

.col-action { text-align: right; }

/* --- 7. Magical Buttons --- */
.btn-magical {
    display: inline-block;
    padding: 12px 28px;
    border: 1px solid var(--teal-glow);
    color: var(--teal-glow);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    background: transparent;
    transition: var(--transition);
    cursor: pointer;
}

.btn-magical:hover {
    background: var(--teal-glow);
    color: var(--bg-deep);
    box-shadow: 0 0 15px rgba(13, 231, 188, 0.4);
    transform: translateY(-2px);
}

.btn-table {
    padding: 8px 18px;
    font-size: 0.7rem;
}

/* Hero Text Styling */
.slide-content {
    margin-top: auto;
    margin-bottom: 10%;
    text-align: left;
    max-width: 600px;
}

.hero-title {
    font-size: 4rem;
    color: var(--gold);
    margin-bottom: 10px;
    font-family: 'Cinzel Decorative', cursive;
    text-shadow: 0 4px 20px rgba(0,0,0,0.9);
}

.hero-text {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 40px;
    font-family: 'Montserrat', sans-serif;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
    line-height: 1.6;
}


/* --- 8. Hero Carousel --- */
.hero-carousel { position: relative; height: 80vh; overflow: hidden; }
.carousel-slide {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    display: flex; align-items: center; padding: 0 10%;
    opacity: 0; transition: opacity 1s ease;
}
.carousel-slide.active { opacity: 1; z-index: 2; }
.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.5); color: #fff; border: 1px solid var(--teal-glow);
    padding: 20px 15px; cursor: pointer; z-index: 100;
}
.prev { left: 20px; } .next { right: 20px; }

/* --- 9. Mobile Responsiveness --- */
@media (max-width: 1024px) {
    body { flex-direction: column; }
    
    .theater-sidebar {
        position: relative; 
        width: 100%; 
        height: auto;
        border-right: none; 
        border-bottom: 1px solid rgba(13, 231, 188, 0.1);
        overflow: hidden; /* Prevents unwanted scrolling in the header */
    }
    
    .main-content { 
        margin-left: 0; 
        width: 100%; 
    }
    
    /* Shrink the logo to save vertical space on phones */
    .logo-wrapper { text-align: center; padding: 15px 0 5px 0; }
    .logo-wrapper img { width: 80px; height: 80px; }
    
    .sidebar-spacer, .sidebar-contact-block, .sidebar-image { 
        display: none !important; 
    }
    
    nav ul { 
        display: flex; 
        justify-content: center; 
        flex-wrap: wrap; 
        padding-bottom: 10px;
    }
    
    nav a { 
        padding: 8px 12px; 
        border-left: none; 
        border-bottom: 2px solid transparent; 
        font-size: 0.8rem;
    }
    
    nav a.active { border-bottom-color: var(--gold); }
    
    .mobile-footer-reveal { 
        display: block !important; 
        padding: 50px 20px; 
        text-align: center; 
        background: var(--bg-card); 
        border-top: 1px solid rgba(13, 231, 188, 0.1);
    }
}

/* Tablet & Phones Global Tweaks */
@media (max-width: 768px) {
    .container { padding: 40px 15px; }
    
    .hero-carousel { height: 60vh; }
    .hero-title { font-size: 2.5rem; }
    .hero-text { font-size: 1rem; margin-bottom: 25px; }
    
    .section-title { font-size: 1.5rem; margin-bottom: 20px; }
    .table-card { padding: 15px; margin-bottom: 40px; }
}

/* Specific Table Fix for Phones */
@media (max-width: 650px) {
    .theater-table thead { display: none; }
    
    .theater-table tr { 
        display: block; 
        padding: 25px 0; 
        border-bottom: 1px solid rgba(13, 231, 188, 0.2); 
    }

    .theater-table td { 
        display: block; 
        width: 100%; 
        padding: 5px 0; 
        text-align: center !important;
        border: none;
    }

    .col-poster img {
        width: 100%;
        max-width: 200px;
        height: auto;
        aspect-ratio: 3/4;
        margin: 15px auto;
        box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    }

    .col-main-info { font-size: 1.2rem; }
    .col-sub-info { font-size: 0.9rem; margin-bottom: 10px; }

    .btn-table {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 15px auto 0;
    }
}

/* Specific Table Fix for Phones */
@media (max-width: 650px) {
    .theater-table thead { display: none; } /* Hide headers */
    
    .theater-table tr { 
        display: block; 
        padding: 30px 0; 
        border-bottom: 1px solid rgba(13, 231, 188, 0.2); 
    }

    .theater-table td { 
        display: block; 
        width: 100%; 
        padding: 10px 0; 
        text-align: center !important;
        border: none;
    }

    /* Cinematic Poster on Mobile */
   

    .col-main-info { font-size: 1.4rem; }
    .col-sub-info { font-size: 1rem; margin-bottom: 15px; }

    .btn-table {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 10px auto 0;
    }
}

.mobile-footer-reveal { display: none; }

/* --- Chess / Alternating Layout --- */
.chess-row {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 20px;
}

.chess-row.reverse {
    flex-direction: row-reverse;
}

.chess-image {
    flex: 0 0 300px; /* Fixes the width on desktop so it doesn't stretch */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.chess-image img {
    /* Magic for perfect circles */
    width: 240px;
    height: 100%;
    object-fit: contain  ; /* Prevents stretching/distortion */
    border-radius: 10%; /* Makes it round */
    
    /* Elegant Golden Frame */
    border: 4px solid var(--gold);
    
    /* Gives depth and a subtle glow */
    box-shadow: 0 5px 20px rgba(246, 209, 103, 0.3);
    
    transition: var(--transition);
}

.chess-image img:hover {
    box-shadow: 0 8px 25px rgba(246, 209, 103, 0.5);
    transform: translateY(-5px);
}

/* Update this class to allow shrinking */
.chess-text {
    flex: 1;
    min-width: 0; /* Changed from 300px to 0 so it never breaks bounds */
}

/* Replace your existing @media (max-width: 850px) block with this: */


@media (max-width: 850px) {
    /* Force both normal and reverse rows to stack vertically on mobile */
    .chess-row, 
    .chess-row.reverse {
        flex-direction: column;
        text-align: center; /* Centers text nicely when stacked */
        gap: 20px;
    }

    .chess-image {
        flex: 0 0 auto; 
        margin-bottom: 10px;
        width: 100%;
    }
    
    .chess-image img {
        width: 200px; /* Slightly smaller on phones */
        height: 200px;
    }
}


/* --- Sponsors Section --- */

.sponsors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    /* This is the magic: it centers the items even if there is only 1 */
    justify-content: center; 
    align-items: center;
    margin: 0 auto;
    padding: 20px 0;
}

.sponsor-item {
    /* Set a fixed base width so they don't look uneven */
    flex: 0 1 180px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.sponsor-item img {
    max-width: 160px;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: var(--transition);
}

.sponsor-item img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

@media (max-width: 600px) {
    .sponsors-grid {
        gap: 20px;
    }
    .sponsor-item {
        /* On mobile, this allows 2 items to sit side-by-side centered */
        flex: 0 1 40%; 
    }
}

/* --- 10. Contact Form Styles --- */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.theater-input, .theater-textarea {
    width: 100%;
    background: rgba(2, 5, 8, 0.5);
    border: 1px solid rgba(13, 231, 188, 0.2);
    padding: 15px;
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: var(--transition);
}

.theater-input:focus, .theater-textarea:focus {
    border-color: var(--teal-glow);
    box-shadow: 0 0 10px rgba(13, 231, 188, 0.2);
}

.theater-textarea {
    resize: vertical;
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
}

/* --- 11. Error 404 Page Styles --- */
.error-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 70vh; /* Centers the content vertically */
    text-align: center;
    padding: 40px 20px;
}

.error-code {
    font-size: 8rem;
    color: var(--gold);
    font-family: 'Cinzel Decorative', cursive;
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(246, 209, 103, 0.4); /* Magical golden glow */
}

.error-title {
    font-size: 2rem;
    color: var(--teal-glow);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.error-text {
    color: var(--text-dim);
    font-size: 1.1rem;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 40px;
    max-width: 500px;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .error-code {
        font-size: 6rem;
    }
    .error-title {
        font-size: 1.5rem;
    }
}

/* --- 12. Show Metadata Badges --- */
.show-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
    background: rgba(2, 5, 8, 0.6);
    border: 1px solid rgba(246, 209, 103, 0.3); /* Subtle gold border */
    border-radius: 4px;
}  

/* --- 13. Sidebar Banner Styles --- */
.sidebar-image {
    
    text-align: center;
    margin: 3px;
}

.sidebar-image img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(13, 231, 188, 0.3); /* Subtle teal border */
    transition: var(--transition);
}

.sidebar-image img:hover {
    box-shadow: 0 0 15px rgba(13, 231, 188, 0.4);
    transform: scale(1.02);
    border-color: var(--teal-glow);
}

/* Ensure it hides on mobile like the contact block */
@media (max-width: 1024px) {
    .sidebar-spacer, 
    .sidebar-contact-block, 
    .sidebar-image { 
        display: none !important; 
    }
}

/* This ensures arrows inside the event-specific carousel stay centered */
#event-carousel-container .carousel-arrow {
    background: rgba(5, 12, 20, 0.8);
    border: 1px solid var(--teal-glow);
    color: var(--teal-glow);
    padding: 20px 15px;
    z-index: 10;
    transition: var(--transition);
}

#event-carousel-container .carousel-arrow:hover {
    background: var(--teal-glow);
    color: var(--bg-deep);
}

/* Ensure the track fills the section */
.hero-carousel .carousel-track {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Ensure slides stay within the frame */
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

/* Arrow positioning for the event frame */
.carousel-arrow {
    z-index: 10;
    cursor: pointer;
}

/* Container for all text below the carousel */
.event-info-wrapper {
    padding: 40px 25px; /* Adds margin/padding to ALL sides (Top, Right, Bottom, Left) */
    max-width: 900px;   /* Keeps the text readable on wide screens */
    margin: 0 auto;     /* Centers the text block */
}

/* Spacing for the badges */
.show-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;          /* Adds margin between each badge */
    margin: 20px;   /* Spacing above badges */
}
/* Ensure the description has its own breathing room */
#event-description {
    line-height: 1.8;
    margin-top: 20px;
}

/* --- 14. Past Events  */
.past-event {
    filter: grayscale(100%);
    opacity: 0.5;
    transition: var(--transition);
}

.past-event:hover {
    filter: grayscale(40%); /* Slightly reveals color if they hover over it */
    opacity: 0.8;
}