/* ==========================================================================
   CSS Custom Properties for Theme System
   ========================================================================== */

:root {
  /* Dark theme (default) */
  --bg-primary: #000000;
  --bg-secondary: #202020;
  --bg-tertiary: #333333;
  --bg-quaternary: #404040;
  --text-primary: #ffffff;
  --text-secondary: #dddddd;
  --border-primary: #303030;
  --border-secondary: #232323;
  --accent-red: #cd342b;
  --accent-blue: #58a9d7;
  --hover-bg: #272727;
  --scrollbar-thumb: #404040;
  --scrollbar-thumb-hover: #363636;
  --video-bg: #333333;
  --overlay-bg: rgba(0, 0, 0, 0.8);
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #e0e0e0;
  --bg-quaternary: #d0d0d0;
  --text-primary: #000000;
  --text-secondary: #333333;
  --border-primary: #cccccc;
  --border-secondary: #e0e0e0;
  --accent-red: #cd342b;
  --accent-blue: #58a9d7;
  --hover-bg: #e8e8e8;
  --scrollbar-thumb: #c0c0c0;
  --scrollbar-thumb-hover: #a0a0a0;
  --video-bg: #f0f0f0;
  --overlay-bg: rgba(255, 255, 255, 0.9);
}

/* Theme transition for smooth switching */
body, 
.settings-menu,
.settings-menu-item,
.viewChoice,
.navDivider,
.grid-sidebar,
.grid-video,
.video_container,
.toggle_sidebar,
.video_selection,
.thumbnail_title,
.thumbnail_description,
.chat_header,
.video_chat_link img,
.onDemand_link,
select.videoDropDown,
.resetButton,
.live_stream_label,
.chat_label,
#highlighted_selection_container {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */

body {
    background: var(--bg-primary);
    background-size: cover;
    background-position: center;
    font-family: "Montserrat", arial, sans-serif;
    margin: 0;
    padding: 0;
    position: relative;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

p {
    color: var(--text-primary);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.rounded {
    border-radius: 12px;
}

.overflow-hidden {
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Navigation Styles
   ========================================================================== */

#newNav {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    margin: 5px 30px;
    width: 100%;
}

.hamburger {
    display: none; /* shown in media query */
    position: relative;
    margin-left: 8px;
    background: none;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
}
.hamburger:hover { background: none; }
.hamburger:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.hamburger .line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    margin: 4px 0;
    transition: transform .3s ease, opacity .3s ease;
}
/* Mobile menu panel */
.mobile-menu {
    position: absolute;
    top: 60px; /* below nav */
    right: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 150;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    min-width: 210px;
}
.mobile-menu .viewChoice { width: 100%; text-align: left; }
.mobile-menu a { text-decoration: none; }
.mobile-link button { width: 100%; }

@media (max-width: 800px) {
    #newNav { margin: 5px 14px; }
    #viewSwitcher { display: none !important; }
    .settings-container { margin-left: auto; order: 0; }
    .hamburger { display: inline-flex; flex-direction: column; order: 1; }
    #newNav { gap: 6px; }
}

#postNav {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0 20px 5px 20px;
    width: 100%;
}

.navDivider {
    background: var(--text-primary);
    border-radius: 12px;
    content: "";
    height: 2px;
    width: 100%;
}

#lpod_logo {
    height: 50px;
    padding: 3px 0;
}

/* ==========================================================================
   OnDemand Container Base Styles
   ========================================================================== */
#announcementBar {
    background:#4090bd;
    color:#fff;
    width: 100%;
    font-size:13px; 
    line-height:1.4; 
    font-weight:600; 
    font-family: 'Montserrat', Arial, sans-serif; 
    overflow:hidden; 
    white-space:nowrap; 
    position:relative;
    padding:4px 12px;
    text-align: center;
    display: block;
    text-decoration: none;
}

#announcementBar:hover {
    background:#58a9d7;
    text-decoration: none;
}

#onDemandContainer {
    box-sizing: border-box;
    display: inline-flex;
    flex-wrap: wrap;
    font-family: "Montserrat", "Helvetica", sans-serif;
    width: 100%;
}

