﻿/* global vars and base styles */
:root {
    --bg-color: #0f1016;
    --card-bg: #181924;
    --text-color: #e4e4e7;
    --accent-color: #7c5dfa;
    --accent-dark: #6b4df0;
    --border-color: #2e2f3e;
    --input-bg: #181924;
    --success: #00CC66;
    --error: #ef4444;
    --info: #3498db;
    --warning-bg: rgba(124, 93, 250, 0.15);
    --warning-border: #7c5dfa;
    --text-muted: #a1a1aa;
    /* consistent control/button row height (tabs, inputs, small buttons) */
    --control-height: 32px;
    --control-radius: 6px;
}

[data-theme="light"] {
    --bg-color: #f4f4f9;
    --card-bg: #ffffff;
    --text-color: #333333;
    --accent-color: #d48e00;
    --border-color: #ddd;
    --input-bg: #f0f0f0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s, color 0.3s;
}

/* when sidebar is active, body uses sidebar background */
.main-content-wrapper {
    background-color: var(--bg-color);
}

/* fallback for browsers that support :has() */
@supports selector(:has(*)) {
    body:has(.app-sidebar) {
        background-color: var(--bg-color);
    }
}

body.modal-open {
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* visually hidden: off-screen for accessibility, not type="hidden" */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* basic container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

/* when sidebar is active, containers go full width in main-content */
.main-content-wrapper .container {
    max-width: 100%;
    padding: 0;
}

/* sidebar navigation (new layout) */

/* sidebar container */
.app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    border-right: 1px solid var(--border-color);
}

/* custom scrollbar for sidebar */
.app-sidebar::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.app-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* sidebar header + logo */
.sidebar-header-link {
    text-decoration: none;
    display: block;
    transition: opacity 0.2s;
}

.sidebar-header-link:hover {
    opacity: 0.8;
}

.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    cursor: pointer;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
}

/* sponsor link (buy me a coffee button) */
.sidebar-sponsor {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    margin: 0 12px 16px 12px;
    text-decoration: none;
    transition: transform 0.2s;
    line-height: 0;
}

.sidebar-sponsor:hover {
    transform: translateX(2px);
}

.sidebar-sponsor img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* nav sections */
.sidebar-nav {
    flex: 1;
    padding: 0 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #AAAAAA;
    letter-spacing: 1px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

/* nav items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background-color: var(--warning-bg);
    color: var(--accent-color);
    font-weight: 600;
    border-left: 2px solid var(--accent-color);
}

.nav-item.active i {
    color: var(--accent-color);
}

/* sidebar Requests pending count badge */
.sidebar-requests-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    background-color: #e74c3c;
    color: #fff;
}

.nav-item.active .sidebar-requests-badge {
    background-color: rgba(255, 255, 255, 0.25);
}

/* sidebar footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #0A4D22;
    margin-top: auto;
}

.logout-item {
    color: #e74c3c;
}

.logout-item:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #ff6b6b;
}

/* mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: var(--border-color);
    border-color: var(--accent-color);
}

/* main content wrapper */
.main-content-wrapper {
    margin-left: 240px;
    min-height: 100vh;
    background-color: #000000;
    transition: margin-left 0.3s ease;
}

/* main header bar */
.main-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    flex: 0 0 auto;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.header-info-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #ffffff;
    white-space: nowrap;
}

.version-info span:first-child {
    color: #AAAAAA;
    font-weight: 500;
}

.version-info span:last-child {
    color: #fff;
    font-weight: 600;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    position: relative;
    white-space: nowrap;
}

/* Partner Projects: Huntarr - one pill container; label muted and not clickable; link in accent */
.header-link-friends-wrap {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(124, 93, 250, 0.4);
    font-weight: 600;
    font-size: 0.76em;
    letter-spacing: 0.02em;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.header-link-friends-wrap.header-link-wiki-wrap {
    text-decoration: none;
    color: var(--accent-color);
}

.header-link-friends-wrap.header-link-wiki-wrap:hover {
    color: var(--accent-color);
    border-color: rgba(124, 93, 250, 0.7);
}

.header-link-friends-wrap.header-link-wiki-wrap .header-partner-label {
    margin-right: 0.35em;
}

.header-link-friends-wrap.header-link-wiki-wrap i {
    font-size: 0.72rem;
    opacity: 0.9;
}

.header-link-friends-wrap .header-partner-label {
    color: var(--text-muted);
    cursor: default;
    pointer-events: none;
    margin-right: 0.35em;
}

.header-link-friends-wrap .header-link-friends {
    color: var(--accent-color);
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    transition: color 0.2s ease, filter 0.2s ease;
}

.header-link-friends-wrap .header-link-friends:hover {
    color: var(--accent-color);
    filter: brightness(1.15);
}

.header-link-friends-wrap .header-link-friends i {
    font-size: 0.72rem;
    opacity: 0.9;
    margin-right: 0.25em;
}

.header-link-friends-wrap .header-link-friends:active {
    color: var(--accent-color);
}

.version-update-link {
    position: relative;
}

.header-link:hover {
    color: #fff;
}

.header-link i {
    font-size: 1rem;
}

.header-link i.fa-star {
    color: var(--accent-color);
}

/* buy me a coffee button in header */
.header-right a[href*="buymeacoffee"] {
    display: inline-block;
    line-height: 0;
    vertical-align: middle;
}

.header-right a[href*="buymeacoffee"] img {
    display: block;
}

.version-update-link {
    color: #AAAAAA;
    display: flex;
    align-items: center;
    gap: 6px;
}

.version-update-link:hover {
    color: var(--accent-color);
}

.version-update-link i {
    font-size: 0.9rem;
}

.update-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: none;
    box-shadow: 0 0 4px rgba(124, 93, 250, 0.8);
}

/* main content area */
.main-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    transition: opacity 0.12s ease-out;
}

.main-content.content-pending {
    opacity: 0;
}

/* responsive behavior */
@media (max-width: 768px) {
    .result-card:hover .card-icon-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.4);
    }

    .result-card:hover {
        transform: none;
        border-color: var(--border-color);
    }

    .app-sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    .app-sidebar.sidebar-collapsed {
        transform: translateX(0);
    }

    .main-content-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .header-info-group {
        gap: 12px;
        font-size: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .version-info {
        font-size: 0.75rem;
    }

    .header-link {
        font-size: 0.75rem;
    }

    .main-content {
        padding: 16px;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .main-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-left {
        width: 100%;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }
}

/* overlay for mobile sidebar */
@media (max-width: 768px) {
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* legacy navbar (kept for backwards compat if needed) */
.navbar {
    display: none;
    /* hide old navbar */
}

/* basic components - cards, buttons, inputs */
.card h3,
.card h4,
.setting-card h3,
.setting-card h4 {
    color: var(--text-color);
    margin-top: 0;
    font-weight: 700;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* buttons */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
    opacity: 0.9;
}

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
    pointer-events: none;
}

.btn-primary {
    background: var(--accent-color);
    color: #000000;
}

.btn-primary:hover {
    filter: brightness(1.1);
    opacity: 1;
    color: #000000 !important;
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    /* Ensure no other color shift occurs */
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-secondary:hover {
    background: rgba(0, 204, 102, 0.1);
}

.btn-danger {
    background: var(--error);
    color: white;
}

/* input field styles */
input,
select,
textarea {
    color: #ffffff !important;
    background-color: #222 !important;
}

input::placeholder {
    color: #AAAAAA !important;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    box-sizing: border-box;
    width: 100%;
    font-size: 1em;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Checkbox style: white outline when unchecked, solid blue with white check when checked */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
}

input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.9);
}

input[type="checkbox"]:checked:hover {
    background-color: #5dade2;
    border-color: #5dade2;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.helper-text {
    font-size: 0.85em;
    color: #AAAAAA;
    margin-top: -5px;
    margin-bottom: 8px;
}

/* text utilities */
.text-muted,
.form-text,
small {
    color: #AAAAAA !important;
}

.fw-bold {
    font-weight: bold;
}

/* setup notice banner (can be minimized) */
.setup-notice {
    max-width: 800px;
    margin: 0 auto 30px auto;
    background: var(--warning-bg);
    border-left: 4px solid var(--warning-border);
    padding: 12px 14px;
    text-align: left;
    border-radius: 4px;
}

.setup-notice--center {
    margin-left: auto;
    margin-right: auto;
}

/* playlists page alignment */
.playlists-center {
    text-align: center;
}

.playlists-center .media-sub {
    text-align: center;
}

.playlists-center .stats-bar {
    margin-left: auto;
    margin-right: auto;
}

.playlists-center .action-bar {
    text-align: center;
}

.playlists-center .type-toggle-group {
    text-align: center;
}

.schedule-card h5 {
    color: var(--text-color);
    margin-bottom: 8px;
}

.schedule-card .text-muted,
.schedule-card small {
    color: var(--text-color);
}

/* compact schedule time row: box = label + time; Save sits outside */
.schedule-time-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.schedule-time-compact {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: fit-content;
    flex-wrap: nowrap;
    box-sizing: border-box;
    overflow: hidden;
}

.schedule-label {
    color: var(--text-color);
    font-size: 0.9em;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.schedule-time-input {
    width: 135px !important;
    min-width: 0 !important;
    max-width: 135px !important;
    padding: 6px 8px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #fff !important;
    background-color: #1a1a1a !important;
    border-radius: 4px;
    box-sizing: border-box !important;
    -webkit-text-fill-color: #fff !important;
}

.schedule-save-btn {
    padding: 6px 16px !important;
    font-size: 0.85em !important;
    flex-shrink: 0;
}

.save-feedback {
    color: var(--success);
    font-size: 0.85em;
    font-weight: 500;
    margin-left: 4px;
}

.setup-notice__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--accent-color);
    font-weight: 700;
}

.setup-notice__toggle {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8em;
    cursor: pointer;
}

.setup-notice__body {
    color: #ccc;
    font-size: 0.95em;
    line-height: 1.5;
    margin-top: 6px;
}

.setup-notice__body a {
    text-decoration: underline;
    color: white;
    font-weight: bold;
}

.setup-notice.is-collapsed {
    padding: 8px 12px;
}

.setup-notice.is-collapsed .setup-notice__body {
    display: none;
}

/* flash message alerts */
.flash {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

.flash.success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

.flash.error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

.flash.info {
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid #3498db;
    color: #3498db;
}

/* global loader */
#nuclear-loader,
#global-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.96) !important;
    z-index: 2147483647 !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(5px);
}

.nuclear-spinner,
.global-spinner {
    width: 70px;
    height: 70px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: nuke-spin 1s linear infinite;
    margin-bottom: 25px;
}

@keyframes nuke-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Preview & Viewer */
.preview-item {
    position: relative;
    background: #2b2b2b;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    text-align: center;
}

