/* =========================================
   JUCHIFY: THE ULTIMATE THEME (v12.0)
   - Pill search design: FIXED
   - Sidebar scrolling: PRESERVED
   ========================================= */


/* 1. FORCE DARK COLOR SCHEME (fixes Vivaldi + all browsers) */
:root {
    color-scheme: dark !important;
}

/* 2. OVERRIDE BOTH LIGHT AND DARK VARIABLES */
:root, html, html[data-theme="light"], html[data-theme="dark"], body, body.light, body.dark, .pusher {
    --bg-base: #0a0a0c !important;
    --panel-bg: rgba(255, 255, 255, 0.04) !important;
    --panel-border: rgba(255, 255, 255, 0.08) !important;
    --text-primary: #ffffff !important;
    --text-secondary: #a0a0a5 !important;
    --accent-color: #e53935 !important;
    --page-bg: var(--bg-base) !important;
    --header-bg: rgba(10, 10, 12, 0.8) !important;
    --font-color: var(--text-primary) !important;
    --card-bg: transparent !important;
    --radius-lg: 1rem !important;
    --radius-md: 0.75rem !important;
    background-color: var(--bg-base) !important;
    color: var(--text-primary) !important;
}


/* 2. GLOBAL BACKGROUND (Juchify Glow) */
body, html, html[data-theme="light"] body, .pusher {
    background-image: radial-gradient(circle at 15% 0%, #2a1114 0%, var(--bg-base) 40%) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}


/* =========================================
   3. TOP HEADER
   ========================================= */
header, .header-container, .ui.menu.fixed.top, html[data-theme="light"] .ui.menu.fixed.top {
    background: var(--header-bg) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid var(--panel-border) !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    z-index: 1000 !important;
}


/* =========================================
   3b. SEARCH PILL
   ========================================= */

/* Wrapper: flex container, fixed height, NO overflow:hidden */
.ui.action.input, .header-search {
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    height: 38px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* The Input Field: full pill rounding applied directly here */
.ui.action.input input,
.ui.input input,
input[type="text"] {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid var(--panel-border) !important;
    color: var(--text-primary) !important;
    border-radius: 50px !important;
    padding: 0 48px 0 1.5rem !important;
    height: 38px !important;
    width: 100% !important;
    max-width: 600px;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

input[type="text"]:focus,
.ui.action.input input:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--accent-color) !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Search Button: floated inside pill via absolute positioning */
.ui.action.input > .button,
.search-button,
.header-search .button {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    height: 38px !important;
    width: 45px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-secondary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
    border-radius: 0 50px 50px 0 !important;
    padding: 0 !important;
}

.ui.action.input > .button:hover,
.search-button:hover {
    color: var(--text-primary) !important;
    background: transparent !important;
}


/* =========================================
   4. SIDEBAR — STABLE SCROLLING PRESERVED
   ========================================= */

/* Hide theme switchers */
.sidebar-theme-switcher, .checkbox-switcher, .theme-toggle-container {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Restore hamburger */
.sidebar-toggle, .mobile-menu-toggle, .ui.menu .item > i.sidebar.icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-primary) !important;
    height: auto !important;
}

/* Sidebar background only — no overflow rules */
#app-sidebar, #sidebar, .ui.sidebar, .ui.left.sidebar.menu,
.sidebar-container, .page-sidebar, html[data-theme="light"] .page-sidebar {
    background-color: var(--bg-base) !important;
    background: var(--bg-base) !important;
    border-right: 1px solid var(--panel-border) !important;
}

/* Inner scroll container: this is the ONLY place overflow goes */
.page-sidebar-inner, .nav-menu {
    overflow-y: auto !important;
}

/* Nav items */
.nav-menu .item, .sidebar-item, .ui.sidebar .item, html[data-theme="light"] .ui.sidebar .item {
    color: var(--text-secondary) !important;
    border: none !important;
    background: transparent !important;
    text-shadow: none !important;
    border-radius: 8px !important;
    margin: 4px 10px !important;
    transition: all 0.2s ease;
}

.nav-menu .item:hover, .sidebar-item:hover, .ui.sidebar .item:hover {
    background-color: var(--panel-bg) !important;
    color: var(--text-primary) !important;
}

.nav-menu .item.active, .sidebar-item.active, .ui.sidebar .item.active {
    background-color: rgba(229, 57, 53, 0.1) !important;
    color: var(--accent-color) !important;
    border-right: 3px solid var(--accent-color) !important;
}


/* =========================================
   5. VIDEO PLAYER
   ========================================= */
.video-js .vjs-big-play-button {
    background-color: rgba(229, 57, 53, 0.9) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 65px !important;
    height: 65px !important;
    line-height: 65px !important;
    margin-top: -32px !important;
    margin-left: -32px !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5) !important;
}

.vjs-play-progress,
.vjs-volume-level,
.video-js .vjs-play-progress,
.video-js .vjs-volume-level,
.video-js .vjs-slider-bar {
    background-color: var(--accent-color) !important;
}

.video-js .vjs-control-bar {
    background: rgba(10, 10, 12, 0.8) !important;
}


/* =========================================
   6. GRID & CARDS
   ========================================= */
.media-list-container, .ui.cards {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1.5rem !important;
    margin: 0 !important;
}

.media-item, .ui.card {
    width: 100% !important;
    margin: 0 !important;
}

html[data-theme="light"] .ui.card, html[data-theme="light"] .ui.cards > .card,
html[data-theme="light"] .ui.card > .content, html[data-theme="light"] .ui.card > .extra,
body.light .ui.card, body.light .ui.card > .content,
.ui.card, .ui.cards > .card, .ui.card > .content, .ui.card > .extra,
.media-item, .media-item-info {
    background-color: transparent !important;
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.ui.card > .content, .media-item-info {
    padding: 0.75rem 0 0 0 !important;
}


/* =========================================
   7. TYPOGRAPHY
   ========================================= */
html[data-theme="light"] .ui.card > .content > .header,
html[data-theme="light"] .media-item-title,
body.light .ui.card > .content > .header,
.media-item-title, .media-item-title a,
h1, h2, h3, .header,
.ui.card > .content > .header {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    line-height: 1.3 !important;
    background: transparent !important;
}

html[data-theme="light"] .ui.card .meta,
html[data-theme="light"] .media-item-author,
body.light .ui.card .meta,
.media-item-author, .media-item-author a,
.media-item-views, .ui.card .meta, .ui.card .description {
    color: var(--text-secondary) !important;
    font-size: 0.85rem !important;
    margin-top: 0.25rem !important;
    background: transparent !important;
}


/* =========================================
   8. THUMBNAILS & BUTTONS
   ========================================= */
.media-item-thumbnail-container {
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
    aspect-ratio: 16 / 9;
    width: 100% !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.media-item-thumbnail-container:hover {
    transform: scale(1.03);
}

.media-item-thumbnail-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

button, .ui.button, .btn, html[data-theme="light"] .ui.button {
    background-color: var(--panel-bg) !important;
    border: 1px solid var(--panel-border) !important;
    color: var(--text-primary) !important;
    border-radius: 50px !important;
}


/* =========================================
   9. FORM FIELDS (Edit Media Page)
   ========================================= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="url"],
input[type="file"],
textarea,
select,
.ui.input input,
.ui.form input,
.ui.form textarea,
.ui.form select {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid var(--panel-border) !important;
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    color-scheme: dark !important;
}

/* Force dark on native date picker */
input[type="date"],
input[type="date"]:not([disabled]) {
    color-scheme: dark !important;
    background-color: #1a1a1e !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
}

input[type="date"]::-webkit-datetime-edit {
    background-color: #1a1a1e !important;
    color: #ffffff !important;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    background-color: #1a1a1e !important;
}

input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    background-color: #1a1a1e !important;
    color: #ffffff !important;
}

input[type="date"]::-webkit-inner-spin-button {
    display: none !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background-color: transparent !important;
    filter: invert(1) !important;
    cursor: pointer !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    background-color: rgba(255, 255, 255, 0.10) !important;
    border-color: var(--accent-color) !important;
    outline: none !important;
    box-shadow: none !important;
}

/* File input button */
input[type="file"]::file-selector-button {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--panel-border) !important;
    color: var(--text-primary) !important;
    border-radius: 6px !important;
    padding: 4px 12px !important;
    cursor: pointer !important;
}

input[type="file"]::file-selector-button:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.ui.form .field > label,
.ui.form label {
    color: var(--text-secondary) !important;
}

/* =========================================
   NUCLEAR DARK MODE FORCE
   Catches all hardcoded inline white/light
   backgrounds across every page
   ========================================= */

/* Override all inline background-color styles */
[style*="background-color: #f0f0f0"],
[style*="background-color:#f0f0f0"],
[style*="background-color: white"],
[style*="background-color:white"],
[style*="background-color: #fff"],
[style*="background-color:#fff"],
[style*="background-color: #ffffff"],
[style*="background-color:#ffffff"],
[style*="background-color: rgb(255, 255, 255)"],
[style*="background: white"],
[style*="background: #fff"],
[style*="background: #ffffff"] {
    background-color: var(--bg-base) !important;
    background: var(--bg-base) !important;
}

/* Force all text dark in these overridden containers */
[style*="background-color: #f0f0f0"] *,
[style*="background-color:#f0f0f0"] *,
[style*="background-color: white"] *,
[style*="background-color:#fff"] * {
    color: var(--text-primary) !important;
}

/* Catch all remaining white/light panels */
.media-edit-nav,
.user-action-form-wrap,
.user-action-form-inner,
.bg-background,
.bg-white,
.bg-gray-100,
.bg-gray-50,
.form-group,
.editing-tools-container,
.timeline-container-card,
.timeline-header-container,
.clip-segments-container,
.video-editor-trim-root,
.video-player-container,
/* Category widget */
.category-list,
.category-list.scrollable,
.category-content,
.category-panel,
.category-widget,
/* Trim page */
.clip-segments-container *,
.timeline-container-card * {
    background-color: var(--bg-base) !important;
    background: var(--bg-base) !important;
    color: var(--text-primary) !important;
    border-color: var(--panel-border) !important;
}

/* Category list - maximum specificity override */
html body .category-list,
html body .category-list.scrollable,
html body div.category-list,
html body .category-widget .category-list,
html body .category-content .category-list,
html body .category-panel .category-list,
html body form .category-list {
    background: #0a0a0c !important;
    background-color: #0a0a0c !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

html body .category-item {
    background: #1a1a1e !important;
    background-color: #1a1a1e !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

html body .category-item:hover {
    background: rgba(229, 57, 53, 0.15) !important;
    border-color: rgba(229, 57, 53, 0.4) !important;
}

html body .category-panel h3,
html body .category-widget * {
    color: #ffffff !important;
}

html body .category-search {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

html body .empty-message {
    color: #a0a0a5 !important;
}

/* Trim page segment cards */
.timeline-container-card [class*="segment"],
[class*="segment-card"],
[class*="clip-segment"] {
    background-color: rgba(229, 57, 53, 0.15) !important;
    border: 1px solid rgba(229, 57, 53, 0.3) !important;
    color: var(--text-primary) !important;
}

/* "Not saved yet" save bar */
[class*="save-bar"],
[class*="SaveBar"],
[class*="not-saved"],
.timeline-header-container + div {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--panel-border) !important;
    color: var(--text-secondary) !important;
}

/* Box shadow overrides */
[style*="box-shadow"],
.user-action-form-inner[style] {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

/* Tab bar on edit page */
.ui.tabular.menu,
.ui.menu:not(.fixed) {
    background: transparent !important;
    border-bottom: 1px solid var(--panel-border) !important;
}

.ui.tabular.menu .item,
.ui.menu:not(.fixed) .item {
    color: var(--text-secondary) !important;
    border: none !important;
}

.ui.tabular.menu .active.item,
.ui.menu:not(.fixed) .active.item {
    background: transparent !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--accent-color) !important;
}


/* =========================================
   10. CATEGORIES SECTION FIX
   ========================================= */
#categories-section .item-title a,
#categories-section .item-author {
    color: var(--text-primary) !important;
}

#categories-section .item-meta span,
#categories-section .item-meta a {
    color: var(--text-secondary) !important;
}

/* =========================================
   11. SCROLLBARS
   ========================================= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #2a2a2f; border-radius: 10px; }