#onDemandContainer * {
    font-family: "Montserrat", "Helvetica", sans-serif;
}

/* Scrollbar Styles */
#onDemandContainer ::-webkit-scrollbar {
    height: 18px;
    width: 10px;
}

#onDemandContainer ::-webkit-scrollbar-button {
    height: 0;
    width: 0;
}

#onDemandContainer ::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    cursor: pointer;
}

#onDemandContainer ::-webkit-scrollbar-thumb:hover,
#onDemandContainer ::-webkit-scrollbar-thumb:active {
    background: var(--scrollbar-thumb-hover);
}

#onDemandContainer ::-webkit-scrollbar-corner {
    background: transparent;
}
/* ==========================================================================
   View Switcher & Header Text
   ========================================================================== */

#onDemandContainer .headerText {
    color: var(--text-primary);
    font-family: "Montserrat", "Helvetica", sans-serif;
    text-align: left;
    width: 100%;
}

#onDemandContainer #viewSwitcher {
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 5px auto;
    text-align: center;
}

#onDemandContainer .viewChoice {
    background: transparent;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    margin: 0 3px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#onDemandContainer .viewChoice:hover,
#onDemandContainer .viewChoice.selectedView {
    background: var(--text-primary);
    color: #161616;
}

#onDemandContainer .viewChoice.redView {
    color: var(--accent-red);
}

#onDemandContainer .viewChoice.redView:hover {
    background: var(--accent-red);
    color: white;
}
/* ==========================================================================
   Big Screen View Layout
   ========================================================================== */

#onDemandContainer #bigScreenView {
    align-items: stretch;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto 100px auto;
    max-width: 1400px;
    padding: 15px;
    width: 100%;
}

#bigScreenMain {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

/* ==========================================================================
   Grid Layout System
   ========================================================================== */

/* Header Grid */
#bigScreenHeaderGrid {
    align-items: end;
    display: grid;
    gap: 1%;
    grid-template-areas: "sidebar-header video-header chat-header";
    grid-template-columns: 15% 58% 25%;
    transition: grid-template-columns 0.3s ease;
    width: 100%;
}

/* Content Grid */
#bigScreenContentGrid {
    align-items: stretch;
    display: grid;
    gap: 1%;
    grid-template-areas: "sidebar video chat";
    grid-template-columns: 12% 64% 22%;
    transition: grid-template-columns 0.3s ease;
    width: 100%;
}

/* Grid Areas */
.grid-sidebar-header {
    align-items: flex-end;
    display: flex;
    grid-area: sidebar-header;
}

.grid-video-header {
    align-items: flex-end;
    box-sizing: border-box;
    display: flex;
    grid-area: video-header;
    justify-content: center;
    text-align: center;
}

.grid-chat-header {
    align-items: flex-end;
    display: flex;
    grid-area: chat-header;
    justify-content: flex-end;
}

.grid-sidebar {
    box-sizing: border-box;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    grid-area: sidebar;
    position: relative;
    transition: opacity 0.3s ease;
}

.grid-video {
    background: var(--video-bg);
    display: block;
    grid-area: video;
    height: 100%;
    position: relative;
    width: 100%;
}

.grid-chat {
    display: flex;
    flex-direction: column;
    grid-area: chat;
}

/* Grid Layout Height Management */
#bigScreenGrid {
    align-items: start;
}

#bigScreenGrid .grid-sidebar,
#bigScreenGrid .grid-chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#live_selection_container {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
}

/* ==========================================================================
   Grid Toggle States (Hide Sidebar/Chat)
   ========================================================================== */

#onDemandContainer .hideSidebar #bigScreenContentGrid {
    grid-template-areas: "video chat";
    grid-template-columns: 77% 22%;
}

#onDemandContainer .hideSidebar #bigScreenHeaderGrid {
    grid-template-areas: "video-header chat-header";
    grid-template-columns: 77% 22%;
}

#onDemandContainer .hideSidebar .grid-sidebar {
    display: none;
}