.preview-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #2ecc71;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.viewer-card {
    position: relative;
    background: #2b2b2b;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    aspect-ratio: 2/3;
    transition: transform 0.2s;
}

.viewer-card:hover {
    transform: scale(1.03);
    z-index: 5;
}

.viewer-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(230, 126, 34, 0.9);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.viewer-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    padding: 8px;
    font-size: 12px;
}

.viewer-visibility {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
    color: #ccc;
}

.viewer-check {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.viewer-save-banner {
    grid-column: 1 / -1;
    background: #2ecc71;
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Artwork Modal & Buttons */
.artwork-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Prevent modal itself from scrolling weirdly */
}

.artwork-modal[style*="display: flex"] {
    display: flex !important;
}

.artwork-content {
    background: #1f1f1f;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
    max-height: 90vh;
    /* Ensure it fits on screen */
    overflow-y: auto;
    /* Scroll inside modal if content is too tall */
    position: relative;
}

.artwork-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.artwork-title-bar h2 {
    margin: 0;
    font-size: 20px;
}

.artwork-close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.artwork-close-btn:hover {
    color: #fff;
}

.btn-artwork {
    background: none;
    border: 1px solid #444;
    color: #aaa;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 5px;
}

.btn-artwork:hover {
    border-color: #666;
    background: #333;
    color: #fff;
}

.playlist-control-section--actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-delete-inline {
    background: none;
    border: 1px solid #c0392b;
    color: #e74c3c;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    margin-left: auto;
    /* Push to right */
}

.btn-delete-inline:hover {
    background: #c0392b;
    color: white;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-align: left;
}

.auth-heading {
    margin: 0 0 0.5rem 0;
    padding: 1.25rem 1.5rem 0;
    font-size: 1.25rem;
    color: #fff;
}

.auth-toggle {
    display: flex;
    border-bottom: 1px solid #333;
    background: #111;
}

.toggle-btn {
    flex: 1;
    padding: 20px;
    border: none;
    background: transparent;
    color: #777;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.toggle-btn:hover {
    color: #aaa;
    background: #161616;
}

.toggle-btn.active {
    color: white;
    background: #1a1a1a;
    border-bottom: 3px solid var(--accent-color);
}

.auth-body {
    padding: 30px;
}

.auth-body .form-group {
    margin-bottom: 20px;
}

.auth-body label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #ccc;
    font-weight: 600;
}

.login-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: var(--accent-color);
    color: black;
    font-weight: 800;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.login-btn:hover {
    opacity: 0.9;
}

.hidden-field {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.visible-field {
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85em;
    color: #666;
}

/* dashboard styles */

/* section titles (trending, etc) - 30% smaller */
.section-title {
    font-size: 1.05em !important;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 14px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

/* Tautulli Top 5: collapsible dropdown, remembers open/closed */
.tautulli-top5-dropdown {
    text-align: center;
}

.tautulli-top5-trigger {
    font-size: 1.05em !important;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 14px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.tautulli-top5-trigger::-webkit-details-marker {
    display: none;
}

.tautulli-top5-trigger::before {
    content: "\25BE";
    font-size: 0.9em;
    opacity: 0.8;
    margin-right: 6px;
}

.tautulli-top5-trigger::after {
    content: "\25BE";
    font-size: 0.9em;
    opacity: 0.8;
    margin-left: 6px;
}

.tautulli-top5-dropdown[open] .tautulli-top5-trigger::before,
.tautulli-top5-dropdown[open] .tautulli-top5-trigger::after {
    transform: rotate(180deg);
}

.tautulli-top5-trigger:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: #444;
    color: #ddd;
}

/* warning banners */
.warning-banner {
    max-width: 800px;
    margin: 0 auto 30px auto;
    background: var(--warning-bg);
    border-left: 4px solid var(--warning-border);
    padding: 15px;
    text-align: left;
    border-radius: 4px;
}

.warning-banner strong {
    color: var(--warning-border);
    display: block;
    margin-bottom: 5px;
}

.warning-banner span {
    color: #ccc;
    font-size: 0.95em;
    line-height: 1.5;
    display: block;
}

.warning-link {
    text-decoration: underline;
    color: white;
    font-weight: bold;
}

/* discovery card */
.discovery-card {
    max-width: 700px;
    margin: 0 auto 15px auto;
    border-top: 4px solid var(--accent-color);
    text-align: left;
}

.info-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
    line-height: 1.5;
    color: #bbb;
    border: 1px solid #333;
}

/* scan controls */
.scan-btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.scan-btn-group .btn-scan {
    flex: 1;
    min-width: 0;
}

.scan-btn-group-lucky {
    flex: 1;
    min-width: 0;
    display: flex;
}

.scan-btn-group-lucky .btn-lucky {
    width: 100%;
    max-width: none;
    margin: 0;
}

.btn-scan {
    flex: 1;
    color: #000000;
    border: none;
    text-decoration: none;
}

.btn-scan:hover {
    color: #000000;
    opacity: 0.9;
}

.btn-scan.movie {
    color: #000000;
}

.btn-scan.movie:hover {
    color: #000000;
    filter: brightness(1.1);
    opacity: 1;
}

.btn-scan.tv {
    color: #000000;
}

.btn-scan.tv:hover {
    color: #000000;
    filter: brightness(1.1);
    opacity: 1;
}

.btn-lucky {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    color: #000000;
    border: none;
    text-decoration: none;
}

.btn-lucky:hover {
    color: #000000;
    filter: brightness(1.1);
    opacity: 1;
}

/* inputs within discovery card */
.history-limit-input {
    width: 21px;
    padding: 2px 3px;
    font-size: 0.75rem;
    border-radius: 4px;
    background: #111;
    border: 1px solid #444;
    color: white;
    text-align: center;
}

.history-tip-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-align: center;
}

.history-tip-wrap p {
    margin: 0;
}

.critic-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #333;
    transition: 0.2s;
}

.critic-input {
    width: 45px;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid #555;
    background: #222;
    color: #fff;
    font-size: 0.9em;
    display: none;
}

/* library exclusion grid */
.library-grid,
.ignore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border: 1px solid #333;
    border-radius: 6px;
    margin-bottom: 12px;
}

.ignore-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.ignore-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ignore-item input {
    margin: 0;
}

.library-grid-centered {
    justify-content: center;
}

/* Exclude Libraries: centered dropdown with tickboxes (dashboard) */
.exclude-libraries-section {
    text-align: center;
}

.exclude-libs-dropdown {
    display: inline-block;
    position: relative;
    min-width: 220px;
}

.exclude-libs-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 8px;
    color: #aaa;
    font-size: 0.95em;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.exclude-libs-trigger::-webkit-details-marker {
    display: none;
}

.exclude-libs-trigger::after {
    content: "\25BE";
    font-size: 0.85em;
    opacity: 0.8;
}

.exclude-libs-dropdown[open] .exclude-libs-trigger::after {
    transform: rotate(180deg);
}

.exclude-libs-trigger:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: #444;
    color: #ddd;
}

.exclude-libs-panel {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 6px);
    min-width: 200px;
    max-width: 320px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: grid;
    gap: 4px;
}

.exclude-libs-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    color: #ddd;
    margin: 0;
}

.exclude-libs-option:hover {
    background: #333;
}

.exclude-libs-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #e74c3c;
}

/* Discovery options: dropdown like Exclude Libraries (dashboard) */
.discovery-exclude-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.discovery-options-section {
    text-align: center;
}

.discovery-options-dropdown {
    display: inline-block;
    position: relative;
    min-width: 280px;
}

.discovery-options-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    border-radius: 8px;
    color: #aaa;
    font-size: 0.95em;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.discovery-options-trigger::-webkit-details-marker {
    display: none;
}

.discovery-options-trigger::after {
    content: "\25BE";
    font-size: 0.85em;
    opacity: 0.8;
}

.discovery-options-dropdown[open] .discovery-options-trigger::after {
    transform: rotate(180deg);
}

.discovery-options-trigger:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: #444;
    color: #ddd;
}

.discovery-options-panel {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 6px);
    min-width: 240px;
    padding: 8px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: grid;
    gap: 4px;
}

.discovery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 0;
}

.discovery-option:hover {
    background: #333;
}

.discovery-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.discovery-option-critic {
    color: #ff6347;
}

.discovery-option-critic input[type="checkbox"] {
    accent-color: #ff6347;
}

.discovery-option-future {
    color: #3498db;
}

.discovery-option-future input[type="checkbox"] {
    accent-color: #3498db;
}

.discovery-option-obscure {
    color: #9b59b6;
}

.discovery-option-obscure input[type="checkbox"] {
    accent-color: #9b59b6;
}


.exclude-libs-option span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lib-check-item {
    display: flex;
    align-items: center;
    background: #222;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #333;
    cursor: pointer;
    transition: 0.2s;
}

.lib-check-item:hover {
    background: #333;
    border-color: #555;
}

.lib-check-item input {
    margin-right: 10px;
}

.lib-check-item label {
    cursor: pointer;
    font-size: 0.9em;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    margin-bottom: 0;
}

/* trending widget (tautulli top 5) */
.trending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.trending-tabs {
    display: inline-flex;
    gap: 5px;
    background: var(--input-bg);
    padding: 0;
    min-height: var(--control-height);
    align-items: stretch;
    border-radius: var(--control-radius);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.t-tab {
    background: transparent;
    border: none;
    color: #AAAAAA;
    padding: 0 15px;
    min-height: var(--control-height);
    box-sizing: border-box;
    cursor: pointer;
    font-weight: bold;
    border-radius: var(--control-radius);
    transition: 0.2s;
    font-size: 0.85em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.t-tab:hover {
    color: var(--text-color);
    background: rgba(128, 128, 128, 0.1);
}

.t-tab.active {
    background: var(--accent-color);
    color: #000000;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(5, 98px);
    gap: 10px;
    min-height: 161px;
    justify-content: center;
}

.t-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}

.t-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.t-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.t-rank {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--accent-color);
    color: #000000;
    font-weight: 900;
    padding: 3px 7px;
    border-bottom-right-radius: 6px;
    font-size: 0.7em;
    z-index: 2;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.t-info {
    padding: 7px;
    font-size: 0.75em;
    text-align: center;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--input-bg);
    border-top: 1px solid var(--border-color);
}

.btn-find-similar {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0 15px;
    min-height: var(--control-height);
    box-sizing: border-box;
    border-radius: var(--control-radius);
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: 0.2s;
}

.btn-find-similar:hover {
    background: var(--accent-color);
    color: #000000;
}

