/* ==========================================================================
   Base Styles & Resets
   ========================================================================== */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Offline Screen Design
   ========================================================================== */
.offline-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: #06060a; /* Premium deep dark purple-blue black */
    background: radial-gradient(circle at center, rgba(6, 6, 10, 0.2) 0%, rgba(3, 3, 5, 0.8) 100%);
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
    overflow-y: auto; /* Allow scrolling if screen is too small */
    -webkit-overflow-scrolling: touch; /* Enable smooth physics scrolling on iOS */
}

.offline-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(6, 6, 10, 0.2) 0%, rgba(3, 3, 5, 0.8) 100%);
    z-index: 2; /* Renders on top of the slideshow images */
    pointer-events: none;
}

.bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1; /* Renders above parent background color (#06060a) */
    pointer-events: none;
}

.bg-slide.active {
    opacity: 0.75;
}

.slideshow-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.offline-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    width: 100%;
    padding: 40px 0;
    box-sizing: border-box;
}

.offline-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Pulsing Red Circle / Ripples */
.dot-container {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 28px;
}

.pulse-ring {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 2px solid #ff0000;
    border-radius: 50%;
    animation: ripple 2.2s cubic-bezier(0.215, 0.610, 0.355, 1) infinite;
    opacity: 0;
}

.dot {
    width: 16px;
    height: 16px;
    background-color: #ff0000;
    border-radius: 50%;
    box-shadow: 0 0 16px rgba(255, 0, 0, 0.8);
    animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.9);
        box-shadow: 0 0 12px rgba(255, 0, 0, 0.6);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 24px rgba(255, 0, 0, 1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.6);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

.offline-screen h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-align: center;
}

.offline-screen p {
    font-size: 15px;
    font-weight: 600;
    color: #cccccc;
    margin: 0 auto;
    letter-spacing: 0.2px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    line-height: 1.5;
}

/* ==========================================================================
   Player Container & Video.js Styling
   ========================================================================== */
.player-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 10;
}

.embed-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.embed-container iframe,
.embed-container video,
.embed-container embed,
.embed-container object {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background-color: #000000 !important;
}

/* Ensure Video.js consumes full size */
.video-js {
    width: 100% !important;
    height: 100% !important;
    font-family: 'Inter', sans-serif !important;
}

/* Maintain aspect ratio and center content */
.video-js video {
    object-fit: contain !important;
}

/* Customize Video.js Big Play Button (Modern Blur/Glass Effect) */
.video-js .vjs-big-play-button {
    background-color: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 50% !important;
    width: 80px !important;
    height: 80px !important;
    line-height: 78px !important;
    margin-top: -40px !important;
    margin-left: -40px !important;
    font-size: 3em !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.2s !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.video-js:hover .vjs-big-play-button {
    background-color: #ff0000 !important;
    border-color: transparent !important;
    transform: scale(1.08);
}

/* Customize Control Bar */
.video-js .vjs-control-bar {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0) 100%) !important;
    height: 56px !important;
    align-items: center !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
}

/* Flat Red Progress Bar (YouTube Style) */
.video-js .vjs-play-progress {
    background-color: #ff0000 !important;
}

.video-js .vjs-play-progress::before {
    font-size: 14px !important;
    top: -3px !important;
    color: #ff0000 !important;
}

.video-js .vjs-slider {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.video-js .vjs-load-progress {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

/* ==========================================================================
   LIVE Button Overlay (YouTube Style)
   ========================================================================== */
#liveBtn {
    position: absolute;
    right: 20px;
    bottom: 76px; /* Sits just above the 56px control bar */
    padding: 8px 16px;
    background-color: #ff0000; /* YouTube Red when Live */
    border: none;
    color: #ffffff;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.15s ease, 
                opacity 0.3s ease;
}

#liveBtn:hover {
    transform: scale(1.04);
}

#liveBtn:active {
    transform: scale(0.96);
}

/* Behind Live State (Grey Theme) */
#liveBtn.behind {
    background-color: rgba(30, 30, 30, 0.85);
    color: #b0b0b0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Live Circle Dot Indicator */
#liveBtn::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

#liveBtn.behind::before {
    background-color: #888888;
}

/* Hide LIVE button if the video control bar is inactive/hidden */
.video-js.vjs-user-inactive #liveBtn {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

/* ==========================================================================
   Unmute Overlay (Autoplay Support)
   ========================================================================== */
.unmute-overlay {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 30;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                opacity 0.3s ease, 
                background-color 0.2s;
    opacity: 0;
    pointer-events: none;
}

.unmute-overlay.show {
    opacity: 1;
    pointer-events: auto;
    animation: bounce 2s infinite ease-in-out;
}

.unmute-overlay:hover {
    background-color: rgba(20, 20, 20, 0.9);
    transform: translateX(-50%) scale(1.05);
}

.unmute-overlay:active {
    transform: translateX(-50%) scale(0.95);
}

.volume-icon {
    width: 20px;
    height: 20px;
}

@keyframes bounce {
    0%, 100% {
        transform: translate(-50%, 0);
    }
    50% {
        transform: translate(-50%, -6px);
    }
}

/* ==========================================================================
   Backend Configuration Input (Cloudflare Pages Support)
   ========================================================================== */


/* ==========================================================================
   Offline Ambient Music Controller (Floating Emoji Button)
   ========================================================================== */
.music-emoji-btn {
    position: fixed;
    top: 20px;
    right: 70px; /* Position next to the top-right chat button */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.15s ease, 
                box-shadow 0.25s ease;
    z-index: 150;
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    user-select: none;
}

.music-emoji-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.music-emoji-btn:active {
    transform: scale(0.95);
}

.music-emoji-btn.playing {
    background: rgba(255, 0, 85, 0.12);
    border-color: rgba(255, 0, 85, 0.35);
    box-shadow: 0 4px 20px rgba(255, 0, 85, 0.15);
}


/* ==========================================================================
   Site Setup Instructions Card
   ========================================================================== */
.instructions-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 440px;
    width: 90%;
    box-sizing: border-box;
    margin: 36px auto 0 auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.instructions-card h2 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    opacity: 0.9;
}

.private-notice-card {
    text-align: center !important;
    border-color: rgba(255, 0, 85, 0.15);
    box-shadow: 0 10px 30px rgba(255, 0, 85, 0.05);
}

.private-notice-card h2 {
    color: #ff0055;
    border-bottom-color: rgba(255, 0, 85, 0.15);
}

.notice-text {
    font-size: 13px;
    color: #cccccc;
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   Sponsorship Box Styling
   ========================================================================== */
.sponsor-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 14px 24px;
    max-width: 440px;
    width: 90%;
    box-sizing: border-box;
    margin: 28px auto 24px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sponsor-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ff0055;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 0, 85, 0.15);
    padding-bottom: 10px;
    width: 100%;
    text-align: center;
    opacity: 0.9;
}

.sponsor-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.sponsor-insta {
    font-size: 12px;
    color: #ff0055;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.sponsor-insta:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ==========================================================================
   Live Viewer Count Floating Badge Styling
   ========================================================================== */
.viewer-count-badge {
    position: fixed;
    top: 20px;
    right: 72px; /* Shift left to make room for chat toggle button */
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 0 14px;
    height: 40px; /* Align height with chat button */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s;
}

.viewer-count-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #ff0055;
    border-radius: 50%;
    box-shadow: 0 0 8px #ff0055;
    animation: live-pulse-ring 1.5s infinite;
}

@keyframes live-pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(255, 0, 85, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 85, 0);
    }
}

/* ==========================================================================
   Sliding Chat Sidebar Styling
   ========================================================================== */
.chat-sidebar {
    position: fixed;
    top: 0;
    right: -320px; /* Hidden by default */
    width: 320px;
    height: 100vh;
    height: 100dvh;
    background: rgba(10, 10, 15, 0.85);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 1050; /* Above normal cards and badges */
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-sidebar.open {
    right: 0; /* Slide in */
}

@media (max-width: 480px) {
    .offline-content {
        justify-content: flex-start !important;
        padding: 80px 20px 40px 20px !important; /* Clears top status badges, adds side breathing room */
    }

    .offline-screen h1 {
        font-size: 24px !important;
    }

    .offline-screen p {
        font-size: 13px !important;
        width: 100% !important;
    }

    .instructions-card {
        padding: 16px !important;
        margin-top: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .announcement-card {
        margin-bottom: 16px !important;
    }

    .dot-container {
        margin-bottom: 20px !important;
    }

    .chat-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .chat-input-area {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    }

    .chat-input-area input {
        font-size: 16px; /* Prevents auto-zoom on iOS when focused */
        padding: 12px;
    }

    #chat-send-btn {
        font-size: 16px;
    }
}

/* Chat Header */
.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.2px;
}

.chat-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #888888;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.chat-close-btn:hover {
    color: #ffffff;
}

/* Chat Message Logs Area */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Individual Message Style */
.chat-message {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    animation: message-slide-up 0.25s ease-out;
}

@keyframes message-slide-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg-author {
    font-weight: 700;
    color: #ffd700; /* Premium gold accent for readability on dark backgrounds */
    margin-right: 6px;
}

.msg-text {
    color: #e5e5e5;
}

.msg-time {
    font-size: 10px;
    color: #666666;
    display: block;
    margin-top: 2px;
}

/* Input Form Area */
.chat-input-area {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-area input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    box-sizing: border-box;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-area input:focus {
    border-color: rgba(255, 255, 255, 0.4);
}

.chat-message-row {
    display: flex;
    gap: 8px;
}

.chat-message-row input {
    flex-grow: 1;
}

#chat-send-btn {
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0 16px;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

#chat-send-btn:hover {
    background-color: #222222;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Floating Chat Toggle Button */
.chat-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    z-index: 1040; /* Sits slightly under open sidebar, on top of normal player */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.2s, background-color 0.2s, border-color 0.2s, opacity 0.3s;
}

.chat-toggle-btn:hover {
    transform: scale(1.08);
    background-color: #1a1a24;
    border-color: rgba(255, 255, 255, 0.25);
}

.chat-unread-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #ff0055;
    border: 2px solid #0a0a0f;
    border-radius: 50%;
    box-shadow: 0 0 6px #ff0055;
}

/* Gold Announcement Card Styling */
.announcement-card {
    border: 1px solid rgba(255, 215, 0, 0.25) !important; /* Elegant gold border */
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.04) 0%, rgba(10, 10, 15, 0.8) 100%) !important;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.05), inset 0 0 12px rgba(255, 215, 0, 0.02) !important;
    margin-bottom: 24px;
    animation: fadeIn 0.8s ease;
}

.announcement-card h2 {
    color: #ffd700 !important; /* Gold title text */
}






