@font-face {
    font-family: 'Ginto Nord';
    src: url('fonts/GintoNord-Black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: 'Ginto Normal';
    src: url('fonts/GintoNormal-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Ginto Normal', 'Roboto', sans-serif;
    margin: 0;
    background-color: #121212; /* Dark background */
    color: #e0e0e0; /* Light grey text */
    overscroll-behavior-x: none; /* Prevents overscroll glow on some browsers */
    /* Allow content to be selectable */
    user-select: text; /* Standard */
    -webkit-user-select: text; /* Safari */
    -moz-user-select: text; /* Firefox */
    -ms-user-select: text; /* IE/Edge */
    display: flex; /* Use flexbox for overall layout */
    flex-direction: column; /* Stack h1 and container vertically */
    height: 100vh; /* Make body take full viewport height */
}

:root {
    --header-height: 60px; /* Default, will be updated by JS */
    --time-column-width: 80px; /* Default, can be adjusted */
    --current-time-line-color: #ff6347; /* Tomato color for the line */
    --event-bg-color: #2a2a2a;
    --event-border-color: #444;
    --event-hover-bg-color: #383838;
    --sticky-bg-color: #1e1e1e; /* Slightly different from body for sticky elements */
    --text-color: #e0e0e0;
    --link-color: #8ab4f8; /* A light blue for links */
}

/* Utility class to hide elements */
.hidden {
    display: none !important;
}

html {
    /* background-color: hotpink; */ /* To see page boundaries */
    background-color: #000; /* Set HTML background to black */
}

h1 {
    font-family: 'Ginto Nord', sans-serif;
    text-align: center;
    padding: 20px; 
    margin: 0;
    font-size: 1.2em; /* Reverted to previous size */
    font-weight: bold;
    background-color: #000; /* Ensure black background */
    flex-shrink: 0; 
    position: relative; /* For pseudo-element positioning */
    /* color: #0F0; */ /* Moved to h1 span */
    /* animation: textShiftGreen 8s ease-in-out infinite alternate; */ /* Moved to h1 span */
}

h1 > span {
    display: inline-block; /* Allows transform and keeps it inline-ish */
    position: relative; /* Stacking context if needed, good practice */
    color: #0F0; /* Green layer */
    animation: textShiftGreen 8s ease-in-out infinite alternate; /* Animation for Green layer */
}

h1::before,
h1::after {
    content: "Ignite Lineup 2025"; /* Same text as h1 */
    position: absolute;
    /* Make pseudo-elements occupy the H1's content box area */
    top: 20px;    /* Corresponds to h1 padding-top */
    left: 20px;   /* Corresponds to h1 padding-left */
    right: 20px;  /* Corresponds to h1 padding-right */
    bottom: 20px; /* Corresponds to h1 padding-bottom */
    
    mix-blend-mode: screen; /* Additive blending */
    z-index: 1; 
    /* Flexbox to center text within this content box */
    display: flex;
    align-items: center;
    justify-content: center;
}

h1::before {
    color: #F00; /* Red layer */
    transform: translate(-1.5px, -1.5px);
    animation: textShift1 7s ease-in-out infinite alternate;
}

h1::after {
    color: #00F; /* Blue layer */
    transform: translate(1.5px, 1.5px);
    animation: textShift2 9s ease-in-out infinite alternate;
}

@keyframes textShift1 {
    0% {
        transform: translate(-1.5px, -1.5px);
    }
    25% {
        transform: translate(1.5px, -1px); /* Move right, slightly up-ish */
    }
    50% {
        transform: translate(1px, 1.5px);   /* Move down-right */
    }
    75% {
        transform: translate(-1px, 1px);    /* Move up-left */
    }
    100% {
        transform: translate(-1.5px, -1.5px); /* Return to start */
    }
}

@keyframes textShift2 {
    0% {
        transform: translate(1.5px, 1.5px);
    }
    25% {
        transform: translate(-1px, 1px);   /* Move up-left */
    }
    50% {
        transform: translate(-1.5px, -1px); /* Move left, slightly up-ish */
    }
    75% {
        transform: translate(1px, -1.5px);  /* Move down-right */
    }
    100% {
        transform: translate(1.5px, 1.5px); /* Return to start */
    }
}

@keyframes textShiftGreen {
    0% {
        transform: translate(0px, 0px);
    }
    25% {
        transform: translate(0.5px, -1.5px);
    }
    50% {
        transform: translate(-1.5px, 0.5px);
    }
    75% {
        transform: translate(1px, 1px);
    }
    100% {
        transform: translate(0px, 0px); /* Return to start */
    }
}

.schedule-container {
    position: relative; 
    overflow: auto; /* Allow both x and y scrolling for the container itself */
    width: 100%;
    flex-grow: 1; /* Allow container to take remaining space */
    padding: 0; /* Ensure no padding influences scroll width */
}

table {
    /* width: max-content; */ /* Reverting this for now */
    /* min-width: 100%; */
    /* margin-left: auto; */
    /* margin-right: auto; */
    display: table; /* Default, but can reinforce layout context */
    border-collapse: collapse;
    /* border: 5px solid lime; */ /* Removed temporary border */
    /* Table itself won't scroll, the container will */
    overflow: visible; /* Explicitly set for sticky children */
}

th, td {
    border: 1px solid #3a3a3a; 
    padding: 8px;
    text-align: left;
    vertical-align: top; 
    min-width: 100px; 
    height: 40px; 
    box-sizing: border-box; /* Crucial */
    background-color: var(--event-bg-color); /* Default for event cells */
    white-space: pre-line; 
    margin: 0; 
    background-clip: border-box; /* Background extends to outer edge of border */
}

/* Header cells (Stage Names) */
thead th {
    background-color: var(--sticky-bg-color);
    color: var(--text-color);
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 101;
    vertical-align: middle; 
    font-size: 0.8em;
    min-height: 50px; 
    padding-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a3a3a; 
}

thead tr th {
    font-family: 'Ginto Nord', sans-serif;
}

/* First column header (top-left cell) */
thead th:first-child {
    position: sticky;
    left: 0;
    top: 0; /* Ensure it also sticks to the top */
    background-color: var(--sticky-bg-color);
    z-index: 5; /* Highest: above all other sticky elements at the corner */
    width: var(--time-column-width);
    min-width: var(--time-column-width);
    max-width: var(--time-column-width);
    text-align: center; /* Center time text */
    vertical-align: top; /* For time-text-inner positioning */
    font-size: 1em; /* Reset font size for the top-left cell, or style as desired */
    /* Explicitly define borders that interact with scrolling content */
    border-right: 1px solid #3a3a3a;
    border-bottom: 1px solid #3a3a3a;
}

/* Time slot cells (first child td in tbody rows) */
tbody tr td:first-child {
    position: sticky; /* Establishes stacking context */
    left: 0;
    background-color: var(--sticky-bg-color); /* Restore direct background */
    z-index: 100; 
    width: var(--time-column-width); 
    min-width: var(--time-column-width);
    max-width: var(--time-column-width);
    padding: 0; 
    text-align: center; 
    vertical-align: top; 
    /* Explicitly define the border that interacts with scrolling content */
    border-right: 1px solid #3a3a3a;
}

.time-text-inner {
    display: inline-block; 
    position: relative;
    top: -1em;  
    padding: 6px 4px; 
    line-height: 1; 
    color: var(--text-color);
    font-size: 0.75em; /* Smaller font size for time */
}

/* Styling for non-time, non-day-row special text in the first column */
tbody tr td:first-child.special-text {
    font-weight: bold;
    font-size: 0.8em; 
    background-color: #e8e8e8; 
    vertical-align: middle; /* Keep these centered */
    padding: 6px 4px; /* Ensure they have padding */
}

/* Day rows (identified by JS adding .day-row class to <tr> or <td>) */
/* Using a very specific selector to override general td:first-child rules without !important */
tbody tr.day-row td:first-child { /* This is the TD that spans the entire row for a day */
    position: sticky;
    top: var(--header-height); /* Stick directly below the header */
    left: 0; 
    right: 0; /* Ensure it spans full width when sticky */
    z-index: 3; 
    padding: 12px 0; 
    text-align: center; 
    background-color: #333; /* Solid background for the whole day row cell */
    color: #fff;
    font-weight: bold;
    box-sizing: border-box; 
    margin: 0;
    background-clip: border-box;
    /* Specific borders for clean look when sticky */
    border-top: 1px solid #333; /* Match background */
    border-bottom: 1px solid #333; /* Match background */
    border-left: 1px solid #3a3a3a; /* Consistent with table grid */
    border-right: 1px solid #3a3a3a; /* Consistent with table grid */
}

.day-name-sticky-text {
    position: absolute; 
    top: 50%;
    transform: translateY(-50%);
    display: inline-block; 
    color: #fff;
    font-weight: bold;
    padding: 0 15px; 
    white-space: nowrap; 
    /* `left` style will be set by JavaScript */
    z-index: 1; /* Relative to its parent TD (which has z-index 3), so effectively 3+ for stacking contexts */
}

.event-cell-populated {
    font-family: 'Ginto Nord', sans-serif;
    font-size: 0.85em; /* Smaller font for event titles */
}

#currentTimeLine {
    position: absolute;
    height: 2px;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 3; /* Same level as day-row backgrounds, potentially under day-name-sticky-text */
    display: none; 
    pointer-events: none; 
    opacity: 1;     /* Ensure it's opaque (parent .overlay handles fade-in) */
    z-index: 1002; 
}

.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/* Added tbody and tr.day-row to have explicit overflow:visible */
tbody,
tr.day-row {
    overflow: visible; /* Explicitly set for sticky children */
}

/* Loader Styles */
.loader-container {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex; /* Kept for future, though canvas will fill */
    justify-content: center; /* Kept for future */
    align-items: center; /* Kept for future */
    background-color: #000; /* Black background for space */
    z-index: 1000; 
    overflow: hidden; /* Hide scrollbars if canvas is slightly off */
}

.loader-container.hidden {
    display: none;
}

#particleCanvas {
    display: none; /* Initially hidden, shown by JS */
    width: 100%;
    height: 100%;
}