#onDemandContainer .hideChat #bigScreenContentGrid {
    grid-template-areas: "sidebar video .";
    grid-template-columns: 15% 83% 0%;
}

#onDemandContainer .hideChat #bigScreenHeaderGrid {
    grid-template-areas: "sidebar-header video-header .";
    grid-template-columns: 15% 83% 0%;
}

#onDemandContainer .hideChat .grid-chat {
    display: none;
}

#onDemandContainer .hideChat.hideSidebar #bigScreenContentGrid {
    grid-template-areas: ". video .";
    grid-template-columns: 0% 98% 0%;
}

#onDemandContainer .hideChat.hideSidebar #bigScreenHeaderGrid {
    grid-template-areas: ". video-header .";
    grid-template-columns: 0% 98% 0%;
}

/* Support when the state classes are applied directly to the grid elements (current markup does this) */
#bigScreenContentGrid.hideSidebar {
    grid-template-areas: "video chat";
    grid-template-columns: 77% 22%;
}

#bigScreenContentGrid.hideChat {
    grid-template-areas: "sidebar video .";
    grid-template-columns: 15% 83% 0%;
}

#bigScreenHeaderGrid.hideChat {
    grid-template-areas: "sidebar-header video-header chat-header";
    grid-template-columns: 15% 68% 15%;
}

/* Both sidebar & chat hidden */
#bigScreenContentGrid.hideChat.hideSidebar {
    grid-template-areas: ". video .";
    grid-template-columns: 0% 98% 0%;
}

/* ==========================================================================
   Video Styles
   ========================================================================== */

/* Video Container */
.grid-video .video_container,
#onDemandContainer .video_container {
    background: var(--video-bg);
    display: block;
    height: 0;
    overflow: hidden;
    padding: 0;
    padding-bottom: 56.25%;
    position: relative;
}

.grid-video .video_container {
    height: 100%;
    padding-bottom: 56.25%;
    width: 100%;
}

/* Video iframes */
.grid-video iframe,
#onDemandContainer .multiScreenContainer iframe {
    border: 0;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

#onDemandContainer #bigScreenFeature {
    border: 0;
    bottom: 0;
    height: 100%;
    left: 0;
    max-width: 100%;
    position: absolute;
    top: 0;
    width: 100vw;
}

/* Video Info */
#onDemandContainer #videoInfo {
    box-sizing: border-box;
}

#onDemandContainer #videoInfo .video_title {
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 25px 25px 0 0;
    color: var(--text-primary);
    display: flex;
    font-size: 16px;
    font-weight: bold;
    padding: 7px 30px;
    text-transform: uppercase;
}

#onDemandContainer #videoInfo .redDot {
    background: var(--accent-red);
    border-radius: 100%;
    box-shadow: 0 0 6px 5px rgba(168, 0, 0, 0.5);
    height: 10px;
    margin-right: 10px;
    width: 10px;
}
@media only screen and (max-width: 1250px) {
    
    /* Adjust both grids for tablet */
    #bigScreenHeaderGrid {
        grid-template-areas: "sidebar-header video-header chat-header";
        grid-template-columns: 1fr 67% 32%;
    }

    /* Place CHAT below the main video alongside Live Streams */
    #bigScreenContentGrid {
        gap: 1%;
        grid-template-areas: 
            "video video"
            "sidebar chat";
        grid-template-columns: 67% 32%;
        grid-template-rows: auto auto;
        height: auto !important; /* ensure both rows are visible */
    }

    .grid-sidebar {
        overflow-x: auto;
        width: 100%;
    }

    /* Legacy support */
    #onDemandContainer #live_selection_container { width: 100%; }
    #onDemandContainer .video_container_container { width: 67%; }
    #onDemandContainer .sidebarSection {
        margin-right: 0;
        margin-top: 1%;
        max-height: unset;
        overflow-x: auto;
        width: 100%;
    }
    #onDemandContainer .chatSection { width: 31%; }
}

