/* ========================================
   VideoHost — Multi-Theme & Unique Login UI
   ======================================== */

/* ---- CSS Themes & Design Tokens ---- */
:root,
html[data-theme="cinematic"] {
    /* 1. Cinematic Gold & Obsidian (Default) */
    --bg-deep: #060609;
    --bg-primary: #0a0a10;
    --bg-card: rgba(16, 16, 26, 0.78);
    --bg-card-hover: rgba(26, 26, 42, 0.9);
    --bg-elevated: #151522;
    --bg-input: rgba(12, 12, 20, 0.85);

    --accent-gold: #e5b85a;
    --accent-gold-bright: #f5cf7b;
    --accent-gold-dim: #b88d3e;
    --accent-gold-glow: rgba(229, 184, 90, 0.18);
    --accent-gold-glow-strong: rgba(229, 184, 90, 0.38);
    --accent-warm: #c48b3b;

    --text-primary: #f0ecf6;
    --text-secondary: #9a94a6;
    --text-muted: #625c70;

    --danger: #e05252;
    --success: #34d399;

    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-accent: rgba(229, 184, 90, 0.25);
    --border-glass: rgba(255, 255, 255, 0.12);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 40px rgba(229, 184, 90, 0.15);

    --font-display: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 2. Cyberpunk Neon Theme */
html[data-theme="cyberpunk"] {
    --bg-deep: #05050d;
    --bg-primary: #090916;
    --bg-card: rgba(18, 14, 34, 0.82);
    --bg-card-hover: rgba(28, 20, 52, 0.92);
    --bg-elevated: #16102a;
    --bg-input: rgba(10, 8, 20, 0.9);

    --accent-gold: #00f0ff;
    --accent-gold-bright: #38bdf8;
    --accent-gold-dim: #0284c7;
    --accent-gold-glow: rgba(0, 240, 255, 0.22);
    --accent-gold-glow-strong: rgba(0, 240, 255, 0.45);
    --accent-warm: #ff007f;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-subtle: rgba(0, 240, 255, 0.1);
    --border-accent: rgba(0, 240, 255, 0.35);
    --shadow-glow: 0 0 40px rgba(0, 240, 255, 0.2);
}

/* 3. Emerald Luxury Theme */
html[data-theme="emerald"] {
    --bg-deep: #030806;
    --bg-primary: #06120b;
    --bg-card: rgba(10, 26, 18, 0.82);
    --bg-card-hover: rgba(16, 40, 28, 0.92);
    --bg-elevated: #0f2419;
    --bg-input: rgba(6, 16, 11, 0.9);

    --accent-gold: #10b981;
    --accent-gold-bright: #34d399;
    --accent-gold-dim: #059669;
    --accent-gold-glow: rgba(16, 185, 129, 0.22);
    --accent-gold-glow-strong: rgba(16, 185, 129, 0.45);
    --accent-warm: #fbbf24;

    --text-primary: #ecfdf5;
    --text-secondary: #93c5fd;
    --text-muted: #475569;

    --border-subtle: rgba(16, 185, 129, 0.1);
    --border-accent: rgba(16, 185, 129, 0.35);
    --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.2);
}

/* 4. Sunset Velvet Theme */
html[data-theme="sunset"] {
    --bg-deep: #0c050a;
    --bg-primary: #140811;
    --bg-card: rgba(30, 14, 26, 0.82);
    --bg-card-hover: rgba(46, 20, 38, 0.92);
    --bg-elevated: #281022;
    --bg-input: rgba(16, 8, 14, 0.9);

    --accent-gold: #f43f5e;
    --accent-gold-bright: #fb7185;
    --accent-gold-dim: #e11d48;
    --accent-gold-glow: rgba(244, 63, 94, 0.22);
    --accent-gold-glow-strong: rgba(244, 63, 94, 0.45);
    --accent-warm: #f59e0b;

    --text-primary: #fff1f2;
    --text-secondary: #fda4af;
    --text-muted: #64748b;

    --border-subtle: rgba(244, 63, 94, 0.1);
    --border-accent: rgba(244, 63, 94, 0.35);
    --shadow-glow: 0 0 40px rgba(244, 63, 94, 0.2);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-deep);
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom);
    transition: background 0.4s ease, color 0.4s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    color: inherit;
}