/* Plex link upgrade notice (dismissible, above Tautulli) */
.plex-link-notice-wrap {
    margin-bottom: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.plex-link-notice-dropdown {
    background: rgba(52, 152, 219, 0.08);
    border: 1px solid rgba(52, 152, 219, 0.25);
    border-radius: 8px;
    padding: 0;
}

.plex-link-notice-trigger {
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--accent-color, #3498db);
    display: flex;
    align-items: center;
}

.plex-link-notice-trigger::-webkit-details-marker {
    display: none;
}

.plex-link-notice-trigger::before {
    content: '\25B6';
    margin-right: 8px;
    font-size: 0.7em;
    transition: transform 0.2s;
}

.plex-link-notice-dropdown[open] .plex-link-notice-trigger::before {
    transform: rotate(90deg);
}

.plex-link-notice-content {
    padding: 0 16px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.plex-link-notice-text {
    margin: 0;
    line-height: 1.5;
    color: var(--text-color);
    font-size: 0.95rem;
}

.plex-link-notice-dismiss {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.plex-link-notice-dismiss:hover {
    color: var(--text-color);
    border-color: #666;
    background: rgba(255, 255, 255, 0.05);
}

/* tautulli connection banner (when not configured) */
.tautulli-connect-wrap {
    position: relative;
    margin-bottom: 0;
}

.tautulli-connect-turnoff {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.tautulli-connect-turnoff:hover {
    color: var(--text-color);
    border-color: #666;
    background: rgba(255, 255, 255, 0.05);
}

.tautulli-banner {
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid #e74c3c;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
    border: 1px solid rgba(231, 76, 60, 0.2);
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
}

/* search components (main search bar and results) */
.main-search {
    width: 100%;
    padding: 20px;
    font-size: 1.2em;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
}

.main-search:focus {
    outline: none;
    border-color: var(--accent-color);
}

#search-results {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-align: left;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-poster-thumb {
    width: 40px;
    border-radius: 4px;
}

/* suggestions popup */
#suggestions {
    position: absolute;
    width: 100%;
    background: #1e1e1e;
    z-index: 10000;
    border: 1px solid var(--accent-color);
    border-top: none;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.suggestion-item {
    padding: 12px 15px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e0e0e0;
    background-color: #1e1e1e;
}

.suggestion-item:hover {
    background-color: #333;
    color: #fff;
}

.suggestion-item strong {
    color: var(--accent-color);
}

.settings-container .input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 14px;
}

.settings-container .input-group:last-child {
    margin-bottom: 0;
}

.settings-container .input-label {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.settings-container .helper-text {
    margin-top: 2px;
    margin-bottom: 4px;
    font-size: 0.82em;
}

.settings-container details.help-box {
    margin-top: 4px;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.settings-container details.help-box summary {
    cursor: pointer;
    padding: 4px 0;
}

.settings-container .password-wrapper {
    width: 100%;
    max-width: 420px;
}

.settings-container .test-row {
    max-width: 420px;
}

.test-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* kometa config builder page */

/* kometa builder layout and containers */
.k-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.k-panel {
    background: #1e1e1e;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #333;
    flex: 1;
    min-width: 600px;
}

/* tabs */
.k-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.k-tab {
    background: transparent;
    border: none;
    color: #777;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 6px;
    transition: 0.2s;
}

.k-tab:hover {
    color: #ccc;
    background: #2a2a2a;
}

.k-tab.active {
    background: var(--accent-color);
    color: #000;
}

.k-section {
    display: none;
    animation: fadeIn 0.3s;
}

.k-section.active {
    display: block;
}

/* kometa builder groups and headers */
.k-group {
    margin-bottom: 20px;
    background: #252525;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #333;
}

.k-group h4 {
    margin: 0 0 15px 0;
    color: #fff;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    line-height: 1.2;
}

.k-sub-header {
    font-size: 0.95em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 30px;
    margin-bottom: 10px;
    border-bottom: 1px dashed #444;
    padding-bottom: 5px;
}

/* input rows */
.k-input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
    position: relative;
}

.k-input-row label {
    flex: 1;
    color: #ccc;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.k-input-row input[type="text"],
.k-input-row input[type="password"],
.k-input-row input[type="number"],
.k-input-row select {
    flex: 2;
    background: #151515;
    border: 1px solid #444;
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.95em;
}

.k-input-row input:focus,
.k-input-row select:focus {
    border-color: var(--accent-color);
    outline: none;
}

/* kometa builder tooltips and icons */
.info-icon {
    cursor: help;
    font-size: 1em;
    opacity: 0.6;
}

.info-text {
    display: block;
    width: 100%;
    font-size: 0.85em;
    color: #888;
    margin-top: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
    font-style: italic;
    line-height: 1.5;
}

.btn-refresh {
    background: transparent;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
}

.btn-refresh:hover {
    opacity: 0.8;
}

.btn-gear {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 8px;
    transition: 0.2s;
    opacity: 0.5;
    margin-left: auto;
}

.btn-gear:hover {
    color: var(--accent-color);
    opacity: 1;
    transform: rotate(45deg);
}

/* checkbox grid */
.k-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.k-check-item {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    color: #ddd;
    cursor: pointer;
    background: #2a2a2a;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #333;
    transition: 0.2s;
}

.k-check-item:hover {
    border-color: #555;
    background: #333;
    transform: translateY(-1px);
}

.k-check-item.hidden {
    display: none;
}

.k-check-item.active .btn-gear {
    opacity: 1;
    color: #ccc;
}

.k-check-item input {
    margin-right: 12px;
}

.k-check-item label {
    cursor: help;
    display: flex;
    align-items: center;
    width: 100%;
    font-weight: 500;
}

/* kometa builder states and lists */
.locked-section {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.8);
    transition: 0.3s;
}

.lib-item {
    background: #2a2a2a;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent-color);
}

.lib-item span {
    font-weight: bold;
    color: white;
}

.lib-item small {
    color: #aaa;
    margin-left: 10px;
    font-weight: normal;
}

.btn-group {
    display: flex;
    gap: 5px;
}

.btn-remove {
    background: #c0392b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
}

.btn-remove:hover {
    background: #e74c3c;
}

.btn-edit {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
}

.btn-edit:hover {
    background: #5dade2;
}

.btn-add {
    width: 100%;
    background: var(--accent-color);
    color: #000000;
    border: none;
    padding: 12px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: bold;
    margin-top: 20px;
    transition: 0.2s;
}

.btn-add:hover {
    filter: brightness(1.1);
    opacity: 1;
    color: #000000;
}

.btn-add:disabled {
    background: #222;
    border: 1px solid #333;
    color: #555;
    cursor: not-allowed;
    filter: none;
    opacity: 1;
}

/* intro box (help section at top of kometa builder) */
.intro-box {
    background: rgba(52, 152, 219, 0.15);
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
    color: #d6eaf8;
}

.intro-box h3 {
    color: #3498db;
    margin-top: 0;
    margin-bottom: 8px;
}

.intro-box p {
    margin: 0 0 10px 0;
    font-size: 0.95em;
    line-height: 1.5;
}

.intro-box a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

/* help tip box inside intro */
.intro-tip-box {
    margin: 15px 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 6px;
}

.intro-tip-box h4 {
    color: #00CC66;
    margin-top: 0;
    border: none;
    font-size: 1em;
}

.intro-tip-box ol {
    margin: 0;
    padding-left: 20px;
    line-height: 1.6;
    color: #ddd;
    font-size: 0.9em;
}

.intro-tip-box p {
    margin-top: 12px;
    color: #ccc;
    font-size: 0.9em;
    margin-bottom: 0;
}

.intro-warning {
    color: #e74c3c;
    font-weight: bold;
    margin-top: 10px;
    display: block;
}

/* header row with buttons */
.header-row {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* performance indicator box */
#performance-indicator {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid #3498db;
    border-radius: 6px;
    display: none;
}

.perf-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.perf-text {
    color: #ddd;
    margin-left: 10px;
}

.perf-close-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1.2em;
}

.perf-close-btn:hover {
    color: #aaa;
}

/* header button styles */
.btn-header {
    padding: 6px 12px;
    font-size: 0.85em;
    text-decoration: none;
    display: inline-block;
}

.btn-header-save {
    padding: 6px 14px;
    font-weight: bold;
}

/* yaml output section (generated config) */
.yaml-box {
    background: #111;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    color: #a9b7c6;
    white-space: pre-wrap;
    border: 1px solid #444;
    font-size: 0.9em;
    max-height: 80vh;
    overflow-y: auto;
    line-height: 1.5;
}

.y-key {
    color: #cc7832;
    font-weight: bold;
}

.y-str {
    color: #6a8759;
}

.y-bool {
    color: #6897bb;
}

.y-cmnt {
    color: #808080;
    font-style: italic;
}

/* kometa modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 30000;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.modal-overlay.is-open {
    display: flex !important;
    pointer-events: auto;
}

.modal-overlay.is-open .modal-box {
    display: block;
    opacity: 1;
}

.modal-box {
    background: #1e1e1e;
    border: 1px solid #444;
    padding: 25px;
    border-radius: 12px;
    width: 650px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 30001;
    max-height: 90vh;
    overflow-y: auto;
    pointer-events: auto;
}

.var-modal-box {
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 960px);
}

.var-modal-header,
.var-modal-actions {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}

.var-modal-body {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    z-index: 30002;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.modal-close-btn:hover {
    color: #fff;
}

/* import modal needs a bit more width for the textarea */
.modal-box.import-modal {
    max-width: 700px;
}

/* comparison modal - wider + tighter lines */
.modal-box.comparison-modal {
    max-width: 1800px;
    width: 98%;
}

.comparison-desc {
    font-size: 0.85em;
    color: #aaa;
    margin-bottom: 15px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.comparison-header-current {
    color: #e74c3c;
    margin-bottom: 10px;
}

.comparison-header-saved {
    color: #2ecc71;
    margin-bottom: 10px;
}

.comparison-box {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    font-size: 0.85em;
    white-space: pre;
    font-family: monospace;
    line-height: 1;
    padding: 4px;
}

.diff-line {
    display: block;
    margin: 0;
    padding: 0 4px;
    line-height: 1;
}

.diff-line.diff-added {
    background: rgba(46, 204, 113, 0.25);
    border-left: 3px solid #2ecc71;
}

.diff-line.diff-removed {
    background: rgba(231, 76, 60, 0.25);
    border-left: 3px solid #e74c3c;
}

.diff-line.diff-blank {
    border-left: 3px solid transparent;
}

.var-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.var-input {
    background: #111;
    border: 1px solid #444;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    flex: 1;
}

.quick-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.qs-col label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: #aaa;
    margin-bottom: 5px;
}

.qs-col select,
.qs-col input {
    width: 100%;
    background: #111;
    border: 1px solid #444;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
}

/* kometa intro text (help/instructions) */
.intro-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.6;
    color: #ddd;
    font-size: 0.9em;
}

/* import modal stuff (url vs paste tabs) */
.import-tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
}