@media only screen and (max-width: 700px) {
    #onDemandContainer .hide_mobile_size { display: none !important; }
    
    /* Mobile layout - single column */
    #bigScreenHeaderGrid {
        grid-template-areas: "video-header";
        grid-template-columns: 1fr;
    }
    
    #bigScreenContentGrid {
        grid-template-areas: 
            "video"
            "sidebar";
        grid-template-columns: 1fr;
        height: auto !important; /* allow sidebar beneath video */
        max-height: 1000px;
    }
    
    .grid-sidebar {
        margin-right: 0;
        width: 100%;
    }
    
    .video_selection { width: 50%; }
}

@media only screen and (max-width: 500px) {
    .video_selection {
        width: 100%;
    }
}
/* ==========================================================================
   Video Selection & Sidebar Components
   ========================================================================== */

/* Sidebar Controls */
#onDemandContainer .toggle_sidebar {
    align-items: center;
    background: var(--bg-secondary);
    box-sizing: border-box;
    color: var(--text-primary);
    display: flex;
    font-size: 25px;
    height: 24px;
    padding: 0 10px 2px 10px;
}

#onDemandContainer .sidebar_btn {
    font-size: 20px;
    line-height: 0.45;
    padding: 0 5px;
}

/* Video Selection Container */
#onDemandContainer #live_selection_container {
    box-sizing: border-box;
    display: block;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

#onDemandContainer .video_selection_container {
    padding: 0 5px 7px 0;
}

#onDemandContainer .video_selection {
    border: 2px solid var(--border-primary);
    border-radius: 12px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    margin-bottom: 5px;
    max-width: 225px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

#onDemandContainer .video_selection_thumbnail {
    margin-left: -1%;
    width: 104%;
}

#onDemandContainer .highlighted_video_selection {
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    margin-top: 20px;
    margin-bottom: 20px;
    max-width: 225px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Play Icon Overlay */
#onDemandContainer .play_icon {
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    opacity: 0;
    position: absolute;
    top: 42%;
    transition: all 0.15s;
    width: 20px;
    z-index: 11;
}

#onDemandContainer #highlighted_selection_container .play_icon {
    top: 36%;
}

#onDemandContainer .video_selection:hover .play_icon,
#onDemandContainer .current_playing .play_icon {
    opacity: 1;
}

#onDemandContainer .video_selection:after {
    background: rgba(0, 0, 0, 0);
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    transition: all 0.15s;
    width: 100%;
    z-index: 10;
}

/* Thumbnail Text */
#onDemandContainer .thumbnail_title {
    background: var(--bg-quaternary);
    bottom: 0;
    display: none;
    font-size: 13px;
    font-weight: bold;
    left: 0;
    padding: 5px 10px;
    position: absolute;
    width: 100%;
    z-index: 10;
}

#onDemandContainer .current_playing .thumbnail_title {
    display: block;
}

#onDemandContainer .thumbnail_description {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--text-secondary);
    display: -webkit-box;
    font-size: 12px;
    line-clamp: 3;
    line-height: 1.2em;
    max-height: calc(2.6em + 10px);
    min-height: calc(2.6em + 10px);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlighted Videos Section */
#onDemandContainer #highlighted_selection_container {
    background: var(--bg-primary);
    box-sizing: border-box;
    color: var(--text-primary);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    margin-top: 1%;
    min-width: 100%;
    padding: 15px;
}

#onDemandContainer .hightlighted_videos_section {
    order: 5;
    overflow-x: hidden;
    width: 100%;
}

/* ==========================================================================
   Chat Styles
   ========================================================================== */

.grid-chat {
    display: flex;
    flex-direction: column;
}

.grid-chat #chatFeature,
#onDemandContainer #chatFeature {
    border: none;
    flex: 1;
    min-height: 0;
    width: 100%;
}

#onDemandContainer #chatFeature {
    height: 92%;
}

.chat_header {
    align-items: center;
    background: var(--bg-secondary);
    display: flex;
    height: 8%;
    justify-content: space-between;
    padding: 0 7px;
}