input, textarea {
    font-family: inherit;
    color: inherit;
}

/* ---- Ambient Background Effects ---- */
.ambient-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.35;
    transition: background 0.5s ease;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-gold-glow-strong) 0%, transparent 70%);
    top: -200px;
    left: -150px;
    animation: orb-float-1 18s ease-in-out infinite alternate;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(196, 139, 59, 0.12) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation: orb-float-2 22s ease-in-out infinite alternate;
}

@keyframes orb-float-1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.1); }
}

@keyframes orb-float-2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, -30px) scale(1.15); }
}

/* ========================================
   UNIQUE LOGIN PAGE DESIGN
   ======================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.login-top-bar {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 10;
}

.theme-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent-gold-bright);
    backdrop-filter: blur(16px);
    transition: all 0.3s var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.theme-switcher-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-gold-glow-strong);
    background: var(--bg-card-hover);
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 48px 40px;
    background: linear-gradient(145deg, var(--bg-card), var(--bg-primary));
    border: 1.5px solid var(--border-accent);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(40px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: card-enter 0.8s var(--ease-out) both;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(35px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 34px;
}

.vault-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--accent-gold-glow);
    border: 1px solid var(--border-accent);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-gold-bright);
    margin-bottom: 22px;
}

/* Aperture Spinning Logo */
.aperture-logo {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aperture-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed var(--accent-gold);
    opacity: 0.6;
    animation: spin-ring 20s linear infinite;
}

@keyframes spin-ring {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-icon-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm));
    color: #08080c;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px var(--accent-gold-glow-strong);
    transition: transform 0.4s var(--ease-spring);
}

.login-card:hover .logo-icon-inner {
    transform: scale(1.08) rotate(-6deg);
}

.logo-text {
    font-family: var(--font-display);
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text span {
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(224, 82, 82, 0.12);
    border: 1px solid rgba(224, 82, 82, 0.3);
    border-radius: var(--radius-md);
    color: #fca5a5;
    font-size: 0.92rem;
    margin-bottom: 26px;
    animation: shake 0.5s ease-in-out;
}

.login-error svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 54px 16px 50px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s var(--ease-out);
    outline: none;
    min-height: 50px;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 4px var(--accent-gold-glow), 0 4px 20px rgba(0, 0, 0, 0.4);
    background: var(--bg-card);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper:has(input:focus) .input-icon {
    color: var(--accent-gold-bright);
}

.toggle-password {
    position: absolute;
    right: 14px;
    padding: 8px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--text-primary);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    min-height: 54px;
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm));
    color: #08080c;
    font-size: 1.05rem;
    font-weight: 800;
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 6px 24px var(--accent-gold-glow-strong);
}

.login-btn:hover, .login-btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-gold-glow-strong);
}

.login-btn:active {
    transform: scale(0.98);
}

.login-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s var(--ease-out);
}

.login-btn:hover svg {
    transform: translateX(6px);
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.login-footer p {
    font-size: 0.84rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* ========================================
   THEME SELECTOR MODAL
   ======================================== */
.theme-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
}

.theme-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.theme-modal {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-accent);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s var(--ease-out);
}

.theme-modal-backdrop.active .theme-modal {
    transform: translateY(0) scale(1);
}

.theme-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.theme-modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
}

.theme-close-btn {
    font-size: 1.6rem;
    color: var(--text-muted);
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.theme-close-btn:hover {
    color: var(--text-primary);
}

.theme-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.theme-card-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    transition: all 0.3s var(--ease-out);
}

