:root {
    /* Colors */
    --bg-dark: #111827;
    --bg-panel: #1f2937;
    --bg-panel-transparent: rgba(31, 41, 55, 0.95);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #10b981;
    --accent-hover: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --border-light: rgba(255, 255, 255, 0.1);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-dark);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    background-image: url('../images/bg.jpg');
    background-attachment: fixed;
    background-repeat: repeat-x;
    background-size: auto 100%;
}

/* Force override jQuery UI fonts */
.ui-widget,
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

/* Fix Autocomplete Background */
.ui-autocomplete {
    background: #ffffff !important;
    border: 1px solid #ccc !important;
    z-index: 9999 !important;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    color: #333 !important;
}

.ui-menu-item .ui-menu-item-wrapper {
    padding: 5px 10px !important;
}

.ui-menu-item .ui-menu-item-wrapper.ui-state-active {
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
}

#mastercontainer {
    width: 100%;
    display: flex;
}

#maincontainer {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding-right: 20px;
    /* Add some padding on the right */
}

#menu {
    position: fixed;
    width: 225px;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    background-color: transparent;
}

/* Sticky tabs on home page */
#tabs .ui-tabs-nav {
    position: sticky;
    top: 55px;
    /* Height of the sticky header? Or is the header sticky? Wait, the menu is fixed. */
    /* Actually, the main content scrolls. If we want it sticky relative to the viewport top, it depends on other sticky elements. */
    /* The user mentions the "tabpanel behind the tabs". This means the tabs are likely already sticky or fixed, but transparent? */
    /* Checks style.css line 63: It IS sticky. */
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-panel) !important;
    /* Match body/dark theme background */
    border-bottom: 1px solid var(--border-color);
    padding-top: 10px;
}

.link {
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.9em;
}

.link:hover {
    background-color: #eee;
}

.movie-table {
    width: 100%;
    border-collapse: collapse;
}

.movie-table td {
    padding: 10px;
    vertical-align: top;
}

.movie-description-cell {
    width: 100%;
}



h2,
h3 {
    margin: 0;
    color: white;
    font-weight: 600;
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 5px 15px;
    margin-bottom: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Accordion menu tightening */
#menu .ui-accordion-header {
    padding: 4px 10px 4px 30px !important;
    font-size: 0.9em;
    margin-top: 1px !important;
}

#menu .ui-accordion-content {
    padding: 5px 10px !important;
}

#menu hr {
    margin: 5px 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* ── Modern Toast Notifications ── */
#notification-area {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(17, 24, 39, 0.95);
    color: #f3f4f6;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
    border-left: 4px solid #6b7280;
    min-width: 280px;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    cursor: default;
    font-size: 0.9em;
    line-height: 1.4;
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* Type Accents */
.toast.success {
    border-left-color: var(--accent);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--primary);
}

/* Icon */
.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15em;
    margin-top: 1px;
}

.toast.success .toast-icon {
    color: var(--accent);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.info .toast-icon {
    color: #60a5fa;
}

/* Body */
.toast-body {
    flex: 1;
    min-width: 0;
    padding-right: 20px;
    word-wrap: break-word;
}

/* Close Button */
.toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.1em;
    cursor: pointer;
    padding: 2px 5px;
    line-height: 1;
    transition: color 0.15s;
}

.toast-close:hover {
    color: #f3f4f6;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0 10px;
    background: #6b7280;
    width: 100%;
    transform-origin: left;
}

.toast.success .toast-progress {
    background: #10b981;
}

.toast.error .toast-progress {
    background: #ef4444;
}

.toast.info .toast-progress {
    background: #60a5fa;
}

/* Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
        max-height: 120px;
        margin-bottom: 0;
    }

    to {
        opacity: 0;
        transform: translateX(40px);
        max-height: 0;
        margin-bottom: -10px;
        padding-top: 0;
        padding-bottom: 0;
        border-width: 0;
    }
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* ── Empty States ── */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    margin: 20px 0;
}