.video_chat_link img {
    background: var(--bg-tertiary);
    box-sizing: border-box;
    cursor: pointer;
    margin-bottom: -4px;
    padding: 8px 5px;
    width: 32px;
}

.video_chat_link img:hover {
    background: var(--hover-bg);
}

a.video_chat_link {
    margin-top: -3px;
}

/* Chat Header States */
.chat_header.linked #select_linked {
    display: block;
}

.chat_header.linked #selected_unlinked,
#onDemandContainer .chat_header.unlinked #select_linked {
    display: none;
}

.chat_header.unlinked #selected_unlinked {
    display: block;
}

#onDemandContainer .chat_header.linked select.videoDropDown {
    cursor: default;
    opacity: 0.67;
    pointer-events: none;
}

#onDemandContainer .chat_header option.option_video {
    display: none;
}

[data-theme="light"] .video_chat_link img {
    filter: brightness(0) invert(1);
}

/* ==========================================================================
   Section Titles & Links
   ========================================================================== */

#onDemandContainer .onDemand_section_title {
    display: flex;
    font-size: 15px;
    font-weight: bold;
    justify-content: center;
    width: 100%;
    text-align: center;
}

#onDemandContainer .onDemand_link {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: normal;
    text-decoration: none;
}

/* ==========================================================================
   Multi-Screen Views
   ========================================================================== */

#onDemandContainer #multiScreen2x2View {
    align-items: flex-start;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto 100px auto;
    max-width: 1440px;
    width: 100%;
}

#onDemandContainer #multiScreen3x2View {
    align-items: flex-start;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto 100px auto;
    max-width: 1920px;
    width: 100%;
}

#onDemandContainer .multiScreenContainer {
    box-sizing: border-box;
    padding: 8px;
}

#onDemandContainer #multiScreen2x2View .multiScreenContainer {
    width: 50%;
}

#onDemandContainer #multiScreen3x2View .multiScreenContainer {
    width: 33%;
}

/* ==========================================================================
   Form Elements & Controls
   ========================================================================== */

#onDemandContainer select.videoDropDown {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    border-radius: 3px 3px 0 0;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    margin: 0;
    padding: 4px 16px 4px 8px;
}

/* ==========================================================================
   Labels & Buttons
   ========================================================================== */

#onDemandContainer .more_videos_section {
    display: flex;
    order: 10;
    width: 100%;
}

#onDemandContainer .sidebar_button_container {
    border-radius: 30px;
    display: flex;
    margin-bottom: 10px;
    overflow: hidden;
}

#onDemandContainer .live_stream_label {
    align-items: center;
    background: var(--accent-red);
    box-sizing: border-box;
    color: white;
    display: inline-flex;
    height: 24px;
    padding: 0 10px 2px 10px;
    text-align: center;
    white-space: nowrap;
}

#onDemandContainer .chat_label {
    align-items: center;
    background: #58a9d7;
    box-sizing: border-box;
    color: white;
    display: inline-flex;
    height: 24px;
    padding: 0 10px 2px 10px;
    text-align: center;
}

#resetButtonsContainer {
    margin-top: 50px;
    text-align: center;
}