.theme-card-option:hover {
    transform: translateY(-3px);
    border-color: var(--accent-gold);
    box-shadow: 0 4px 20px var(--accent-gold-glow);
    background: var(--bg-card-hover);
}

.theme-preview {
    width: 64px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 6px;
}

.preview-cinematic {
    background: #060609;
    border: 1px solid rgba(229, 184, 90, 0.4);
}
.preview-cinematic .dot-1 { background: #e5b85a; width: 12px; height: 12px; border-radius: 50%; }
.preview-cinematic .dot-2 { background: #c48b3b; width: 12px; height: 12px; border-radius: 50%; }

.preview-cyberpunk {
    background: #05050d;
    border: 1px solid rgba(0, 240, 255, 0.4);
}
.preview-cyberpunk .dot-1 { background: #00f0ff; width: 12px; height: 12px; border-radius: 50%; }
.preview-cyberpunk .dot-2 { background: #ff007f; width: 12px; height: 12px; border-radius: 50%; }

.preview-emerald {
    background: #030806;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.preview-emerald .dot-1 { background: #10b981; width: 12px; height: 12px; border-radius: 50%; }
.preview-emerald .dot-2 { background: #fbbf24; width: 12px; height: 12px; border-radius: 50%; }

.preview-sunset {
    background: #0c050a;
    border: 1px solid rgba(244, 63, 94, 0.4);
}
.preview-sunset .dot-1 { background: #f43f5e; width: 12px; height: 12px; border-radius: 50%; }
.preview-sunset .dot-2 { background: #f59e0b; width: 12px; height: 12px; border-radius: 50%; }

/* ========================================
   NAVBAR & HEADER
   ======================================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 36px;
    background: rgba(10, 10, 16, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-form {
    margin: 0;
    display: inline-flex;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    transition: all 0.25s ease;
}

.logo-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-gold-glow-strong), rgba(196, 139, 59, 0.08));
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    transition: all 0.3s var(--ease-out);
}

.nav-logo:hover .logo-icon-wrapper {
    transform: scale(1.08) rotate(-4deg);
    box-shadow: 0 0 20px var(--accent-gold-glow-strong);
}

.nav-logo em {
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: normal;
}

/* User Badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    font-size: 0.88rem;
    font-weight: 600;
    backdrop-filter: blur(12px);
}

.badge-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.badge-admin .badge-avatar {
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm));
    color: #08080c;
}

.badge-viewer .badge-avatar {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    color: #fff;
}

.badge-role {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 3px 10px;
    background: var(--bg-elevated);
    border-radius: 100px;
    font-weight: 700;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    min-height: 44px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.25s var(--ease-out);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm));
    color: #08080c;
    box-shadow: 0 4px 18px var(--accent-gold-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 26px var(--accent-gold-glow-strong);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-ghost {
    padding: 9px 16px;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-glass);
}

.btn-danger {
    background: rgba(224, 82, 82, 0.12);
    color: var(--danger);
    border: 1px solid rgba(224, 82, 82, 0.25);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 4px 16px rgba(224, 82, 82, 0.3);
}

.btn-icon {
    padding: 8px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--accent-gold-bright);
    background: var(--accent-gold-glow);
}

/* ========================================
   MAIN CONTENT CONTAINER
   ======================================== */
.app-container {
    min-height: 100vh;
    background: var(--bg-deep);
    position: relative;
    z-index: 1;
}

.main-content {
    max-width: 1240px;
    margin: 0 auto;
    padding: 36px 36px 80px;
}

/* ========================================
   DASHBOARD / GALLERY
   ======================================== */
.dashboard-header-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 38px;
    flex-wrap: wrap;
    animation: fade-in-up 0.6s var(--ease-out) both;
}

.header-pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    margin-bottom: 8px;
    padding: 4px 12px;
    background: var(--accent-gold-glow);
    border: 1px solid var(--border-accent);
    border-radius: 100px;
}

.header-titles h1 {
    font-family: var(--font-display);
    font-size: 2.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.98rem;
}

/* Search Box */
.search-box {
    position: relative;
    min-width: 280px;
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.25s ease;
}

.search-input {
    width: 100%;
    padding: 12px 18px 12px 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s var(--ease-out);
    backdrop-filter: blur(12px);
    min-height: 46px;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--accent-gold-glow);
    background: var(--bg-card-hover);
}

.search-input:focus ~ .search-icon,
.search-box:has(.search-input:focus) .search-icon {
    color: var(--accent-gold);
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-down {
    from { opacity: 0; transform: translateX(-50%) translateY(-18px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    background: var(--bg-card);
    border: 1px dashed var(--border-accent);
    border-radius: var(--radius-xl);
    animation: fade-in-up 0.8s var(--ease-out) both;
}

.empty-icon {
    color: var(--accent-gold);
    margin-bottom: 22px;
    opacity: 0.7;
}

.empty-state h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.98rem;
    max-width: 420px;
    margin: 0 auto;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
    animation: fade-in-up 0.6s var(--ease-out) both 0.15s;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.35s var(--ease-out);
    display: flex;
    flex-direction: column;
    position: relative;
    backdrop-filter: blur(16px);
}

.video-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    background: var(--bg-card-hover);
}

.video-card:active {
    transform: scale(0.98);
}

.card-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(145deg, #181828, #0e0e1a);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-gold-glow) 0%, transparent 70%);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-accent);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent-gold-bright);
    letter-spacing: 0.08em;
    backdrop-filter: blur(8px);
}

.play-overlay {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--accent-gold-glow);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold-bright);
    transition: all 0.35s var(--ease-out);
    border: 1.5px solid var(--border-accent);
    z-index: 2;
}

.play-overlay svg {
    margin-left: 3px;
}

.video-card:hover .play-overlay {
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm));
    color: #08080c;
    transform: scale(1.12);
    box-shadow: 0 0 35px var(--accent-gold-glow-strong);
    border-color: transparent;
}

.card-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 4px 10px;
    background: rgba(8, 8, 14, 0.85);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-info {
    padding: 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.45;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.meta-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ========================================
   UPLOAD PAGE
   ======================================== */
.upload-container {
    max-width: 660px;
    margin: 0 auto;
    animation: fade-in-up 0.6s var(--ease-out) both;
}

.upload-header {
    margin-bottom: 30px;
    text-align: center;
}

.upload-header h1 {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 8px;
}

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

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 0.94rem;
    margin-bottom: 26px;
}

.alert-error {
    background: rgba(224, 82, 82, 0.12);
    border: 1px solid rgba(224, 82, 82, 0.25);
    color: #fca5a5;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: var(--bg-card);
    padding: 32px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
}

.form-group label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
    min-height: 48px;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 4px var(--accent-gold-glow);
}

/* Dropzone */
.upload-dropzone {
    position: relative;
    border: 2px dashed var(--border-accent);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s var(--ease-out);
    background: var(--accent-gold-glow);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--accent-gold-bright);
    background: var(--accent-gold-glow-strong);
    box-shadow: 0 0 40px var(--accent-gold-glow);
}