/* Remove old #loaderGif style */
/*
#loaderGif {
    width: 50px; 
    height: 50px; 
}
*/ 

/* Event Overlay Styles */
.overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top */
    padding: 20px;
    box-sizing: border-box;
}

.overlay-content {
    background-color: #ffffff;
    padding: 20px 30px 30px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    color: #333;
    border-top: 5px solid #007bff; /* Accent color top border */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform: scale(0.95);
    opacity: 0;
}

/* When overlay-container is NOT hidden, then the content animates in */
.overlay-container:not(.hidden) .overlay-content {
    transform: scale(1);
    opacity: 1;
}

.overlay-close-button {
    position: sticky;
    top: -15px; /* Adjust for parent padding: 15px_visual_gap - 30px_padding_top */
    right: -15px; /* Adjust for parent padding: 15px_visual_gap - 30px_padding_right */
    display: block; /* Allow margin-left: auto to work */
    margin-left: auto; /* Push to the right */
    margin-right: 0; /* Explicitly define button position within its own generated box */
    margin-bottom: 0; /* Ensure no accidental bottom margin from previous attempts */
    margin-top: -15px; /* Match the 'top' sticky offset */

    background-color: rgba(0, 0, 0, 0.5); 
    color: #fff; 
    border: none;
    border-radius: 50%; 
    width: 36px; 
    height: 36px; 
    font-size: 20px; 
    line-height: 36px; 
    text-align: center; 
    cursor: pointer;
    z-index: 20; /* Ensure it's above other content within its own .overlay-content */
    transition: background-color 0.2s ease;
}