.resetButton {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-block;
    font-size: 14px;
    margin: 0 5px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.resetButton:hover {
    background: var(--hover-bg);
    border-color: var(--border-secondary);
}

/* ==========================================================================
   Animations
   ========================================================================== */

.slide-in-right {
    animation: slide-in-right 0.5s cubic-bezier(0.39, 0.575, 0.565, 1.000) both;
}

@keyframes slide-in-right {
    0% {
        opacity: 0;
        transform: translateX(1000px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slide-in-left 0.5s cubic-bezier(0.39, 0.575, 0.565, 1.000) both;
}

@keyframes slide-in-left {
    0% {
        opacity: 0;
        transform: translateX(-1000px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   Mode Switch Transitions (Directional slide-in/out for view changes)
   ========================================================================== */

/* Ensure smooth GPU-accelerated transforms on view containers */
.screenSelection {
    will-change: transform, opacity;
}

/* Alpine will add these during x-transition */
.view-enter,
.view-leave {
    transition: transform 0.35s ease, opacity 0.35s ease;
}

/* Forward (to the right in nav): new slides in from right, old slides out to left */
.dir-forward.view-enter-start { transform: translateX(100%); opacity: 0; }
.dir-forward.view-enter-end   { transform: translateX(0);     opacity: 1; }
.dir-forward.view-leave-start { transform: translateX(0);     opacity: 1; }
.dir-forward.view-leave-end   { transform: translateX(-100%); opacity: 0; }

/* Backward (to the left in nav): new slides in from left, old slides out to right */
.dir-backward.view-enter-start { transform: translateX(-100%); opacity: 0; }
.dir-backward.view-enter-end   { transform: translateX(0);      opacity: 1; }
.dir-backward.view-leave-start { transform: translateX(0);      opacity: 1; }
.dir-backward.view-leave-end   { transform: translateX(100%);   opacity: 0; }

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .view-enter,
    .view-leave {
        transition: opacity 0.2s ease;
    }
    .dir-forward.view-enter-start,
    .dir-backward.view-enter-start,
    .dir-forward.view-leave-end,
    .dir-backward.view-leave-end {
        transform: none;
    }
}

/* ==========================================================================
   Admin Page Styles
   ========================================================================== */

#admin_page * {
    font-family: 'Source Sans Pro', 'Helvetica', sans-serif;
}
#admin_page #liveStreams {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#admin_page #addNew {
    display: flex;
    justify-content: center;
    width: 100%;
}


/* Admin Header */
#admin_page #admin_header {
    display: flex;
    justify-content: center;
    width: 100%;
}

#admin_page .logo_container {
    display: inline-block;
    padding: 15px;
}

#admin_page .logo_container svg {
    max-width: 300px;
    width: 100%;
}

/* Form Styles */
.input_container h3 {
    color: white;
    margin: 5px 0;
}

.admin_main_section {
    display: flex;
    justify-content: center;
}

.form_container {
    background: #202020;
    box-sizing: border-box;
    margin-bottom: 50px;
    max-width: 700px;
    padding: 5px 30px;
    width: 100%;
}

.input_container {
    margin: 15px 0;
}

.input_container input[type="text"] {
    box-sizing: border-box;
    font-size: 16px;
    margin-bottom: 5px;
    padding: 4px 6px;
    width: 100%;
}

.input_container textarea {
    box-sizing: border-box;
    height: 42px;
    margin: 0;
    width: 100%;
}

button.submit_btn {
    background: #58a9d7;
    border: none;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    font-size: 20px;
    margin: 15px 0 30px 0;
    padding: 6px 25px 9px 25px;
}

button.submit_btn:hover {
    background: #4090bd;
}

/* ==========================================================================
   Settings Menu Styles
   ========================================================================== */

.settings-container {
    margin-left: auto;
    position: relative;
}

.settings-button {
    align-items: center;
    background: none;
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    margin-left: 3px;
    padding: 8px;
    transition: all 0.3s ease;
}

.settings-button:hover,
.settings-button.active {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.gear-icon {
    height: 24px;
    transition: transform 0.3s ease;
    width: 24px;
}

/* The settings menu now inherits theme colors (dark by default, light via [data-theme="light"]) */
.settings-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    margin-top: 8px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: 100%;
    width: 250px;
    z-index: 100;
    color: var(--text-primary);
}

 .settings-menu-section-title {
     display: flex;
     background: var(--bg-secondary);
     color: var(--text-secondary);
     font-size: 12px;
     font-style: italic;
     margin-block-end: 0;
     margin-block-start: 0;
     padding: 4px 8px;
     position: relative;
     width: fit-content;
     z-index: 102;
     margin-top: 5px;
     margin-left: 8px;
     margin-right: 8px;
     margin-bottom: -10px;
     transition: all 0.3s ease;
 }

 .settings-menu-section {
     box-sizing: border-box;
     background: var(--bg-secondary);
     border: 1px solid var(--border-primary);
     border-radius: 12px;
     padding: 12px 6px 6px 6px;
     position: relative;
     z-index: 101;
     width: 100%;
     transition: all 0.3s ease;
 }

 .settings-menu-item {
     border-radius: 12px;
     color: var(--text-primary);
     cursor: pointer;
     margin: 1.5px 0;
     padding: 6px 16px;
     transition: background-color 0.2s ease, color 0.2s ease;
 }

 .settings-menu-item:hover {
     background: var(--hover-bg);
     color: var(--text-primary);
 }