.import-tab-btn {
    padding: 8px 15px;
    border: none;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: 0.2s;
    font-weight: 500;
}

.import-tab-btn.active {
    background: #2c3e50;
    color: #fff;
}

.import-tab-btn:not(.active) {
    background: #34495e;
    color: #aaa;
}

.import-tab-btn:hover:not(.active) {
    color: #ccc;
}

.import-section {
    display: none;
}

.import-section.active {
    display: block;
}

/* textarea for pasting yaml directly */
#import-paste {
    width: 100%;
    min-height: 300px;
    font-family: monospace;
    font-size: 0.9em;
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #ddd;
    resize: vertical;
    border-radius: 6px;
}

#import-paste:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* modal header stuff */
.modal-box h3 {
    margin-top: 0;
}

.modal-box p {
    font-size: 0.85em;
    color: #aaa;
    margin-bottom: 15px;
}

/* button row at bottom of modals */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.var-modal-actions {
    margin-top: 0;
    padding-top: 16px;
    border-top: 1px solid #333;
}

/* playlists and collections page */
.playlist-header {
    text-align: center;
    margin-bottom: 40px;
}

.media-sub {
    font-size: 1.1em;
    color: #aaa;
    margin-bottom: 12px;
}

/* stats bar */
.stats-bar {
    background: transparent;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-flex;
    gap: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    font-size: 0.9em;
}

.stats-label {
    color: #fff;
    font-weight: 500;
}

/* action buttons (custom builder, import list) */
.action-bar {
    margin: 0 0 20px 0;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-builder,
.btn-import {
    padding: 8px 20px;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 36px;
    margin: 0;
}

.btn-builder {
    background: var(--accent-color);
    color: #000000;
    box-shadow: 0 0 10px rgba(124, 93, 250, 0.3);
}

.btn-import {
    background: var(--accent-color);
    color: #000000;
    box-shadow: 0 0 10px rgba(124, 93, 250, 0.3);
}

.btn-builder:hover,
.btn-import:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

/* type toggles */
.type-toggle-group {
    margin: 0 0 24px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.type-toggle-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: #fff;
    padding: 8px 24px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    margin: 0;
    transition: all 0.2s;
    font-size: 0.95em;
    min-width: 100px;
}

.type-toggle-btn.active,
.type-toggle-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

/* schedule time row */
.schedule-time-row {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    gap: 12px;
    margin-bottom: 10px;
}

.schedule-label {
    color: #fff;
    font-weight: 500;
    font-size: 0.95em;
}

.schedule-time-input {
    background: #000;
    border: 1px solid #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95em;
    width: auto;
}

.schedule-time-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
    opacity: 0.9;
    cursor: pointer;
}

.schedule-time-input::-webkit-clear-button {
    filter: invert(1) brightness(1.2);
}

.schedule-save-btn {
    background: var(--accent-color);
    color: #000000;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.schedule-save-btn:hover {
    background-color: var(--accent-color);
    filter: brightness(1.1);
    color: #000000;
}

/* preset grid and card styles */

/* collapsible category blocks (minimized by default) */
.category-block {
    margin-bottom: 8px;
}

.category-block .category-grid {
    margin-top: 12px;
}

.category-header--toggle {
    width: 100%;
    text-align: left;
    font-size: 1.4em;
    font-weight: bold;
    color: var(--accent-color);
    margin: 0;
    padding: 14px 12px 12px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.category-header--toggle:hover {
    background: rgba(0, 204, 102, 0.08);
}

.category-chevron {
    display: inline-block;
    width: 1em;
    font-size: 0.75em;
    transition: transform 0.2s;
}

.category-header {
    font-size: 1.4em;
    font-weight: bold;
    color: #ffffff;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist-section {
    /* used as data attribute selector in JS, no specific styling needed */
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.playlist-card {
    border-top: 4px solid var(--accent-color);
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.playlist-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.playlist-icon {
    font-size: 3em;
    margin-bottom: 10px;
    color: var(--text-color);
}

.playlist-title {
    margin: 0;
    color: var(--text-color);
}

.playlist-desc {
    font-size: 0.9em;
    color: #888;
    line-height: 1.5;
}

/* card controls */
.playlist-controls {
    margin-top: 20px;
}

.playlist-control-section {
    margin-bottom: 18px;
}

.playlist-control-section:last-child {
    margin-bottom: 0;
}

.playlist-control-section--actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #333;
    margin-top: 4px;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85em;
    color: #ccc;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-label-with-tip {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.2;
}

.control-label-with-tip .tooltip-container {
    margin-left: 0;
    flex: 0 0 auto;
    align-self: flex-start;
    transform: translateY(1px);
}

.visibility-label-block {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-color, #eee);
    margin-bottom: 8px;
}

.visibility-checks-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
    margin-bottom: 8px;
}

.visibility-checks-row .visibility-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-color, #eee);
}

.visibility-checks-row .visibility-check input {
    margin: 0;
    accent-color: var(--accent-color);
}

.control-select {
    background: #333;
    border: 1px solid #555;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 120px;
    width: 140px;
}

.control-select:disabled {
    background: #222;
    color: #777;
    border-color: #333;
    cursor: not-allowed;
}

.control-select-multi {
    background: #333;
    border: 1px solid #555;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 200px;
    width: 100%;
    max-width: 300px;
}

.control-select-multi option {
    padding: 4px;
}

.control-select-multi option:checked {
    background: var(--accent-color);
    color: white;
}

.sync-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: nowrap;
}

.btn-preview {
    padding: 6px 10px;
    min-width: 0;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #444;
    color: white;
    border: 1px solid #555;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
}

/* delete buttons on collection cards */
.btn-delete,
.btn-delete-inline {
    background: transparent;
    border: 1px solid #c0392b;
    color: #c0392b;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.btn-delete:hover,
.btn-delete-inline:hover {
    background: #c0392b;
    color: white;
}

.btn-sync {
    min-width: 0;
    padding: 6px 12px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #333;
    color: white;
    border: 1px solid #555;
    transition: 0.2s;
    cursor: pointer;
    border-radius: 5px;
    font-size: 0.9em;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.playlist-control-section--actions .btn-artwork {
    padding: 6px 10px;
    min-width: 0;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
}

.playlist-control-section--actions .btn-artwork:hover {
    background: #444;
    border-color: #666;
    color: #fff;
}

@media (max-width: 420px) {
    .playlist-control-section--actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.btn-synced-disabled {
    width: 100%;
    padding: 12px;
    background: #222;
    color: #555;
    border: 1px solid #333;
    cursor: not-allowed;
    border-radius: 5px;
}

.static-badge {
    margin-bottom: 10px;
    padding: 8px;
    color: #777;
    font-size: 0.85em;
    font-style: italic;
    text-align: center;
    border: 1px dashed #444;
    border-radius: 5px;
}

.locked-badge {
    font-size: 0.85em;
    color: var(--accent-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* tooltip styles (hover info) */
.tooltip-container {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 5px;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #222;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    border: 1px solid #444;
    line-height: 1.4;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* import modal */
.import-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.import-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 600px;
    border-radius: 12px;
    position: relative;
    animation: slideIn 0.3s;
    margin-bottom: 50px;
}

.import-content.wide {
    max-width: 800px;
}

.close-btn {
    float: right;
    cursor: pointer;
    font-size: 24px;
    color: #aaa;
}

details.help-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed #555;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    color: #ccc;
}

details.help-box--centered {
    max-width: 600px;
    margin: 0 auto 20px auto;
    text-align: left;
}

details.help-box summary {
    cursor: pointer;
    color: #ffffff;
    font-weight: bold;
    outline: none;
}

details.help-box p,
details.help-box ol {
    margin: 10px 0 0 0;
    padding-left: 0;
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.5;
}

details.help-box ol {
    padding-left: 20px;
}

details.help-box p:first-of-type {
    margin-top: 8px;
}

details.help-box code {
    color: #e0b0ff;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

.import-textarea {
    width: 100%;
    padding: 10px;
    background: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 5px;
    margin-bottom: 15px;
}

.import-field {
    margin-bottom: 15px;
}

.import-field .import-select {
    width: 100%;
    box-sizing: border-box;
}

.import-label {
    display: block;
    font-size: 0.9em;
    color: #aaa;
    margin-bottom: 6px;
}

.import-title-input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    font-size: 1em;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    box-sizing: border-box;
}

.import-title-input:focus {
    border-color: var(--success, #2ecc71);
    outline: none;
}

.import-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.import-input-row input {
    flex: 1;
}

/* visibility options (home / library / friends) for collections */
.visibility-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 15px;
}

.visibility-label {
    font-size: 0.9em;
    color: var(--text-muted);
}

.visibility-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9em;
}

.visibility-check input {
    margin: 0;
    accent-color: var(--accent-color);
}

/* tighter on preset cards */
.visibility-options--card {
    margin-bottom: 10px;
    gap: 8px 14px;
}

.visibility-options--card .visibility-label {
    font-size: 0.85em;
}

/* make visibility row stand out so users see home/library/friends options */
.visibility-options--highlight .visibility-label {
    font-weight: 600;
    color: var(--text-color);
}

.visibility-options--highlight .visibility-check {
    color: var(--text-color);
}

.visibility-hint {
    font-size: 0.85em;
    color: var(--text-muted, #999);
    line-height: 1.45;
    margin: 0;
}

.playlist-control-section .visibility-hint {
    margin-top: 4px;
}

.import-select {
    padding: 10px;
    border-radius: 5px;
    background: #333;
    color: white;
    border: 1px solid #444;
}

.btn-analyze {
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    color: #000000;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-analyze:hover {
    filter: brightness(1.1);
}

.btn-create-import {
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    color: #000000;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    margin-top: 15px;
    display: none;
    cursor: pointer;
}

.btn-create-import:hover {
    filter: brightness(1.1);
}

/* import results grid (matched items) */
.import-results-container {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    border-top: 1px solid #444;
    padding-top: 10px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.result-row {
    border-bottom: 1px solid #333;
}

.result-cell {
    padding: 5px;
}

.result-cell.query {
    color: #aaa;
}

.result-cell.status-found {
    color: var(--success);
    font-weight: bold;
}

.result-cell.status-missing {
    color: var(--error);
    font-weight: bold;
}

/* live preview grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.preview-item {
    text-align: center;
}

.preview-poster {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.preview-title {
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-meta {
    font-size: 0.75em;
    color: #aaa;
}

/* collections page tabs (auto-manager vs library browser) */
.tab-header {
    display: flex;
    justify-content: center;
    margin: 20px 0 30px 0;
    gap: 15px;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #777;
    font-size: 1.2em;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
    color: #bbb;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid var(--accent-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s;
}

.tab-content.active {
    display: block;
}

/* viewer cards */
.viewer-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid #333;
    aspect-ratio: 2/3;
}

.viewer-card:hover {
    transform: scale(1.03);
    border-color: var(--accent-color);
}

.viewer-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-color);
    color: black;
    font-weight: bold;
    padding: 4px 8px;
    border-bottom-left-radius: 8px;
    font-size: 0.9em;
}

.viewer-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.4));
    padding: 16px 10px 10px 10px;
    box-sizing: border-box;
}