.dropzone-icon {
    color: var(--accent-gold);
    margin-bottom: 16px;
    transition: transform 0.3s var(--ease-spring);
}

.upload-dropzone:hover .dropzone-icon {
    transform: translateY(-4px) scale(1.08);
}

.dropzone-text {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.dropzone-subtext {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.dropzone-formats {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dropzone-selected {
    color: var(--success);
}

.dropzone-selected svg {
    margin-bottom: 14px;
}

.selected-name {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.selected-size {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Progress Bar */
.upload-progress {
    padding: 18px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-gold-dim), var(--accent-gold-bright), var(--accent-warm));
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    border-radius: 4px;
    transition: width 0.3s ease;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.progress-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 10px;
    text-align: center;
}

.btn-upload-submit {
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: 1.05rem;
    font-weight: 700;
    min-height: 52px;
}

/* ========================================
   WATCH PAGE / THEATER MODE
   ======================================== */
.watch-page {
    max-width: 960px;
    transition: max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.watch-page.theater-mode {
    max-width: 100% !important;
}

.player-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 50px var(--accent-gold-glow);
    margin-bottom: 24px;
    animation: fade-in-up 0.5s var(--ease-out) both;
    border: 1px solid var(--border-subtle);
}

.player-container video {
    width: 100%;
    display: block;
}

/* Resume Toast */
.resume-toast {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: rgba(12, 12, 20, 0.92);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    color: #fff;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px var(--accent-gold-glow);
    animation: fade-in-down 0.4s var(--ease-out);
}

.resume-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* Gesture Overlay Ripples */
.gesture-overlay {
    position: absolute;
    top: 0;
    bottom: 50px;
    width: 35%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gesture-left { left: 0; border-radius: 100% 0 0 100%; }
.gesture-right { right: 0; border-radius: 0 100% 100% 0; }

.gesture-overlay.active {
    opacity: 1;
    animation: gesture-ripple 0.6s ease-out forwards;
}

.gesture-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.7);
    padding: 16px 22px;
    border-radius: 50%;
    color: var(--accent-gold-bright);
    font-weight: 700;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-accent);
}

@keyframes gesture-ripple {
    0% { transform: scale(0.7); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

/* Action Buttons & Video Meta */
.video-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Shortcuts Grid */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    padding: 10px 0;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}

kbd {
    background: var(--bg-elevated);
    border: 1px solid var(--border-accent);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: monospace;
    font-size: 0.82rem;
    color: var(--accent-gold-bright);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

/* Plyr Custom Styling */
.plyr {
    --plyr-color-main: var(--accent-gold);
    --plyr-video-control-color: #fff;
    --plyr-video-control-background-hover: var(--accent-gold-glow-strong);
    border-radius: var(--radius-xl);
}

.plyr__control--overlaid {
    background: var(--accent-gold-glow-strong) !important;
    border: 1.5px solid var(--border-accent) !important;
    backdrop-filter: blur(10px);
}

.plyr__control--overlaid:hover {
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm)) !important;
}

.video-info-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 28px;
    animation: fade-in-up 0.5s var(--ease-out) both 0.1s;
}

