:root {
    --bg: #11100e;
    --paper: #f8f4ec;
    --ink: #2a2724;
    --ink-soft: #5b5651;
    --line: #e5dfd6;
    --line-dark: rgba(0,0,0,0.12);
    --accent: #2f4858; /* calm ink blue */
    --accent-weak: #dfe7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Motion - Simplified for performance */
@keyframes soft-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.995; }
}

body {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent 0px, rgba(255,255,255,0.02) 1px, transparent 2px),
        repeating-linear-gradient(90deg, transparent 0px, rgba(255,255,255,0.02) 1px, transparent 2px);
    background-size: 60px 60px, 60px 60px;
    pointer-events: none;
    opacity: 0.5;
}

.container {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line-dark);
    max-width: 860px;
    width: 100%;
    padding: 44px;
    position: relative;
    z-index: 1;
    border-radius: 26px 30px 28px 24px / 28px 24px 30px 26px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

h1 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--ink);
    margin-bottom: 8px;
    font-size: 2.6em;
    font-weight: 600;
    letter-spacing: 0.3px;
}



.subtitle {
    color: var(--ink-soft);
    margin-bottom: 26px;
    font-size: 0.98em;
    letter-spacing: 0.2px;
}

.flash-messages { margin-bottom: 20px; }
.flash {
    padding: 14px 18px;
    margin-bottom: 14px;
    border: 1px solid var(--line-dark);
    border-radius: 18px;
    font-weight: 500;
    background: #fbf8f1;
}
.flash.success { background: #eef5ef; color: #305b45; border-color: rgba(48,91,69,0.15); }
.flash.error { background: #f7ecee; color: #7e3a45; border-color: rgba(126,58,69,0.18); }

.btn {
    display: inline-block;
    padding: 12px 22px;
    border: 1.5px solid var(--line-dark);
    border-radius: 999px;
    font-size: 0.92em;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.28s ease, background 0.28s ease, color 0.28s ease, border-color 0.28s ease;
    margin: 6px;
    background: #efeae2;
    color: var(--ink);
    text-transform: none;
    letter-spacing: 0.2px;
}
.btn:hover { transform: translateY(-1px); background: #e9e3da; }
.btn:focus { outline: 3px solid var(--accent-weak); outline-offset: 2px; }
.btn-primary { color: var(--ink); border-color: rgba(0,0,0,0.15); background: #efeae2; }
.btn-primary:hover { background: #e6e0d6; }
.btn-youtube { color: var(--ink); border-color: rgba(0,0,0,0.15); background: #f0e9e8; }
.btn-youtube:hover { background: #e9e1e0; }
.btn-success { color: var(--ink); border-color: rgba(0,0,0,0.15); background: #e9efe9; }
.btn-success:hover { background: #e2eae2; }
.btn-danger { color: var(--ink); border-color: rgba(0,0,0,0.15); background: #f3e9eb; }
.btn-danger:hover { background: #ecdee1; }
.btn-secondary { color: var(--ink); border-color: rgba(0,0,0,0.15); background: #ece8df; }
.btn-secondary:hover { background: #e5dfd6; }

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.78em;
    margin: 4px 0;
    border: 1px solid var(--line-dark);
    border-radius: 999px;
    letter-spacing: 0.2px;
    font-weight: 500;
    background: #faf7f0;
}
.status-active { background: #e8f0ea; color: #2f5d48; }
.status-inactive { background: #f3e6e8; color: #7f3945; }
.status-connected { background: #e7edf3; color: #294a60; }

.card {
    background: #fbf8f1;
    border: 1px solid var(--line-dark);
    border-radius: 22px 26px 24px 20px / 24px 20px 26px 22px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    will-change: transform;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(0,0,0,0.10); }
.card h2 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--ink);
    margin-bottom: 14px;
    font-size: 1.35em;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.form-group { margin: 15px 0; }
label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-weight: 500;
    font-size: 0.86em;
    letter-spacing: 0.2px;
}
select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line-dark);
    border-radius: 16px;
    font-size: 0.95em;
    background: #fffdfa;
    color: var(--ink);
    font-family: 'IBM Plex Sans', sans-serif;
}
select:focus { outline: none; border-color: rgba(0,0,0,0.2); }
select option { background: #fffdfa; color: var(--ink); }

.vod-list { list-style: none; }
.vod-item {
    background: #fffdfa;
    padding: 16px;
    margin: 12px 0;
    border-radius: 14px 18px 16px 12px / 16px 12px 18px 14px;
    border: 1px solid var(--line-dark);
    box-shadow: 0 6px 14px rgba(0,0,0,0.05);
    will-change: transform;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vod-item:hover { transform: translateY(-1px); box-shadow: 0 12px 18px rgba(0,0,0,0.10); }
.vod-item a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.vod-item a:hover { opacity: 0.9; }
.vod-date { color: var(--ink-soft); font-size: 0.86em; margin-top: 6px; }

.footer { margin-top: 28px; padding-top: 18px; border-top: 1px dashed rgba(0,0,0,0.12); text-align: center; color: var(--ink-soft); }
.footer a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.footer a:hover { opacity: 0.9; }

/* Activity (toned down) */
.activity-list { list-style: none; }
.activity-item {
    background: #fffdfa;
    padding: 15px;
    margin: 12px 0;
    display: flex;
    align-items: flex-start;
    border-radius: 16px;
    border: 1px solid var(--line-dark);
}
.activity-icon { font-size: 1.2em; margin-right: 12px; min-width: 30px; }
.activity-content { flex: 1; }
.activity-action { color: var(--ink); margin-bottom: 4px; font-weight: 600; }
.activity-details { color: var(--ink-soft); font-size: 0.9em; margin-bottom: 4px; word-break: break-word; }
.activity-time { color: var(--ink-soft); font-size: 0.85em; opacity: 0.9; }

/* Dashboard layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.vod-thumb {
    width: 160px;
    height: 90px;
    border: 1px solid var(--line-dark);
    border-radius: 12px;
    margin-right: 15px;
    object-fit: cover;
}

/* Progress */
#progress-container { margin: 20px 0; }
#current-task { margin-bottom: 12px; color: var(--ink-soft); font-weight: 500; }
.progress-track { background: #efefef; border: 1px solid var(--line-dark); border-radius: 6px; height: 12px; overflow: hidden; }
.progress-bar { background: var(--accent); height: 100%; width: 0%; transition: width 0.4s ease; }

ol, p { color: var(--ink-soft); line-height: 1.7; }
strong { color: var(--ink); font-weight: 600; }
ol li { margin: 8px 0; }
ul li { margin: 6px 0; }
code { 
    background: #efefef; 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-family: 'IBM Plex Mono', monospace; 
    font-size: 0.9em;
    color: var(--ink);
}

/* Always use reduced motion for stability */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* Limit max height for VOD containers to prevent massive DOM trees */
.vod-list {
    max-height: 600px;
    overflow-y: auto;
}

#vods-container {
    max-height: 800px;
    overflow-y: auto;
}