.settings-menu-item:last-child {
    border-bottom: none;
}

.settings-menu-item span {
    font-size: 14px;
    font-weight: 400;
}

.cycle-indicator {
    cursor: default;
}

/* ==========================================================================
   Toggle Switch Styles
   ========================================================================== */

.toggle-switch {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 6px 16px;
    width: 100%;
    box-sizing: border-box;
}

 .toggle-switch-label {
     color: var(--text-primary);
     font-size: 14px;
     font-weight: 400;
 }

.toggle-switch-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch-input {
    height: 0;
    opacity: 0;
    width: 0;
}

.toggle-switch-slider {
    background-color: #ccc;
    border-radius: 34px;
    cursor: pointer;
    display: block;
    height: 24px;
    position: relative;
    transition: 0.3s;
    width: 44px;
}

.toggle-switch-slider:before {
    background-color: white;
    border-radius: 50%;
    bottom: 2px;
    content: "";
    height: 20px;
    left: 2px;
    position: absolute;
    transition: 0.3s;
    width: 20px;
}

.toggle-switch-input:checked + .toggle-switch-slider {
    background-color: var(--accent-blue);
}

.toggle-switch-input:checked + .toggle-switch-slider:before {
    transform: translateX(20px);
}

.toggle-switch-slider:hover {
    background-color: #b3b3b3;
}

.toggle-switch-input:checked + .toggle-switch-slider:hover {
    background-color: var(--accent-blue);
    opacity: 0.8;
}

/* Light theme adjustments for toggle switch */
[data-theme="light"] .toggle-switch-slider {
    background-color: #ddd;
}

[data-theme="light"] .toggle-switch-input:checked + .toggle-switch-slider {
    background-color: var(--accent-blue);
}

[data-theme="light"] .toggle-switch-slider:hover {
    background-color: #ccc;
}

/* ==========================================================================
   Responsive Design - Media Queries
   ========================================================================== */

/* Tablet Styles */
@media only screen and (max-width: 1250px) {

    #onDemandContainer .hide_small_tablet_size {
        display: none !important;
    }
    
    /* Adjust both grids for tablet */
    #bigScreenHeaderGrid {
        grid-template-areas: "sidebar-header video-header chat-header";
        grid-template-columns: 15% 68% 15%;
    }
    
    /* Place CHAT below the main video alongside Live Streams */
    #bigScreenContentGrid {
        gap: 1%;
        grid-template-areas: 
            "video video"
            "sidebar chat";
        grid-template-columns: 67% 32%;
        grid-template-rows: auto auto;
        height: auto !important; /* ensure both rows are visible */
    }
    
    .grid-sidebar {
        overflow-x: auto;
        width: 100%;
    }
    
    /* Legacy support */
    #onDemandContainer #live_selection_container { width: 100%; }
    #onDemandContainer .video_container_container { width: 67%; }
    #onDemandContainer .sidebarSection {
        margin-right: 0;
        margin-top: 1%;
        max-height: unset;
        overflow-x: auto;
        width: 100%;
    }
    #onDemandContainer .chatSection { width: 31%; }
}

/* Small Tablet Styles */
@media only screen and (max-width: 970px) {
    
    /* Stack layout for smaller tablets */
    #bigScreenHeaderGrid {
        gap: 1%;
        grid-template-areas: "video-header";
        grid-template-columns: 100%;
    }
    
    #bigScreenContentGrid {
        gap: 1%;
        grid-template-areas: 
            "video video"
            "sidebar chat";
        grid-template-columns: 50% 48%;
        grid-template-rows: auto auto;
        height: auto !important; /* ensure both rows are visible */
        max-height: 1000px;
    }
    
    .grid-video { grid-area: video; }
    
    .grid-chat {
        margin-top: 1%;
        order: 4;
    }
}