.video-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.video-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.35;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* ========================================
   COMMENTS SECTION
   ======================================== */
.comments-section {
    animation: fade-in-up 0.5s var(--ease-out) both 0.2s;
    background: var(--bg-card);
    padding: 28px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.comments-title svg {
    color: var(--accent-gold);
}

/* Comment Form */
.comment-form {
    margin-bottom: 32px;
}

.comment-input-wrapper {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.88rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.avatar-admin {
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm));
    color: #08080c;
}

.avatar-viewer {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    color: #fff;
}

.comment-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.96rem;
    color: var(--text-primary);
    resize: vertical;
    min-height: 56px;
    outline: none;
    transition: all 0.3s ease;
}

.comment-input::placeholder {
    color: var(--text-muted);
}

.comment-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

.btn-comment {
    align-self: flex-end;
    padding: 10px 22px;
    font-size: 0.9rem;
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment-item {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-top: 1px solid var(--border-subtle);
    animation: fade-in-up 0.4s var(--ease-out) both;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 700;
    font-size: 0.92rem;
}

.comment-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.comment-delete-form {
    margin-left: auto;
}

.comment-text {
    font-size: 0.96rem;
    color: var(--text-secondary);
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.no-comments {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ========================================
   ERROR / FORBIDDEN PAGES
   ======================================== */
.error-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.error-content {
    text-align: center;
    max-width: 440px;
    padding: 44px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    animation: fade-in-up 0.6s var(--ease-out) both;
}

.error-icon {
    color: var(--danger);
    margin-bottom: 22px;
    opacity: 0.85;
}

.forbidden-icon {
    color: var(--accent-gold);
}

.error-content h1 {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.98rem;
}

/* ========================================
   MOBILE BOTTOM NAVIGATION BAR (ANDROID APP BAR)
   ======================================== */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-accent);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 12px;
    transition: all 0.25s var(--ease-out);
    background: transparent;
    border: none;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--accent-gold-bright);
}