.overlay-close-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.overlay-content h2 {
    font-family: 'Ginto Nord', sans-serif;
    margin-top: 10px;
    margin-bottom: 25px;
    color: #fff; /* Brighter color for titles in overlay */
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.overlay-content p {
    margin-bottom: 12px;
    line-height: 1.7;
    font-size: 16px;
}

.overlay-content strong {
    color: #111;
    font-weight: 600;
}

.description-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 12px 15px;
    margin-top: 8px;
    margin-bottom: 20px;
    border-radius: 6px;
    min-height: 60px;
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.6;
    color: #454545;
}

/* Prevent body scroll when overlay is open */
body.overlay-open {
    overflow: hidden;
}

/* Unified Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker overlay */
    
    display: none; /* Initially hidden */
    align-items: center;
    justify-content: center;
    z-index: 1001; 

    opacity: 0; /* Start transparent */
    transition: opacity 0.3s ease;
    /* pointer-events: none; /* Not needed if display: none */
}

.overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important; /* Explicitly non-interactive when forced hidden */
}

/* When .hidden class is NOT present, the overlay becomes visible */
.overlay:not(.hidden) {
    display: flex; /* Make it take up space and arrange children */
    opacity: 1; /* Fade it in */
    /* pointer-events: auto; /* Will be interactive by default when display is not none */
}

.overlay-content {
    background-color: #2c2c2c; /* Slightly lighter than body for content box */
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative; /* Establishes a stacking context */
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    color: var(--text-color); /* Default text color for overlay content */

    /* Re-adding essential properties that were part of the working diagnostic block */
    display: block; /* Ensure it has a display type */
    opacity: 1;     /* Ensure it's opaque (parent .overlay handles fade-in) */
    z-index: 1002; 
}

.overlay-content.wide-overlay {
    max-width: 900px; /* For wider content like maps */
    justify-content: center; /* Center image, toggle will be positioned absolutely or flexed */
    max-width: 90vw; 
    max-height: 90vh; 
}

/* General Overlay Close Button Styling */
.overlay-close-button {
    position: sticky;
    top: -15px; 
    right: -15px; 
    display: block; 
    margin-left: auto; 
    margin-right: -15px; /* Align initial position with sticky 'right' offset */
    margin-top: -15px; 
    margin-bottom: 0; 

    background-color: rgba(0, 0, 0, 0.5); 
    color: #fff; 
    border: none;
    border-radius: 50%; 
    width: 36px; 
    height: 36px; 
    font-size: 20px; 
    line-height: 36px; 
    text-align: center; 
    cursor: pointer;
    z-index: 20; /* Ensure it's above other content within its own .overlay-content */
    transition: background-color 0.2s ease;
}

.overlay-close-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.overlay-content h2 {
    font-family: 'Ginto Nord', sans-serif;
    margin-top: 0;
    color: #fff; /* Brighter color for titles in overlay */
}

.overlay-content p {
    line-height: 1.6;
}

.overlay-content strong {
    color: #bbb; /* Slightly differentiate strong text */
}

.overlay-content a.button-link {
    display: inline-block;
    background-color: var(--link-color);
    color: #121212;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.2s ease;
}

.overlay-content a.button-link:hover {
    background-color: #a2cffc;
}

/* Floating Action Buttons */
.fab-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999; /* Below overlays but above other content */
    display: flex;
    flex-direction: column;
}

.fab {
    background-color: var(--link-color);
    color: #121212; /* Dark text on light button */
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.fab:hover {
    background-color: #a2cffc;
    transform: scale(1.05);
}

/* Adjustments for the event details overlay content to fit the dark theme */
#eventOverlay .overlay-content h2 { /* Project Name inside #eventOverlay */
    margin-top: 0;
    margin-bottom: 20px;
    color: #fff; /* White for title */
    font-size: 1.8em;
    text-align: left; /* Align with other text */
}

#eventOverlay .overlay-content p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text-color); /* Ensure light text */
}

#eventOverlay .overlay-content strong {
    color: #cccccc; /* Lighter strong color for dark background */
    font-weight: bold;
}

#eventOverlay .description-box {
    background-color: #3b3b3b; /* Darker box for description */
    border: 1px solid #555;
    padding: 12px 15px;
    margin-top: 5px;
    margin-bottom: 15px;
    border-radius: 6px;
    min-height: 60px;
    white-space: pre-wrap;
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-color); /* Light text in description box */
}

.overlay-content.wide-overlay {
    max-width: 900px; /* For wider content like maps */
}

/* Styles for the specific Map Overlay content area */
#mapOverlay .overlay-content.wide-overlay {
    padding: 0; /* Remove padding from the main container */
    overflow: hidden; /* Force content to be clipped if it overflows */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px; /* Re-apply border radius since padding is gone */
}

#mapOverlay .map-image-container {
    flex-grow: 1; /* Allow image container to take up available space */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0; /* Crucial flexbox fix for shrinking */
    padding: 20px 20px 10px 20px; /* Add padding here instead of parent */
    box-sizing: border-box;
}

#mapOverlay .map-image-container img#mapImage {
    display: block;
    max-width: 100%;
    max-height: 100%; 
    width: auto; 
    height: auto;
    object-fit: contain;
}

#mapOverlay .map-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px; /* Give the toggle its own padding */
    width: 100%;
    box-sizing: border-box;
    background-color: rgba(44, 44, 44, 0.8);
    border-radius: 0 0 8px 8px;
    margin-top: 0; /* Remove margin, spacing is now handled by padding */
}

#mapOverlay .toggle-label {
    margin-left: 8px;
    font-size: 0.9em;
    color: var(--text-color);
}

/* Basic Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px; /* Width of the toggle */
    height: 28px; /* Height of the toggle */
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555; /* Background of the inactive toggle */
    transition: .4s;
    border-radius: 28px; /* Should be equal to height for rounded ends */
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px; /* Height of the knob */
    width: 20px; /* Width of the knob */
    left: 4px; /* Position from left */
    bottom: 4px; /* Position from bottom */
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--link-color); /* Active toggle background */
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--link-color);
}

input:checked + .slider:before {
    transform: translateX(22px); /* How far the knob moves (Width - KnobWidth - 2*LeftPosition) */
}

/* Specific styling for the Map Overlay's close button */
#mapOverlay .overlay-close-button {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    margin-left: 0; /* Reset margin-left from general rule if it were present */
    /* Other visual styles are inherited from .overlay-close-button */
}

.event-passed {
    background-color: #e0e0e0; /* Light grey background */
    color: #888; /* Darker grey text */
    opacity: 0.7;
}

/* Make links in passed events also appear faded */
.event-passed a {
    color: #777; /* Adjust link color for passed events */
    pointer-events: none; /* Optional: disable clicks on links in passed events */
}

/* Styles for Announcements Overlay */
#announcementsOverlay .overlay-content h2 {
    margin-top: 0;
    margin-bottom: 15px; /* Reduced bottom margin for the title */
    color: #fff;
    font-size: 1.5em; /* Slightly smaller title for announcements */
    text-align: center;
}

#announcementsOverlay #announcementsList {
    list-style-type: none; /* Remove bullets */
    padding-left: 0; /* Remove default padding */
    margin-top: 0;
    margin-bottom: 0;
}

#announcementsOverlay #announcementsList li {
    padding: 10px 5px; /* Smaller vertical padding, minimal horizontal */
    margin-bottom: 8px; /* Space between items */
    border-bottom: 1px solid #444; /* Separator line */
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-color);
}

#announcementsOverlay #announcementsList li:last-child {
    border-bottom: none; /* No border for the last item */
    margin-bottom: 0;
}

#announcementsOverlay #announcementsList li.no-announcements {
    font-style: italic;
    text-align: center;
    color: #888; /* Dimmer color for "no announcements" text */
    padding: 20px 5px;
    border-bottom: none;
}

/* Apply Nord font to specific overlay titles */
#eventOverlay .overlay-content h2,
#addEventOverlay .overlay-content h2,
#announcementsOverlay .overlay-content h2 {
    font-family: 'Ginto Nord', sans-serif;
} 