/* tickboxes on Library Browser cards - show in Plex (Home / Library / Friends) */
.viewer-visibility {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    min-height: 24px;
}

.viewer-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.8em;
    color: var(--text-color);
    white-space: nowrap;
}

.viewer-check input {
    margin: 0;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.viewer-visibility-hint {
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.95;
    margin-top: 6px;
    line-height: 1.4;
}

/* temporary banner after saving visibility (Library Browser) */
.viewer-save-banner {
    grid-column: 1 / -1;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--text-muted);
}

/* custom builder */
.builder-container {
    max-width: 800px;
    margin: 30px auto;
    text-align: center;
}

.builder-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* custom builder form layout */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-col {
    flex: 1;
}

/* builder preview section */
.preview-section {
    margin-top: 40px;
    border-top: 1px solid #333;
    padding-top: 30px;
    text-align: left;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-count {
    background: #333;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #ccc;
}

/* preview cards in custom builder */
.b-preview-card {
    background: #252525;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    position: relative;
    transition: 0.2s;
    text-align: center;
}

.b-preview-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.b-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    opacity: 0.8;
    transition: 0.2s;
}

.b-preview-card:hover .b-poster {
    opacity: 1;
}

.b-info {
    padding: 8px;
    font-size: 0.85em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* request button overlay on preview cards */
.item-request-btn {
    padding: 6px 12px;
    background: #333;
    border: 1px solid #555;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s;
    text-transform: uppercase;
    font-weight: bold;
}

.item-request-btn:hover:not(:disabled) {
    background: var(--accent-color);
    color: black;
    border-color: var(--accent-color);
}

.item-request-btn:disabled {
    background: #222;
    color: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-save {
    display: block;
    width: auto;
    min-width: 250px;
    margin: 25px auto 0 auto;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: 600;
    background: var(--accent-color);
    color: #000000;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(124, 93, 250, 0.3);
}

.btn-save:hover {
    filter: brightness(1.1);
    background-color: var(--accent-color);
    opacity: 1;
    color: #000000;
}

.preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #333;
    border-radius: 8px;
    background: #151515;
}

.preview-item-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
}

.preview-item-row:last-child {
    border-bottom: none;
}

.preview-item-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.preview-tiny-poster {
    width: 45px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.preview-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-title-row {
    display: flex;
    flex-direction: column;
}

/* blocklist and management page */
.blocklist-wrap {
    max-width: 800px;
    margin: 0 auto;
}

.compact-800 {
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* blocklist page tabs (movies vs tv) */
.tab-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-container .tab-btn {
    padding: 10px 30px;
    background: #2a2a2a;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    font-size: 1em;
}

.tab-container .tab-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.tab-container .tab-btn:hover:not(.active) {
    background: #333;
    color: white;
}

/* blocklist item cards */
.block-list-container {
    width: 100%;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-height: 200px;
}

.block-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.block-item-row:last-child {
    border-bottom: none;
}

.block-item-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.block-item-row span {
    font-size: 0.95em;
    color: var(--text-color);
}

.block-item-row .btn-delete {
    background: transparent;
    border: 1px solid #c0392b;
    color: #c0392b;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
}

.block-item-row .btn-delete:hover {
    background: #c0392b;
    color: white;
}

/* search box in blocklist */
.search-container-block {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px auto;
}

/* results page */

/* results page header and layout */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.results-main {
    flex: 1;
}

.back-link {
    color: #888;
    text-decoration: none;
    font-size: 0.9em;
    transition: 0.2s;
}

.back-link:hover {
    color: var(--accent-color);
}

/* filter card */
.filter-card {
    width: 100%;
    box-sizing: border-box;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* genre selector (checkboxes) */
.genre-selector {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 15px;
    margin: 10px auto 25px auto;
    width: 100%;
    max-width: none;
}

.genre-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #ccc;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); /* Further shrunk to fit more */
    gap: 8px;
    width: 100%;
}

.genre-check {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 0.85em;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.genre-check:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

.genre-check input {
    accent-color: var(--accent-color);
    margin-right: 8px;
}

.genre-check label {
    cursor: pointer;
    margin: 0;
    line-height: normal;
    color: #ffffff !important;
    font-size: 0.85em; /* Shrunk font */
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* content rating grid */
.rating-grid {
    display: flex;
    flex-wrap: nowrap; /* Force one line for ratings */
    gap: 10px;
    margin: 10px auto;
    justify-content: center;
    width: 100%;
}

.rating-check {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    color: #888;
    transition: 0.2s all;
    min-width: 50px;
}

.rating-check:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.rating-check.checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.rating-check input {
    display: none;
}

.rating-filter-box {
    margin-right: 5px;
    cursor: pointer;
}

.hidden-genre {
    display: none;
}

.genre-expand {
    text-align: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #333;
    font-size: 0.85em;
    color: var(--accent-color);
    cursor: pointer;
    font-weight: bold;
}

.genre-expand:hover {
    text-decoration: underline;
}

/* keyword/tag input containers */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
    min-height: 20px;
}

/* global filter text overrides */
.filter-card .input-label,
.filter-card .genre-header strong {
    color: #fff !important;
    font-weight: 600;
}

.filter-card .text-muted {
    color: #bbb !important;
}

.filter-card input[type="number"],
.filter-card input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
}

.keyword-tag {
    background: #333;
    color: #eee;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.keyword-tag span {
    cursor: pointer;
    color: #aaa;
    font-weight: bold;
}

.keyword-tag span:hover {
    color: #fff;
}

.keyword-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #444;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.dropdown-item {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}

.dropdown-item:hover {
    background: #333;
    color: #fff;
}

/* results grid (recommendation cards) */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}

.result-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-5px);
    border-color: #555;
}

/* poster & overlays */
.poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
}

.poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-icon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
}

.result-card:hover .card-icon-overlay {
    opacity: 1;
}

.overlay-top-actions {
    display: flex;
    justify-content: flex-end;
}

.overlay-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.icon-group-right {
    display: flex;
    gap: 5px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 1px solid #555;
    transition: 0.2s;
    font-size: 1.1em;
}

.icon-btn:hover {
    background: white;
    color: black;
    transform: scale(1.1);
}

.btn-request {
    background: rgba(52, 152, 219, 0.9);
    border-color: #3498db;
}

/* card info text (title, year, etc) */
.card-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.movie-title {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: #888;
}

.meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
}

.meta-sep {
    color: #444;
}

/* rating badges */
.meta-rating {
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
    color: black;
}

.tmdb-score {
    background: var(--accent-color);
}

.imdb-score {
    background: #f5c518;
}

.rt-fresh {
    background: #fa320a;
    color: white;
}

.rt-rotten {
    background: #5F9105;
    color: white;
}

/* load more button (pagination) */
.load-more-wrapper {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 50px;
}

.load-more-btn {
    background: var(--accent-color);
    color: #000000;
    border: 1px solid var(--accent-color);
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1em;
    transition: 0.2s;
}

.load-more-btn:hover {
    background: var(--accent-color);
    color: #000000;
    filter: brightness(1.1);
}

/* Back to top (results page) */
.back-to-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.back-to-top-btn.back-to-top-visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn:hover {
    background: var(--accent-color);
    color: #000;
    transform: translateY(-2px);
}

/* view toggle (grid/list) */
/* review & selection page */

.filter-col {
    min-width: 0;
    max-width: none;
    text-align: center;
}