/* Mobile Styles */
@media only screen and (max-width: 700px) {
    #onDemandContainer .hide_mobile_size {
        display: none !important;
    }
    
    /* Mobile layout - single column */
    #bigScreenHeaderGrid {
        grid-template-areas: "video-header";
        grid-template-columns: 1fr;
    }
    
    #bigScreenContentGrid {
        grid-template-areas: 
            "video"
            "sidebar"
            "chat";
        grid-template-columns: 1fr;
        height: auto !important; /* allow sidebar beneath video */
    }
    
    .grid-sidebar {
        margin-right: 0;
        width: 100%;
    }

    .grid-chat {
        width: 100%;
        margin-top: 10px;
        min-height: 400px; /* give chat room on mobile */
    }

    .grid-chat #chatFeature { height: 400px; }

    #onDemandContainer #live_selection_container {
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }

    #onDemandContainer .video_selection_container {
        padding: 0 0 10px 0;
        display: flex;
        justify-content: center;
        width: 48%;
    }
    
    .video_selection {
        width: 50%;
        margin: 1%;
    }
}

/* Small Mobile Styles */
@media only screen and (max-width: 500px) {
    .video_selection {
        width: 100%;
    }
}

/* Settings Menu Mobile Responsive */
@media (max-width: 768px) {
    .settings-container {
        margin-left: 16px;
    }
    
    .settings-menu {
        min-width: 180px;
        right: -8px;
    }
}

/* ==========================================================================
   Light Theme Specific Adjustments
   ========================================================================== */

[data-theme="light"] .viewChoice.redView:hover {
  color: white;
}

[data-theme="light"] #onDemandContainer .viewChoice:hover,
[data-theme="light"] #onDemandContainer .viewChoice.selectedView {
  color: var(--bg-primary);
}

/* Light theme video overlay adjustments */
[data-theme="light"] #onDemandContainer .video_selection:after {
  background: rgba(255, 255, 255, 0);
}

[data-theme="light"] #onDemandContainer .video_selection:hover:after {
  background: rgba(255, 255, 255, 0.3);
}

/* Light theme settings icon color */
[data-theme="light"] .settings-button {
  color: var(--text-primary);
}

[data-theme="light"] .settings-button:hover,
[data-theme="light"] .settings-button.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

/* Light theme specific overrides for settings menu (retain prior white look) */
[data-theme="light"] .settings-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] .settings-menu-section-title {
    background: var(--bg-primary);
    color: var(--text-secondary);
}
[data-theme="light"] .settings-menu-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
}
[data-theme="light"] .settings-menu-item:hover {
    background: var(--hover-bg);
}
[data-theme="light"] .toggle-switch-label {
    color: var(--text-primary);
}

/* Enhanced video selection hover states */
#onDemandContainer .video_selection:hover {
    border-color: var(--hover-bg);
    transform: scale(1.02);
}

[data-theme="light"] #onDemandContainer .video_selection:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#onDemandContainer .video_selection:hover:after {
    background: var(--overlay-bg);
}

/* Better contrast for current playing indicator */
#onDemandContainer .current_playing {
    border-color: var(--accent-red);
    border: 2px solid var(--accent-red);
}

/* Improved settings menu contrast */
[data-theme="light"] .settings-menu {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Light theme improvements for form elements */
[data-theme="light"] #onDemandContainer select.videoDropDown {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #onDemandContainer select.videoDropDown:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* ==========================================================================
   Full Width Mode Styles
   ========================================================================== */

/* When full-width mode is enabled, remove max-width constraints */

#onDemandContainer.full-width-mode #bigScreenView, #onDemandContainer.full-width-mode #multiScreen2x2View, #onDemandContainer.full-width-mode #multiScreen3x2View {
    max-width: none !important;
}

/* Apply full-width mode to all main container views */

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */