/* ==========================================================================
   TV SLIDE SHOW PRO - STYLING SHEET (VANILLA MODERN CSS)
   Theme: Futuristic Cyberpunk / Premium Space Dark Mode
   ========================================================================== */

/* 1. INITIAL SETUP & DESIGN TOKENS */
:root {
    /* Color Palette */
    --color-bg-deep: #06070a;
    --color-bg-dark: #0d0f15;
    --color-bg-card: rgba(18, 22, 33, 0.7);
    --color-bg-card-hover: rgba(26, 32, 48, 0.85);
    
    --accent-cyan: #00f2fe;
    --accent-purple: #7f00ff;
    --accent-pink: #ff007f;
    --accent-indigo: #4f46e5;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Gradients */
    --grad-primary: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-cyan) 100%);
    --grad-dark: linear-gradient(180deg, #111319 0%, #07080c 100%);
    --grad-glow: linear-gradient(90deg, var(--accent-purple), var(--accent-pink), var(--accent-cyan));
    
    /* Shadows & Borders */
    --shadow-neon-cyan: 0 0 15px rgba(0, 242, 254, 0.4);
    --shadow-neon-purple: 0 0 15px rgba(127, 0, 255, 0.4);
    --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --border-glass: 1px solid rgba(255, 255, 255, 0.08);
    --border-glow: 1px solid rgba(0, 242, 254, 0.3);
    
    /* Typography & Transitions */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Transition Speed for Slide Show */
    --transition-duration-slide: 800ms;
}

/* Global Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

/* Focus style for TV Remote compatibility */
.tv-focusable {
    outline: none;
    transition: all var(--transition-fast);
}

.tv-focusable:focus-visible, 
.tv-focusable.tv-focused {
    outline: none;
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--color-bg-deep), 0 0 0 5px var(--accent-cyan), var(--shadow-neon-cyan);
    border-color: var(--accent-cyan) !important;
    z-index: 10;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}

.animate-zoom {
    animation: zoomIn var(--transition-normal);
}

.text-danger { color: var(--danger) !important; }
.border-danger { border-color: rgba(239, 68, 68, 0.3) !important; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.flex-1 { flex: 1; }

/* 2. SPA VIEW CONTAINER & TOASTS */
#app-root {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.app-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    z-index: 1;
    overflow: hidden;
}

.app-view.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    background: rgba(18, 22, 33, 0.9);
    backdrop-filter: blur(12px);
    border: var(--border-glass);
    border-left: 4px solid var(--accent-cyan);
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 450px;
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: slideInRight var(--transition-normal);
    transition: all var(--transition-normal);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

.toast-msg {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.toast-close:hover {
    color: #fff;
}

/* 3. SLIDESHOW VIEWER (TV aspect ratios & scale) */
#app-viewer {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 1920x1080 coordinates absolute grid */
.aspect-16-9-box {
    width: 1920px;
    height: 1080px;
    position: relative;
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 100px rgba(0,0,0,0.8);
    transform-origin: center center;
}

/* Dual layers setup */
.slides-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Keeps original ratio without distortion */
    z-index: 2;
}

/* Blurred backdrop effect to fill blank spaces elegantly */
.slide-blur-backdrop {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.3) saturate(1.2);
    opacity: 0.8;
    z-index: 0;
    transition: background-image var(--transition-slow);
}

/* TV clock widget top right */
.top-widget-bar {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 10;
}