.filter-col input:not([type="checkbox"]) {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

.filter-col-full {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    text-align: center;
    width: 100% !important;
    display: block !important;
}

.filter-side-by-side {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 60px;
    width: 100%;
    margin: 20px 0;
}

.filter-rating-section {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.filter-rating-section .input-label {
    margin-bottom: 8px;
}

.filter-card {
    padding: 15px 20px !important;
}

.filter-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-row {
    display: grid;
    gap: 18px 24px;
    align-items: start;
}

.filter-row-two {
    grid-template-columns: minmax(320px, 1.35fr) minmax(220px, 1fr);
}

.filter-row-three {
    grid-template-columns: minmax(260px, 1.2fr) minmax(180px, 0.8fr) minmax(320px, 1.2fr);
}

.filter-row-full {
    grid-template-columns: 1fr;
}

.filter-col-rating input[type="range"] {
    max-width: 100%;
}

@media (max-width: 991px) {
    .filter-row-two,
    .filter-row-three {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-lucky-glow {
    background: var(--accent-color);
    color: #000000;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(124, 93, 250, 0.5);
}

.btn-lucky-glow:hover {
    filter: brightness(1.1);
    color: #000000;
    background-color: var(--accent-color);
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.selection-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
    border: 2px solid transparent;
}

.selection-card:hover {
    transform: translateY(-3px);
}

.selection-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
}

.selection-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selection-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.custom-check {
    width: 16px;
    height: 16px;
    accent-color: black;
    cursor: pointer;
    margin: 0;
}

.selection-info {
    padding: 8px;
    text-align: center;
    font-size: 0.9em;
}

.selection-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
}

.provider-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.provider-check input {
    display: none;
}

.provider-check label {
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    opacity: 0.5;
    cursor: pointer;
    transition: 0.2s;
}

.provider-check label img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.provider-check input:checked+label {
    border-color: var(--accent-color);
    opacity: 1;
    transform: scale(1.1);
}

/* modals and loading states */
.k-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.k-modal-content {
    background-color: #1a1a1a;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #444;
    width: 80%;
    max-width: 900px;
    border-radius: 12px;
    position: relative;
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.k-close-modal {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    color: #aaa !important;
    font-size: 28px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    z-index: 10000 !important;
    pointer-events: auto !important;
    user-select: none !important;
    padding: 5px 10px !important;
    line-height: 1 !important;
    border-radius: 4px !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    isolation: isolate !important;
}

.k-close-modal:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.modal-body {
    display: flex;
    width: 100%;
}

.modal-poster {
    width: 40%;
    min-width: 300px;
}

.modal-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-info {
    padding: 30px;
    padding-top: 60px;
    /* extra space for close button */
    width: 60%;
    overflow-y: auto;
    max-height: 80vh;
    position: relative;
    z-index: 1;
    /* below close button */
}

.modal-info h2 {
    margin-top: 0;
    color: var(--accent-color);
    font-size: 2em;
}

.modal-overview {
    line-height: 1.6;
    color: #ccc;
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* loading containers */
.loading-container {
    text-align: center;
    padding: 50px;
    display: none;
    width: 100%;
    grid-column: 1 / -1;
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner,
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

.loader-small {
    width: 20px;
    height: 20px;
    border-width: 3px;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* trailer modal (youtube embed) */
#trailer-modal .k-modal-content {
    background: black;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
}

/* settings page */
.settings-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 20px 40px;
}

.settings-header {
    text-align: left;
    margin-bottom: 20px;
}

.settings-header h2 {
    font-size: 1.35rem;
    margin-bottom: 4px;
}

.settings-header p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-muted, #999);
}

.seekandwatch-promo-settings .card-header {
    cursor: pointer;
}

.seekandwatch-promo-settings .btn-close-promo {
    cursor: pointer;
    opacity: 0.8;
}

.seekandwatch-promo-settings .btn-close-promo:hover {
    opacity: 1;
}

.badge-warning {
    color: #212529 !important;
}

.settings-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid #333;
    overflow-x: auto;
    padding-bottom: 10px;
}

.tab-link {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #AAAAAA;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 6px;
    white-space: nowrap;
    transition: 0.2s;
}

.tab-link:hover {
    color: #ffffff;
    background: rgba(0, 204, 102, 0.1);
}

.tab-link.active {
    background: var(--accent-color);
    color: #000000;
}

.settings-container .tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.settings-container .tab-content.active {
    display: block;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* settings grid for compact layout */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    align-items: start;
}

.settings-grid>.span-2 {
    grid-column: span 2;
}

@media (max-width: 850px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid>.span-2 {
        grid-column: span 1;
    }

    .settings-maintenance-fields {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .settings-maintenance-actions {
        justify-content: flex-start;
    }

    .backup-actions {
        text-align: left;
    }
}

/* setting cards with different color themes */
.settings-container .card.setting-card {
    padding: 14px 16px;
    margin-bottom: 0;
    /* managed by grid gap */
    border-radius: 8px;
    color: var(--text-color);
}

.settings-container .setting-card h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.settings-container .setting-card .text-muted,
.settings-container .setting-card p.text-muted {
    font-size: 0.875rem;
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.4;
}

.settings-maintenance-fields {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
}

.settings-maintenance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

.backup-list-container {
    max-width: 100%;
    overflow-x: auto;
}

.backup-table {
    min-width: 0;
    table-layout: fixed;
}

.backup-table td {
    word-break: break-word;
}

.backup-actions {
    text-align: right;
    white-space: normal;
}

.backup-actions a,
.backup-actions span {
    display: inline-block;
    margin-left: 10px;
}

.backup-actions a:first-child,
.backup-actions span:first-child {
    margin-left: 0;
}

.backup-delete-action {
    color: var(--error);
    cursor: pointer;
}

.setting-card {
    position: relative;
    overflow: hidden;
}

.setting-card.border-orange {
    border-left: 4px solid #00CC66;
}

.setting-card.border-green {
    border-left: 4px solid #2ecc71;
}

.setting-card.border-purple {
    border-left: 4px solid #9b59b6;
}

.setting-card.border-accent {
    border-left: 4px solid var(--accent-color);
}

.setting-card.border-info {
    border-left: 4px solid #3498db;
}

.setting-card.border-blue {
    border-left: 4px solid #2980b9;
}

/* Unified count/stat badges on settings (same color as accent) */
.settings-count-badge {
    font-size: 0.9em;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(124, 93, 250, 0.2);
    color: var(--accent-color);
    border: 1px solid rgba(124, 93, 250, 0.4);
}

.settings-count-badge strong {
    color: inherit;
}

/* password toggle wrapper */
.password-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 6px;
    min-width: 0;
}

.password-wrapper input {
    flex: 1;
    min-width: 0;
}

.toggle-pass {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px 6px;
}

.toggle-pass:hover {
    color: white;
}

.clear-field-btn {
    flex-shrink: 0;
    font-size: 0.85em;
    padding: 4px 8px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    text-decoration: underline;
}

.clear-field-btn:hover {
    color: var(--accent-color, #0d6efd);
}

/* ignore list grid (users and libraries) */
.ignore-label {
    display: block;
    margin: 15px 0 10px 0;
    font-weight: bold;
    color: #aaa;
}

.settings-container .ignore-label {
    margin: 10px 0 8px 0;
    font-size: 0.9rem;
}

.settings-container .ignore-grid {
    max-height: 140px;
    padding: 8px 10px;
    gap: 8px;
}

.ignore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
    background: #111;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 6px;
}

.ignore-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #ccc;
    cursor: pointer;
}

/* scanner & cache controls */
.sync-warning-box {
    background: rgba(0, 204, 102, 0.1);
    border-left: 4px solid #00CC66;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #ccc;
    font-size: 0.9em;
}

.cache-control-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* background scanner configuration */
.scanner-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
    background: #151515;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
}

.flex-item {
    flex: 1;
    min-width: 140px;
}

.spacer-col-1 {
    flex: 0.5;
}

.filter-input {
    background: #222;
    border: 1px solid #444;
    color: white;
    padding: 8px;
    border-radius: 4px;
}

/* scanner terminal */
#scanner-terminal {
    background-color: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    padding: 15px;
    height: 250px;
    overflow-y: auto;
    border-radius: 6px;
    border: 1px solid #333;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

/* danger zone section (delete/reset stuff) */
.danger-zone {
    border: 1px solid rgba(231, 76, 60, 0.3);
    background: rgba(231, 76, 60, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

/* force danger zone buttons to be auto-width (not full width)
   multiple selectors + !important to override any inherited styles */
.danger-zone button,
.danger-zone .btn,
.danger-zone .btn-danger {
    width: auto !important;
    max-width: fit-content !important;
    display: inline-block !important;
    flex: none !important;
}

/* backup list */
.backup-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #333;
    border-radius: 6px;
    background: #111;
}

/* save toast notification */
#save-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(124, 93, 250, 0.95);
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    opacity: 0;
    display: none;
    transition: opacity 0.5s;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    align-items: center;
    gap: 10px;
    font-weight: bold;
    pointer-events: none;
    border: 1px solid rgba(124, 93, 250, 0.5);
}

/* save button (settings page) */
.settings-container .btn-save {
    width: 100%;
    padding: 12px 16px;
    margin-top: 20px;
    background: var(--accent-color);
    color: #000000;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.settings-container .btn-save:hover {
    filter: brightness(1.1);
    opacity: 1;
}

.settings-container .danger-zone {
    margin-top: 20px;
    padding: 16px;
}

.settings-container .scanner-row {
    padding: 12px 14px;
}

.settings-container .sync-warning-box {
    padding: 12px 14px;
    margin-bottom: 14px;
}

.settings-container form .input-group {
    margin-bottom: 12px;
}

.settings-container form+form {
    margin-top: 12px;
}

.plex-sync-stats {
    margin-bottom: 10px;
}

.plex-sync-stats>div {
    margin-bottom: 4px;
}

.plex-sync-interval-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.plex-sync-interval-row .cache-interval-select {
    width: auto;
    min-width: 140px;
    max-width: 180px;
    padding: 8px 10px;
    border-radius: 5px;
    background: #111;
    color: white;
    border: 1px solid #444;
    font-size: 0.9rem;
}

/* Radarr/Sonarr cards: compact forms */
.settings-container .setting-card form {
    margin-bottom: 18px;
}

.settings-container .setting-card form:last-of-type {
    margin-bottom: 0;
}

.settings-container input[type="text"],
.settings-container input[type="password"],
.settings-container input[type="number"] {
    max-width: 100%;
    box-sizing: border-box;
}

/* custom modal */
.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.custom-modal-box {
    background: #222;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #444;
    width: 300px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    animation: popIn 0.3s forwards;
}

@keyframes popIn {
    to {
        transform: scale(1);
    }
}

.modal-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.modal-title {
    margin: 0 0 10px 0;
    color: white;
}

.modal-message {
    color: #aaa;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.modal-btn {
    background: var(--accent-color);
    color: #000000;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

/* switch toggle */
.switch-container input {
    display: none;
}

/* tv status overlays (for results page) */
.status-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

/* color coding for status */
.status-overlay.ended,
.status-overlay.canceled {
    background-color: #dc3545;
}

.status-overlay.returning-series {
    background-color: #28a745;
}

.status-overlay.planned {
    background-color: #17a2b8;
}

.status-overlay.in-production {
    background-color: #ffc107;
    color: black;
}

.status-overlay.pilot {
    background-color: #6610f2;
}

/* error pages (error.html) */
.error-container {
    text-align: center;
    margin-top: 50px;
}

.error-title {
    color: var(--error);
    font-size: 3em;
    margin-bottom: 0;
}

.error-message {
    font-size: 1.2em;
    color: #ccc;
    margin: 20px 0;
}

.btn-home {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    background: var(--accent-color);
    color: #000000;
    display: inline-block;
}

.btn-home:hover {
    opacity: 0.9;
    color: #000000;
}

/* logs page (logs.html) */
/* Sticky header on Logs page so controls stay visible when scrolling */
.logs-page-header {
    position: sticky;
    top: 56px;
    z-index: 99;
    background-color: var(--bg-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logs-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.logs-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: nowrap;
}

.logs-control-btn {
    width: auto !important;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 16px !important;
    font-size: 0.95rem !important;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.logs-actions .btn-preview,
.logs-actions .btn-delete,
.logs-actions .btn-secondary,
.logs-actions .logs-toggle-chip {
    width: auto !important;
    flex: 0 0 auto;
}

.logs-table-btn {
    min-width: 64px;
    padding: 4px 10px;
    font-size: 0.8rem;
    line-height: 1.2;
}

/* log table styles */
.logs-table-container {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #333;
    border-radius: 6px;
}

.logs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9em;
    min-width: 600px;
}

.logs-table thead tr {
    position: sticky;
    top: 0;
    z-index: 10;
}

.logs-table th {
    background: var(--card-bg);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    padding: 15px;
    color: #AAAAAA;
    font-weight: bold;
    box-shadow: 0 1px 0 0 var(--border-color);
}

.logs-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: #ffffff;
    vertical-align: top;
}

.settings-user-actions-cell {
    width: 1%;
    white-space: nowrap;
}

.settings-user-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.settings-user-action-btn {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    flex: 0 0 auto !important;
    padding: 6px 12px !important;
    font-size: 0.9rem;
    line-height: 1.2;
    margin: 0 !important;
}

@media (max-width: 850px) {
    .settings-user-actions-cell {
        width: auto;
        white-space: normal;
    }

    .settings-user-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .settings-user-action-btn {
        width: 100% !important;
    }
}

.logs-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Log Level Badges */
.log-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    color: white;
    font-weight: bold;
    display: inline-block;
    min-width: 60px;
    text-align: center;
}

.log-badge.info {
    background: #2980b9;
}

.log-badge.success {
    background: #27ae60;
}

.log-badge.warning {
    background: #e5a00d;
    color: #000000;
}

.log-badge.error {
    background: #c0392b;
}

.log-badge.default {
    background: #7f8c8d;
}

.switch-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.switch-label {
    margin-left: 10px;
    font-weight: bold;
    font-size: 0.9em;
}

.logs-toggle-chip {
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    background: rgba(124, 93, 250, 0.08);
    transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

.logs-toggle-chip:hover {
    background: rgba(124, 93, 250, 0.16);
}

.logs-toggle-chip .switch-label {
    margin-left: 0;
    white-space: nowrap;
}

.logs-toggle-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.logs-toggle-chip:has(input:checked) {
    background: rgba(124, 93, 250, 0.24);
    border-color: #9a7cff;
}

@media (max-width: 900px) {
    .logs-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .logs-actions {
        width: 100%;
        gap: 10px;
        flex-wrap: wrap;
    }
}

/* global utilities & polish */
/* custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* text selection */
::selection {
    background: var(--accent-color);
    color: #000000;
}

/* form control (bootstrap-like) */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* text color utilities */
.text-warning {
    color: #e5a00d !important;
}

.text-danger {
    color: #e74c3c !important;
}

/* animation utilities */
.blink {
    animation: blink 1s linear infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.3;
    }
}

.block-item-title {
    font-size: 1.1em;
    color: var(--text-color);
}

/* animation utilities */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* misc stuff */

/* dashboard loader text (nuclear scan spinner) */
.loader-title {
    color: white;
    font-weight: 800;
    margin: 0;
    font-size: 2em;
}

.loader-sub {
    color: #ccc;
    margin-top: 10px;
    font-size: 1.1em;
}

/* empty state */

/* utility classes for common inline styles */

/* text alignment */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* display utilities */
.d-flex {
    display: flex;
}

.d-inline-flex {
    display: inline-flex;
}

.d-block {
    display: block;
}

.d-inline-block {
    display: inline-block;
}

.d-none {
    display: none !important;
}

.d-grid {
    display: grid;
}

/* flex utilities */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-column {
    flex-direction: column;
}

.gap-5 {
    gap: 5px;
}

.gap-10 {
    gap: 10px;
}

.gap-15 {
    gap: 15px;
}

.gap-20 {
    gap: 20px;
}

/* spacing utilities */
.m-0 {
    margin: 0;
}