.empty-state .empty-icon {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: var(--primary);
    opacity: 0.8;
    background: rgba(59, 130, 246, 0.1);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.empty-state h3 {
    color: #d1d5db;
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 0.95em;
    margin: 0 0 20px 0;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.empty-state .empty-cta {
    display: inline-block;
    padding: 10px 22px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: background 0.2s, transform 0.15s;
    text-decoration: none;
}

.empty-state .empty-cta:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* ── Movie Row Have/Want Indicators ── */
tr.movie-row-have {
    border-right: 4px solid var(--accent) !important;
}

tr.movie-row-want {
    border-right: 4px solid var(--warning) !important;
}

/* Skeleton Loading States */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
}

.skeleton-container {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.skeleton-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
}

.skeleton-img {
    width: 100px;
    height: 150px;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.skeleton-text {
    height: 16px;
    width: 100%;
}

/* Modern Dialogs */
.ui-dialog,
.ui-dialog.ui-widget-content {
    background-color: #1f2937 !important;
    background-image: none !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
    padding: 0 !important;
    overflow: hidden !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

/* Target both specific class and generic widget header to override theme */
.ui-dialog-titlebar,
.ui-dialog .ui-widget-header {
    background: transparent !important;
    background-image: none !important;
    /* Critical for jQuery UI themes */
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    border-radius: 0 !important;
    padding: 8px 15px !important;
    font-weight: normal !important;
    /* Reset generic bolding */
}

.ui-dialog-title {
    font-weight: 600 !important;
    font-size: 1.1em !important;
}

.ui-dialog-titlebar-close {
    border: none !important;
    background: transparent !important;
    margin: -10px 0 0 0 !important;
    top: 50% !important;
    right: 15px !important;
}

.ui-dialog-titlebar-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px !important;
}

/* Ensure body content is dark and overrides widget-content */
.ui-dialog-content,
.ui-dialog .ui-widget-content {
    background-color: #1f2937 !important;
    background-image: none !important;
    color: #e5e7eb !important;
    padding: 20px !important;
}

.ui-dialog-buttonpane {
    background-color: #111827 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 10px 20px !important;
    margin: 0 !important;
}

/* Dialog Buttons - Light Grey with Dark Border & Black Text */
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button {
    background-color: #f3f4f6 !important;
    /* Light grey */
    color: #111827 !important;
    /* Black/Dark text */
    border: 1px solid #4b5563 !important;
    /* Dark grey border */
    border-radius: 4px !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
}

.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button:hover {
    background-color: #e5e7eb !important;
    /* Slightly darker grey on hover */
    border-color: #374151 !important;
    /* Darker border on hover */
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Blur Backdrop */
.ui-widget-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    opacity: 1 !important;
}

/* Modern Tabs (Dark Theme) */
.ui-tabs {
    background: transparent !important;
    border: none !important;
    color: white !important;
}

.ui-tabs .ui-tabs-nav {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 0 !important;
}

.ui-tabs .ui-tabs-nav li {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-bottom: none !important;
    margin-right: 5px !important;
    border-radius: 4px 4px 0 0 !important;
}

.ui-tabs .ui-tabs-nav li.ui-tabs-active {
    background: #374151 !important;
    border-color: #4b5563 !important;
    border-bottom: 1px solid #374151 !important;
    /* Match panel bg to hide border */
    padding-bottom: 1px !important;
}

.ui-tabs .ui-tabs-nav li a {
    color: #9ca3af !important;
    font-weight: 500 !important;
}

.ui-tabs .ui-tabs-nav li.ui-tabs-active a {
    color: white !important;
    font-weight: 600 !important;
}

.ui-tabs .ui-tabs-panel {
    background: transparent !important;
    border: none !important;
    color: white !important;
    padding: 15px 0 !important;
}

/* Explicitly override the default jQuery UI theme for the header inside dialogs */
.ui-dialog .ui-widget-header {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

/* Interactive Sidebar */
#sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    background-color: var(--bg-panel);
    color: var(--text-main);
    overflow-y: auto;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.nav-group {
    margin-bottom: 20px;
}

.nav-header {
    padding: 0 20px 10px;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.nav-item.active {
    background-color: rgba(237, 28, 36, 0.15) !important;
    border-left-color: #ed1c24 !important;
    color: #ed1c24 !important;
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Meatball Menu Styles */
.action-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 200;
}

.meatball-trigger {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2em;
    padding: 5px 10px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    transition: all 0.2s;
}

.meatball-trigger:hover {
    background: rgba(0, 0, 0, 0.6);
    color: white;
}

.meatball-trigger.active {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.button-stack {
    display: none;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    border-top-right-radius: 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    padding: 5px;
    min-width: 150px;
    flex-direction: column;
    gap: 5px;
}

.button-stack.active {
    display: flex;
}

/* Override existing button stack styles if necessary */
.button-stack button {
    width: 100%;
    text-align: left;
    margin: 0 !important;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-main);
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.9em;
}

.button-stack button:hover {
    background-color: var(--border-color);
    color: white;
}

.button-stack .admin-btn {
    background-color: var(--warning);
    border-color: var(--warning-hover);
    color: var(--bg-dark);
}

.button-stack .admin-btn:hover {
    background-color: var(--warning-hover);
}

.button-stack .request-btn {
    background-color: var(--accent);
    border-color: var(--accent-hover);
    color: white;
}

.button-stack .request-btn:hover {
    background-color: var(--accent-hover);
}

.picker-image-container .picker-img {
    display: block;
    width: 100%;
    height: auto;
}

.image-dimensions-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.85em;
    padding: 6px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.picker-image-container:hover .image-dimensions-overlay {
    opacity: 1;
}

/* Image Picker Layout Fixes */
#picker-tabs .ui-tabs-nav {
    margin: 0 !important;
    padding: 0 !important;
}

#image-picker-modal,
#image-picker-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Mobile Responsiveness ── */
#mobile-menu-toggle {
    display: none;
    /* Hidden on desktop */
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1002;
    background: rgba(31, 41, 55, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    #mobile-menu-toggle {
        display: block;
    }

    #menu {
        position: fixed;
        left: 0;
        top: 60px;
        /* Adjusted to sit below the hamburger button */
        bottom: 0;
        width: 260px;
        /* Slightly wider for touch */
        z-index: 1001;
        background-color: rgba(31, 41, 55, 0.7) !important;
        /* More transparent */
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        display: block !important;
        /* Force display to ensure it's not hidden by accordion or other scripts */
    }

    #menu.mobile-visible {
        transform: translateX(0);
    }

    #maincontainer {
        margin-left: 0 !important;
        /* Override inline style */
        padding-top: 60px;
        /* Space for toggle */
        padding-left: 15px;
        padding-right: 15px;
        width: 100% !important;
    }
}