.weather-clock-widget {
    background: rgba(8, 10, 16, 0.5);
    backdrop-filter: blur(12px);
    border: var(--border-glass);
    border-radius: 40px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.widget-date {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.widget-separator {
    color: rgba(255, 255, 255, 0.2);
}

.widget-time {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-heading);
}

/* Slide Text Overlay Bottom Left */
.slide-info-overlay {
    position: absolute;
    bottom: 50px;
    left: 50px;
    max-width: 800px;
    z-index: 10;
    transform: translateY(0);
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.info-content-glass {
    background: rgba(8, 10, 16, 0.6);
    backdrop-filter: blur(20px);
    border: var(--border-glass);
    border-left: 5px solid var(--accent-cyan);
    border-radius: 16px;
    padding: 24px 32px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.slide-title {
    font-size: 2.2rem;
    line-height: 1.25;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #ffffff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.slide-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Empty State Viewer */
.viewer-empty-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: var(--color-bg-deep);
}

.empty-content-glass {
    background: rgba(18, 22, 33, 0.7);
    backdrop-filter: blur(25px);
    border: var(--border-glass);
    border-radius: 24px;
    padding: 60px 80px;
    text-align: center;
    box-shadow: var(--shadow-premium);
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.empty-icon {
    color: var(--accent-cyan);
}

.empty-content-glass h2 {
    font-size: 2rem;
}

.empty-content-glass p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* TV Controller overlay bottom */
.viewer-control-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(0deg, rgba(5,6,10,0.95) 0%, rgba(5,6,10,0.6) 80%, rgba(5,6,10,0) 100%);
    backdrop-filter: blur(10px);
    z-index: 100;
    padding: 20px 50px 30px;
    transform: translateY(0);
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.viewer-control-bar.autohide {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Progress bar inside controls */
.slide-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.slide-progress-fill {
    height: 100%;
    width: 0;
    background: var(--grad-glow);
    border-radius: 3px;
    box-shadow: var(--shadow-neon-cyan);
}

.control-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.control-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    background: var(--grad-primary);
    color: #fff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-neon-purple);
}

.slide-status-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.control-center {
    display: flex;
    align-items: center;
    gap: 20px;
}

.control-right {
    display: flex;
    align-items: center;
}

/* Premium Buttons Styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: var(--shadow-neon-purple);
}

.btn-primary:hover {
    box-shadow: 0 0 25px rgba(127, 0, 255, 0.7);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255,255,255,0.2);
}

.btn-accent {
    background: var(--accent-cyan);
    color: var(--color-bg-deep);
    box-shadow: var(--shadow-neon-cyan);
}

.btn-accent:hover {
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.7);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fff;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
}

.btn-full {
    width: 100%;
}

/* ==========================================================================
   4. SLIDE TRANSITIONS ENGINE
   ========================================================================== */

/* Triggers in JS */
.trans-enter-active {
    animation-duration: var(--transition-duration-slide) !important;
    animation-fill-mode: both !important;
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.trans-exit-active {
    animation-duration: var(--transition-duration-slide) !important;
    animation-fill-mode: both !important;
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* --- A. Fade Effect --- */
.fade-enter {
    animation-name: fadeIn;
}
.fade-exit {
    animation-name: fadeOut;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* --- B. Slide Left --- */
.slide-left-enter {
    animation-name: slideLeftIn;
}
.slide-left-exit {
    animation-name: slideLeftOut;
}

@keyframes slideLeftIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
@keyframes slideLeftOut {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* --- C. Slide Right --- */
.slide-right-enter {
    animation-name: slideRightIn;
}
.slide-right-exit {
    animation-name: slideRightOut;
}

@keyframes slideRightIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}
@keyframes slideRightOut {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

/* --- D. Slide Up --- */
.slide-up-enter {
    animation-name: slideUpIn;
}
.slide-up-exit {
    animation-name: slideUpOut;
}

@keyframes slideUpIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes slideUpOut {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

/* --- E. Zoom Effect --- */
.zoom-enter {
    animation-name: zoomInEffect;
}
.zoom-exit {
    animation-name: zoomOutEffect;
}

@keyframes zoomInEffect {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes zoomOutEffect {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.15); }
}

/* --- F. Flip 3D (Y-axis) --- */
.flip-enter {
    animation-name: flipIn;
    backface-visibility: hidden;
}
.flip-exit {
    animation-name: flipOut;
    backface-visibility: hidden;
}

@keyframes flipIn {
    from { opacity: 0; transform: perspective(2000px) rotateY(90deg); }
    to { opacity: 1; transform: perspective(2000px) rotateY(0deg); }
}
@keyframes flipOut {
    from { opacity: 1; transform: perspective(2000px) rotateY(0deg); }
    to { opacity: 0; transform: perspective(2000px) rotateY(-90deg); }
}

/* --- G. Rotate & Scale --- */
.rotate-enter {
    animation-name: rotateIn;
}
.rotate-exit {
    animation-name: rotateOut;
}

@keyframes rotateIn {
    from { opacity: 0; transform: rotate(-10deg) scale(0.9); }
    to { opacity: 1; transform: rotate(0deg) scale(1); }
}
@keyframes rotateOut {
    from { opacity: 1; transform: rotate(0deg) scale(1); }
    to { opacity: 0; transform: rotate(10deg) scale(1.1); }
}

/* ==========================================================================
   5. ADMIN LOGIN SCREEN & KEYPAD
   ========================================================================== */
#app-login {
    background: var(--grad-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.glass-panel {
    background: var(--color-bg-card);
    backdrop-filter: blur(20px);
    border: var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-premium);
    overflow: hidden;
}

.login-card {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    border-top: 3px solid var(--accent-cyan);
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.1);
    padding: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    background: rgba(0, 0, 0, 0.3);
    border: var(--border-glass);
    border-radius: 10px;
    padding: 12px 18px;
    color: #fff;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--accent-cyan);
    background: rgba(0,0,0,0.5);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.password-field-group {
    position: relative;
}

.password-field-group .form-control {
    padding-right: 50px;
    letter-spacing: 0.3em;
    font-size: 1.4rem;
    text-align: center;
}

.btn-toggle-pwd {
    position: absolute;
    right: 15px;
    bottom: 11px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 4px;
}

.btn-toggle-pwd:focus-visible {
    color: var(--accent-cyan);
}

/* TV Virtual Keypad layout */
.virtual-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.keypad-btn {
    background: rgba(255, 255, 255, 0.05);
    border: var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    font-size: 1.4rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.keypad-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.keypad-btn.danger-btn {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.keypad-btn.danger-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.keypad-btn.success-btn {
    color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.08);
}

.keypad-btn.success-btn:hover {
    background: rgba(0, 242, 254, 0.2);
}

.login-actions {
    display: flex;
    gap: 15px;
}

.login-actions button {
    flex: 1;
    padding: 14px;
    font-size: 1.05rem;
}

/* ==========================================================================
   6. ADMIN DASHBOARD LAYOUT & SIDENAV
   ========================================================================== */
#app-admin {
    background: var(--color-bg-deep);
}

.admin-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar Styling */
.admin-sidebar {
    width: 320px;
    height: 100%;
    border-right: var(--border-glass);
    display: flex;
    flex-direction: column;
    border-radius: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: var(--border-glass);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.brand-accent {
    color: var(--accent-cyan);
}

.sidebar-nav {
    padding: 30px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,0.03);
}

.nav-item.active {
    color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.08);
    border-left: 3px solid var(--accent-cyan);
    border-radius: 0 10px 10px 0;
    padding-left: 17px;
}

.sidebar-footer {
    padding: 30px 20px;
    border-top: var(--border-glass);
}

/* Content Area */
.admin-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background: var(--grad-dark);
    padding: 50px;
}

.admin-panel {
    display: none;
    flex-direction: column;
    gap: 40px;
    animation: fadeIn var(--transition-normal);
}

.admin-panel.active {
    display: flex;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: var(--border-glass);
    padding-bottom: 25px;
}

.panel-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.panel-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Slide Cards Grid in Admin */
.slides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.slide-card {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: var(--border-glass);
    background: var(--color-bg-card);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.slide-card:hover {
    transform: translateY(-8px);
    background: var(--color-bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-premium);
}

.slide-card.tv-focused {
    transform: scale(1.03) translateY(-4px);
    box-shadow: 0 0 0 2px var(--color-bg-deep), 0 0 0 5px var(--accent-cyan), var(--shadow-neon-cyan);
    border-color: var(--accent-cyan);
}

.card-thumbnail-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: #000;
    border-bottom: var(--border-glass);
}

.card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-order-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent-cyan);
    color: var(--color-bg-deep);
    font-weight: 800;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    box-shadow: var(--shadow-neon-cyan);
}

.card-duration-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    border: var(--border-glass);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 38px;
}

.card-transition-tag {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
    border: var(--border-glass);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

/* Slide Card Actions (TV-focused remote keys) */
.card-actions {
    display: flex;
    border-top: var(--border-glass);
    background: rgba(0,0,0,0.15);
}

.card-btn {
    flex: 1;
    background: none;
    border: none;
    border-right: var(--border-glass);
    padding: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.card-btn:last-child {
    border-right: none;
}

.card-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.card-btn:focus-visible {
    outline: none;
    color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.08);
}

.card-btn-delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

/* System Settings Layout */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.settings-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-card h3 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: var(--border-glass);
    padding-bottom: 12px;
}

.settings-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.backup-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.admin-empty-state {
    padding: 80px 20px;
    text-align: center;
    border: 2px dashed rgba(255,255,255,0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-admin-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 400px;
    color: var(--text-muted);
}

.empty-admin-content h3 {
    color: var(--text-secondary);
}

/* ==========================================================================
   7. MODAL DIALOG POPUPS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 5, 8, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-normal);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    width: 100%;
    max-width: 850px;
    border-top: 3px solid var(--accent-purple);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    overflow: hidden;
}

.modal-header {
    padding: 25px 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: var(--border-glass);
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
}

#slide-form {
    padding: 35px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 35px;
}

/* Drag and Drop area */
.upload-drop-zone {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 2px dashed rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    background: rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.upload-drop-zone:hover, .upload-drop-zone.dragover {
    border-color: var(--accent-cyan);
    background: rgba(0, 242, 254, 0.04);
}

.upload-drop-zone:focus-visible {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    pointer-events: none;
    padding: 20px;
}

.upload-prompt svg {
    color: var(--text-secondary);
}

.upload-prompt .primary-text {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.upload-prompt .secondary-text {
    font-size: 0.8rem;
}

.upload-preview-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

#upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    opacity: 0;
    transition: opacity var(--transition-fast);
    font-family: var(--font-heading);
}

.upload-drop-zone:hover .upload-preview-overlay {
    opacity: 1;
}

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 6px;
    display: none;
}

.form-error.active {
    display: block;
}

/* Modal Form Inputs */
.form-row {
    display: flex;
    gap: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-actions button {
    padding: 12px 28px;
}

/* Scrollbar customization for futuristic dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes slideInRight {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