.mt-0 {
    margin-top: 0;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-5 {
    margin-top: 5px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-25 {
    margin-top: 25px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-5 {
    margin-bottom: 5px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-25 {
    margin-bottom: 25px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mb-40 {
    margin-bottom: 40px;
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.my-20 {
    margin-top: 20px;
    margin-bottom: 20px;
}

.my-25 {
    margin-top: 25px;
    margin-bottom: 25px;
}

.p-0 {
    padding: 0;
}

.pt-10 {
    padding-top: 10px;
}

.pt-20 {
    padding-top: 20px;
}

.pb-10 {
    padding-bottom: 10px;
}

.pb-20 {
    padding-bottom: 20px;
}

.px-10 {
    padding-left: 10px;
    padding-right: 10px;
}

.px-15 {
    padding-left: 15px;
    padding-right: 15px;
}

.px-20 {
    padding-left: 20px;
    padding-right: 20px;
}

.py-10 {
    padding-top: 10px;
    padding-bottom: 10px;
}

.py-15 {
    padding-top: 15px;
    padding-bottom: 15px;
}

.py-20 {
    padding-top: 20px;
    padding-bottom: 20px;
}

/* width utilities */
.w-100 {
    width: 100%;
}

.w-auto {
    width: auto;
}

.max-w-600 {
    max-width: 600px;
}

.max-w-700 {
    max-width: 700px;
}

.max-w-800 {
    max-width: 800px;
}

/* color utilities */
.text-white {
    color: #ffffff;
}

.text-error {
    color: #e74c3c;
}

.text-warning {
    color: #00CC66;
}

.text-muted {
    color: #AAAAAA;
}

.text-light {
    color: #ffffff;
}

.text-accent {
    color: var(--accent-color);
}

/* font utilities */
.fw-normal {
    font-weight: normal;
}

.fw-bold {
    font-weight: bold;
}

.fw-800 {
    font-weight: 800;
}

.fs-small {
    font-size: 0.8em;
}

.fs-normal {
    font-size: 0.9em;
}

.fs-large {
    font-size: 1.1em;
}

.fs-xlarge {
    font-size: 1.2em;
}

.fs-2em {
    font-size: 2em;
}

/* border utilities */
.border-top {
    border-top: 1px solid #333;
}

.border-bottom {
    border-bottom: 1px solid #333;
}

.border-left {
    border-left: 1px solid #333;
}

.border-right {
    border-right: 1px solid #333;
}

.border-none {
    border: none;
}

.border-bottom-none {
    border-bottom: none;
}

/* position utilities */
.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.position-fixed {
    position: fixed;
}

/* other common utilities */
.white-space-nowrap {
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-60 {
    opacity: 0.6;
}

/* icon color utilities */
.icon-red {
    color: #e74c3c;
}

.icon-orange {
    color: #00CC66;
}

.icon-yellow {
    color: #00CC66;
}

/* grid column utilities */
.grid-col-full {
    grid-column: 1 / -1;
}

/* empty state messages */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #777;
}

.empty-state-small {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

.empty-state-text {
    color: #aaa;
}

/* shared UI utility patterns */
.ui-section-intro {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.ui-card-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ui-summary-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
}

.ui-summary-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.ui-summary-value {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.ui-summary-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
    margin-top: 6px;
}

.ui-status-banner {
    border: 1px solid transparent;
    border-radius: 10px;
    margin: 0 0 18px;
    padding: 14px 16px;
}

.ui-status-banner strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 6px;
}

.ui-status-banner p {
    color: var(--text-muted);
    margin: 0;
}

.ui-status-banner--info {
    background: rgba(52, 152, 219, 0.12);
    border-color: rgba(52, 152, 219, 0.35);
}

.ui-status-banner--success {
    background: rgba(0, 204, 102, 0.12);
    border-color: rgba(0, 204, 102, 0.35);
}

.ui-status-banner--warning {
    background: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.35);
}

.ui-status-banner--danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.ui-empty-state {
    color: var(--text-muted);
    padding: 18px;
}

.ui-empty-state strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 6px;
}

.ui-modal-title {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

/* content rating badge */
.content-rating-badge {
    margin-left: auto;
    font-size: 0.75em;
    border: 1px solid #555;
    padding: 1px 4px;
    border-radius: 3px;
    color: #ccc;
}

/* icon button variants */
.icon-btn-danger {
    color: #e74c3c;
    border-color: #e74c3c;
}

.icon-btn-small {
    font-size: 0.6em;
    font-weight: 900;
}

/* modal loading states */
.modal-loading {
    color: white;
    text-align: center;
    padding: 50px;
}

.modal-loading-light {
    text-align: center;
    padding: 50px;
    color: #ccc;
}

.modal-error {
    padding: 20px;
    color: var(--error);
}

/* provider logos */
.provider-logo {
    width: 40px;
    border-radius: 8px;
    margin: 5px 5px 0 0;
}

/* rating badge */
.rating-badge {
    background: var(--accent-color);
    color: black;
    padding: 2px 12px;
    border-radius: 10px;
    font-weight: bold;
}

/* preview list items */
.preview-list-item {
    text-align: center;
    padding: 20px;
}

.preview-list-item-loading {
    color: #777;
}

.preview-list-item-empty {
    color: #aaa;
}

.owned-badge {
    font-size: 0.8em;
    color: #2ecc71;
    font-weight: bold;
}

/* modal action buttons */
.modal-action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.modal-trailer-btn {
    margin-top: 10px;
    flex: 1;
    min-width: 120px;
}

/* media poster grid layout */
.media-poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.media-poster-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid rgba(10, 77, 34, 0.3);
}

.media-poster-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 204, 102, 0.2);
    border-color: var(--accent-color);
}

.media-poster-image-container {
    position: relative;
    width: 100%;
    padding-top: 150%;
    /* 2:3 aspect ratio for posters */
    background: #1a1a1a;
    overflow: hidden;
}

.media-poster-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-poster-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 3em;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.media-poster-info {
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
}

.media-poster-title {
    font-weight: 600;
    color: #fff;
    font-size: 0.95em;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.media-poster-status-bar {
    height: 3px;
    border-radius: 2px;
    margin-bottom: 8px;
}

/* monitored items get colored bars */
.media-poster-status-bar.monitored {
    background: var(--accent-color);
}

.media-poster-status-bar.monitored.has-file {
    background: #3498db;
    /* blue = monitored with file */
}

.media-poster-status-bar.monitored.missing-file {
    background: var(--accent-color);
    /* accent = monitored missing */
}

/* unmonitored items get gray bars */
.media-poster-status-bar.unmonitored {
    background: #666;
}

.media-poster-status-bar.unmonitored.has-file {
    background: #666;
    /* gray = unmonitored with file */
}

.media-poster-status-bar.unmonitored.missing-file {
    background: #666;
    /* gray = unmonitored missing */
}

/* fallback for single classes (backward compat) */
.media-poster-status-bar.has-file:not(.monitored):not(.unmonitored) {
    background: #00CC66;
}

.media-poster-status-bar.missing-file:not(.monitored):not(.unmonitored) {
    background: #e74c3c;
}

/* request status bars */
.media-poster-status-bar.status-pending {
    background: #f39c12;
    /* orange = pending */
}

.media-poster-status-bar.status-approved {
    background: #3498db;
    /* blue = approved */
}

.media-poster-status-bar.status-available {
    background: var(--accent-color);
    /* green = available */
}

.media-poster-status-bar.status-failed {
    background: #e74c3c;
    /* red = failed */
}

.media-poster-status-bar.status-unknown {
    background: #666;
    /* gray = unknown */
}

.media-poster-meta {
    font-size: 0.8em;
    color: #aaa;
    line-height: 1.6;
}

.media-poster-meta-item {
    margin-bottom: 4px;
}

.media-poster-actions {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.media-poster-action-btn {
    font-size: 0.75em;
    padding: 6px 10px;
    width: 100%;
    text-align: center;
}

.media-poster-card .action-btn {
    font-size: 0.75em;
    padding: 6px 10px;
}

/* trending days input (matches t-tab / btn-find-similar height and radius) */
.trending-days-input {
    width: 60px !important;
    height: var(--control-height) !important;
    min-height: var(--control-height) !important;
    padding: 0 8px !important;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--control-radius);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.85em;
    line-height: 1;
}

/* request modal stuff */
.request-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.request-modal-box {
    background: #202636;
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 204, 102, 0.3);
}

.request-modal-header {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.request-modal-banner {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.request-modal-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    padding: 20px;
    padding-top: 40px;
}

.request-modal-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.request-modal-title {
    color: #fff;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
}

.request-modal-status {
    display: flex;
    align-items: center;
    padding: 20px;
    margin: 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.request-status-content {
    flex: 1;
    text-align: center;
}

.request-status-text {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 1.05em;
    margin: 0;
}

.request-status-subtext {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
}

.request-modal-form {
    padding: 0 20px 20px;
}

.request-form-group {
    margin-bottom: 20px;
}

.request-form-label {
    display: block;
    color: #fff;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.request-form-select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.2s;
}

.request-form-select:hover {
    border-color: var(--accent-color);
}

.request-form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 204, 102, 0.2);
}

.request-modal-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.request-btn-cancel,
.request-btn-submit {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.request-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.request-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.request-btn-submit {
    background: var(--accent-color);
    color: #000000;
}

.request-btn-submit:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 93, 250, 0.4);
}

.request-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* calendar (releases from Radarr / Sonarr) */

.calendar-container {
    padding: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.calendar-header {
    margin-bottom: 20px;
}

.calendar-header h2 {
    margin: 0 0 8px 0;
}

.calendar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.calendar-view-toggle {
    display: flex;
    gap: 4px;
}

.calendar-btn {
    padding: 8px 14px;
    background: var(--input-bg);
    border: 1px solid #444;
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
}

.calendar-btn:hover {
    background: #222;
    border-color: var(--accent-color);
}

.calendar-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.calendar-btn-small {
    padding: 4px 10px;
    font-size: 0.85em;
    margin-left: 8px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-month-title {
    margin: 0;
    font-size: 1.25em;
    min-width: 180px;
    text-align: center;
}

/* legend: movies and TV status colors (same bar/class used on events) */
.calendar-legends {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 24px;
    margin-left: auto;
    font-size: 0.8em;
    color: var(--text-muted);
}

.calendar-legend-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
}

.legend-block-title {
    font-weight: 600;
    color: var(--text-color);
    width: 100%;
    margin-bottom: 2px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-right: 4px;
}

.legend-clickable {
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.legend-clickable:hover {
    background: rgba(255, 255, 255, 0.06);
}

.legend-clickable.legend-off {
    opacity: 0.45;
    text-decoration: line-through;
}

.legend-clickable.legend-off .legend-bar {
    opacity: 0.6;
}

.legend-bar {
    width: 4px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-helper {
    font-size: 0.85em;
    color: var(--text-muted);
    padding-right: 4px;
}

.calendar-status-downloaded_monitored .legend-bar {
    background: var(--accent-color);
}

.calendar-status-downloaded_unmonitored .legend-bar {
    background: #1abc9c;
}

.calendar-status-missing_monitored .legend-bar {
    background: #e74c3c;
}

.calendar-status-missing_unmonitored .legend-bar {
    background: #e67e22;
}

.calendar-status-unreleased .legend-bar {
    background: #5dade2;
}

.calendar-status-unaired .legend-bar {
    background: #9b59b6;
}

.calendar-status-downloaded .legend-bar {
    background: var(--accent-color);
}

.calendar-status-premiere .legend-bar {
    background: #f1c40f;
}

.calendar-status-missing .legend-bar {
    background: #e74c3c;
}

.calendar-status-unmonitored .legend-bar {
    background: #7f8c8d;
}

.calendar-status-on_air .legend-bar {
    background: #2ecc71;
}

.calendar-status-downloading .legend-bar {
    background: #00acc1;
}

.calendar-view-wrap,
.calendar-list-wrap {
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px;
}

/* keep calendar inside the card (no overflow outside) */
.calendar-view-wrap {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* minmax(0, 1fr) so columns shrink and stay in view instead of pushing content out */
.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
}

.calendar-weekday {
    padding: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85em;
    color: var(--text-muted);
}

.calendar-grid-body {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(90px, auto));
    gap: 2px;
}

.calendar-day {
    min-height: 90px;
    min-width: 0;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid transparent;
    overflow: hidden;
}

.calendar-day-other {
    background: transparent;
    opacity: 0.4;
}

.calendar-day-num {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.calendar-event-pill {
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-left: 3px solid transparent;
    max-width: 100%;
}

/* movie status colors (bar on left = main indicator) */
.calendar-status-downloaded_monitored {
    background: rgba(0, 204, 102, 0.2);
    border-left-color: var(--accent-color);
    color: #b8f0d4;
}

.calendar-status-downloaded_unmonitored {
    background: rgba(22, 160, 133, 0.15);
    border-left-color: #1abc9c;
    color: #7fddce;
}

/* legend uses .legend-bar for the bar - avoid double line from border on the legend item */
.legend-item.calendar-status-downloaded_unmonitored {
    border-left: none;
}

.calendar-status-missing_monitored {
    background: rgba(231, 76, 60, 0.15);
    border-left-color: #e74c3c;
    color: #f0b8b8;
}

.calendar-status-missing_unmonitored {
    background: rgba(230, 126, 34, 0.15);
    border-left-color: #e67e22;
    color: #f0d4b8;
}

.calendar-status-unreleased {
    background: rgba(52, 152, 219, 0.15);
    border-left-color: #5dade2;
    color: #a8d4f0;
}

/* TV status colors */
.calendar-status-unaired {
    background: rgba(155, 89, 182, 0.15);
    border-left-color: #9b59b6;
    color: #d4b8e8;
}

.calendar-status-downloaded {
    background: rgba(46, 204, 113, 0.2);
    border-left-color: #2ecc71;
    color: #a8e6c4;
}

.calendar-status-premiere {
    background: rgba(241, 196, 15, 0.2);
    border-left-color: #f1c40f;
    color: #f0e8b8;
}

.calendar-status-missing {
    background: rgba(192, 57, 43, 0.2);
    border-left-color: #c0392b;
    color: #e8b8b8;
}

.calendar-status-unmonitored {
    background: rgba(127, 140, 141, 0.2);
    border-left-color: #7f8c8d;
    color: #b8c4c4;
}

.calendar-status-on_air {
    background: rgba(39, 174, 96, 0.2);
    border-left-color: #27ae60;
    color: #a8e6c4;
}

.calendar-status-downloading {
    background: rgba(0, 172, 193, 0.2);
    border-left-color: #00acc1;
    color: #b2ebf2;
}

/* list view uses same status classes */
.calendar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.calendar-list-item {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 4px solid transparent;
}

.calendar-list-date {
    display: inline-block;
    width: 100px;
    color: var(--text-muted);
    font-size: 0.9em;
}

.calendar-list-title {
    font-weight: 600;
}

.calendar-list-sub {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-left: 8px;
}

.calendar-loading,
.calendar-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* clickable calendar events (open detail modal) */
.calendar-event-clickable {
    cursor: pointer;
}

.calendar-event-clickable:hover {
    filter: brightness(1.1);
}

/* calendar detail modal (click event = details + search) */
.calendar-detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.calendar-detail-box {
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 8px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calendar-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #333;
}

.calendar-detail-title {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-color);
}

.calendar-detail-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.calendar-detail-close:hover {
    color: var(--text-color);
}

.calendar-detail-tabs {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    border-bottom: 1px solid #333;
}

.calendar-detail-tab {
    padding: 10px 14px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95em;
}

.calendar-detail-tab:hover {
    color: var(--text-color);
}

.calendar-detail-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.calendar-detail-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
}

.calendar-detail-loading {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

.calendar-detail-tab-pane {
    font-size: 0.95em;
}

.calendar-detail-section {
    margin-bottom: 14px;
}

.calendar-detail-section strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.85em;
}

.calendar-detail-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.9em;
}

.calendar-detail-overview {
    margin: 0 0 8px 0;
    line-height: 1.5;
    color: var(--text-color);
}

.calendar-detail-file {
    margin-top: 4px;
    font-size: 0.9em;
    color: var(--text-muted);
    word-break: break-all;
}

.calendar-detail-file-path {
    margin-bottom: 4px;
}

.calendar-detail-file-meta {
    font-size: 0.85em;
    opacity: 0.9;
}

.calendar-detail-history-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    font-size: 0.9em;
}

.calendar-detail-history-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.calendar-detail-history-list li:last-child {
    border-bottom: none;
}

.calendar-detail-history-date {
    display: inline-block;
    width: 140px;
    color: var(--text-muted);
    font-size: 0.9em;
}

.calendar-detail-history-path {
    display: block;
    margin-top: 2px;
    font-size: 0.85em;
    color: var(--text-muted);
    word-break: break-all;
}

.calendar-detail-history-meta {
    font-size: 0.85em;
    color: var(--text-muted);
}

.calendar-search-results {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-search-results-title {
    margin-bottom: 8px;
    font-size: 0.95em;
}

.calendar-search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 280px;
    overflow-y: auto;
    font-size: 0.9em;
}

.calendar-search-result-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.calendar-search-result-item:last-child {
    border-bottom: none;
}

.calendar-search-result-title {
    display: block;
    word-break: break-word;
}

.calendar-search-result-meta {
    display: block;
    margin-top: 2px;
    font-size: 0.85em;
    color: var(--text-muted);
}

.calendar-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: #444;
}

.calendar-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.calendar-detail-search-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-detail-footer {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid #333;
}

.calendar-detail-footer .calendar-btn:first-child {
    margin-right: auto;
}

/* System Health Bar (Compact) */
.system-health-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 10px auto 20px auto;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: fit-content;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75em;
    white-space: nowrap;
}

.health-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.health-label {
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}

.health-status {
    color: #888;
}

.status-online {
    background: #00CC66;
    box-shadow: 0 0 5px #00CC66;
}

.status-offline {
    background: #ef4444;
    box-shadow: 0 0 5px #ef4444;
}

.status-unknown {
    background: #555;
}

/* Media Poster Grid */
.media-poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.media-poster-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.media-poster-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.media-poster-image-container {
    position: relative;
    width: 100%;
    padding-top: 150%;
    background: #1a1a1a;
    overflow: hidden;
}

.media-poster-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-poster-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.media-poster-info {
    padding: 10px;
}

.media-poster-title {
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    min-height: 2.6em;
}

.media-poster-status-bar {
    height: 3px;
    border-radius: 2px;
    margin-bottom: 8px;
}

.media-poster-meta {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
}

.media-poster-meta-item {
    font-size: 0.75em;
    color: #888;
}

.media-poster-grid-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
}