/* ── Librarian Loading Placeholder ── */
.librarian-loader-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.librarian-loader-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.librarian-owl-img {
    width: 200px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
    animation: librarian-float 3s infinite ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.05);
    mix-blend-mode: screen;
    /* Treats black as transparent */
}

.librarian-loader-text {
    margin-top: 20px;
    color: #f3f4f6;
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.librarian-loader-subtext {
    margin-top: 8px;
    color: var(--text-main);
    opacity: 0.9;
    font-size: 0.95em;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Pulsing progress glow for the orb */
.librarian-orb-glow {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.6) 0%, rgba(59, 130, 246, 0) 70%);
    border-radius: 50%;
    /* Position adjusted to roughly where the orb is in the 3D render */
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orb-pulse 2s infinite ease-in-out;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: screen;
}

@keyframes librarian-float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(1deg);
    }
}

@keyframes orb-pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0.7;
    }
}

/* ── Modern Button System ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.95em;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.2;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: white;
    transform: translateY(-1px);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-icon {
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

/* ── Modern Forms ── */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
select,
textarea {
    background-color: rgba(17, 24, 39, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95em;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background-color: rgba(17, 24, 39, 0.9);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Checkbox/Radio */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
}

.library-filter-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    background-color: var(--bg-dark);
    /* Ensure background is opaque so content doesn't show through */
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
}

.library-filter-input {
    flex: 3;
    /* Take up more space */
    min-width: 200px;
}

.library-filter-select {
    flex: 1;
    width: auto;
    /* Allow it to shrink/grow but default to content width */
    min-width: 120px;
    min-width: 120px;
    max-width: 200px;
}

/* ── Unified Form & Action Elements ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: normal;
}

.btn:focus-visible {
    outline: 2px solid var(--text-main);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border-color: #dc2626;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--accent);
    color: white;
}

.btn-success:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--border-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
}

.btn-icon-only {
    padding: 8px 12px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #111;
    font-family: inherit;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Page Specific Overrides */
.admin-movie-list-header {
    color: #222 !important;
}

/* ── Login Page Overrides ── */
.login-wallpaper-layer {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: brightness(0.4) blur(1px);
    opacity: 0;
    z-index: -1;
    transition: opacity 2s ease-in-out;
}

.login-wallpaper-layer.active {
    opacity: 0.8;
}

.login-default-bg {
    background: url('../images/bg.jpg');
    background-attachment: fixed;
    background-repeat: repeat-x;
    background-size: auto 100%;
    filter: brightness(0.4) blur(1px);
    opacity: 0.8;
}

#logincontainer {
    width: 400px;
    margin: 100px auto;
    background: rgba(255, 255, 255, 0.5);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(204, 204, 204, 0.8);
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

#logincontainer h1 {
    margin-top: 0;
    color: #333;
}

.password-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.password-container input {
    width: 100% !important;
    margin: 8px 0 !important;
    box-sizing: border-box;
    padding-right: 40px !important;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    z-index: 10;
    font-size: 16px;
    user-select: none;
    display: flex;
    align-items: center;
}

.toggle-password:hover {
    color: #333;
}

/* ── Error Page Overrides ── */
.error-page-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-page-card {
    max-width: 600px;
    width: 100%;
    text-align: center;
    background: rgba(31, 41, 55, 0.82);
    padding: 50px 40px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7);
}

.error-graphic-404 {
    width: 250px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    mix-blend-mode: screen;
    animation: float 3s ease-in-out infinite;
}

.error-graphic-500 {
    width: 250px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    mix-blend-mode: screen;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}

/* ── Search Filter Bar ── */
.search-filter-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    background-color: var(--bg-dark);
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin: -10px -10px 10px -10px;
    /* Offset parent padding */
}

/* Responsive Notifications */
@media (max-width: 600px) {
    #notification-area {
        top: auto;
        bottom: 20px;
        right: 15px;
        left: 15px;
        max-width: none;
        width: auto;
    }

    .toast {
        min-width: 0;
    }
}