.bottom-nav-item svg {
    transition: transform 0.25s var(--ease-spring);
}

.bottom-nav-item:active svg {
    transform: scale(0.85);
}

.bottom-nav-form {
    margin: 0;
    padding: 0;
    display: flex;
}

/* Floating Action Button for Upload */
.upload-fab {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-warm));
    color: #08080c;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--accent-gold-glow-strong);
    margin-top: -14px;
    transition: transform 0.25s var(--ease-spring);
}

.bottom-nav-item:active .upload-fab {
    transform: scale(0.9);
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Love Banner Card for Hajera ---- */
.love-banner-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.18), rgba(225, 29, 72, 0.08));
    border: 1.5px solid rgba(244, 63, 94, 0.35);
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(244, 63, 94, 0.15);
    animation: love-pulse-glow 3s ease-in-out infinite alternate;
}

@keyframes love-pulse-glow {
    0% { border-color: rgba(244, 63, 94, 0.3); box-shadow: 0 4px 20px rgba(244, 63, 94, 0.12); }
    100% { border-color: rgba(244, 63, 94, 0.65); box-shadow: 0 8px 36px rgba(244, 63, 94, 0.35); }
}

.love-banner-icon {
    font-size: 2.4rem;
    animation: heart-bounce 1.5s ease-in-out infinite alternate;
}

@keyframes heart-bounce {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

.love-banner-text h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: #fecdd3;
    margin-bottom: 4px;
}

.love-banner-text p {
    font-size: 0.94rem;
    color: #fda4af;
}

/* ========================================
   RESPONSIVE & ANDROID OPTIMIZATIONS
   ======================================== */
@media (max-width: 768px) {
    .desktop-only-logout,
    .desktop-only-theme {
        display: none !important;
    }

    .navbar {
        padding: 12px 18px;
    }

    .btn-upload {
        display: none;
    }

    .main-content {
        padding: 20px 16px 90px;
    }

    .dashboard-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }

    .search-box {
        width: 100%;
        min-width: unset;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .video-card {
        border-radius: var(--radius-md);
    }

    .card-info {
        padding: 12px 14px;
    }

    .card-title {
        font-size: 0.92rem;
        margin-bottom: 8px;
    }

    .card-meta {
        font-size: 0.76rem;
    }

    .play-overlay {
        width: 44px;
        height: 44px;
    }

    .play-overlay svg {
        width: 20px;
        height: 20px;
    }

    .login-card {
        padding: 36px 22px;
        border-radius: var(--radius-lg);
    }

    .theme-top-bar {
        right: 18px;
        top: 18px;
    }

    .theme-options-grid {
        grid-template-columns: 1fr;
    }

    .video-title {
        font-size: 1.35rem;
    }

    .video-info-header {
        flex-direction: column;
        gap: 12px;
    }

    .comments-section {
        padding: 20px 16px;
        border-radius: var(--radius-lg);
    }

    .upload-form {
        padding: 22px 16px;
        border-radius: var(--radius-lg);
    }

    .upload-dropzone {
        padding: 36px 16px;
    }

    .mobile-bottom-bar {
        display: flex;
    }

    .btn-text {
        display: none;
    }

    .video-action-buttons .btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .header-titles h1 {
        font-size: 1.6rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .user-badge span:not(.badge-role) {
        display: none;
    }

    .player-container {
        border-radius: var(--radius-md);
        margin-bottom: 18px;
    }
}
