/* Uplift Stream — dark theme.
   Palette: near-black #0A0E14, brand blue #5589AF, light blue #7EBCE2,
   steel #233C51 / #2C4967, silver #B3B4B4. Body text #C9DAE7 (readable),
   headings near-white #EAF4FA, muted meta #8FA6B8 (meta only, never body). */

:root {
    --bg: #0A0E14;
    --bg-panel: #0E1622;
    --bg-input: #0A141F;
    --border: #233C51;
    --brand: #5589AF;
    --brand-hover: #7EBCE2;
    --accent: #00C2FF;
    --text: #C9DAE7;
    --heading: #EAF4FA;
    --muted: #8FA6B8;
    --danger: #E05B4B;
    --ok: #3FB97C;
    --warn: #E8A33D;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

a { color: var(--brand-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--heading); line-height: 1.25; }
.page-title { font-size: 28px; margin: 8px 0 18px; }
.section-title { margin-top: 36px; }

/* ------------------------------------------------ header */
.site-header {
    background: rgba(10, 14, 20, 0.97);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.wordmark { font-size: 22px; font-weight: 800; letter-spacing: 0.3px; white-space: nowrap; }
.wordmark:hover { text-decoration: none; }
.wm-uplift { color: var(--brand-hover); }
.wm-stream { color: var(--heading); }
.wm-byline { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; }
.header-search { flex: 1 1 260px; display: flex; max-width: 520px; }
.header-search input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--heading);
    padding: 9px 12px;
    border-radius: 6px 0 0 6px;
    font-size: 15px;
}
.header-search button {
    background: #233C51;
    color: var(--heading);
    border: 1px solid var(--border);
    border-left: none;
    padding: 9px 16px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 15px;
}
.header-search button:hover { background: #2C4967; }
.header-nav { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.nav-user { color: var(--muted); }
.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------ layout */
.container { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }
.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    padding: 22px 16px 30px;
    font-size: 14px;
}

/* ------------------------------------------------ buttons & forms */
.btn {
    display: inline-block;
    background: #233C51;
    color: var(--heading);
    border: 1px solid var(--border);
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}
.btn:hover { background: #2C4967; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #6A9DC2; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(224, 91, 75, 0.12); }
.btn-block { display: block; width: 100%; margin-top: 14px; }
.btn-link { background: none; border: none; color: var(--brand-hover); cursor: pointer; font-size: 15px; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger, a.danger { color: var(--danger); }

.form-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px;
    max-width: 440px;
    margin: 24px auto;
}
.form-card.wide { max-width: 680px; }
.form-card h1 { margin-top: 0; font-size: 24px; }
.form-card label { display: block; margin: 16px 0 6px; color: var(--heading); font-weight: 600; font-size: 14.5px; }
.form-card .hint { color: var(--muted); font-weight: 400; }
.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--heading);
    padding: 10px 12px;
    font-size: 15.5px;
    font-family: inherit;
}
.form-card input[type="file"] { color: var(--text); font-size: 15px; }
.form-note, .form-alt { color: var(--muted); font-size: 14.5px; }
.form-error { color: var(--danger); }
.form-card hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.form-card h2 { font-size: 19px; }
.form-card h2.danger { color: var(--danger); }
.thumb-preview { max-width: 320px; width: 100%; border-radius: 8px; border: 1px solid var(--border); }

/* ------------------------------------------------ flashes */
.flash { border-radius: 8px; padding: 12px 16px; margin: 14px 0; font-size: 15px; }
.flash-success { background: rgba(63, 185, 124, 0.14); border: 1px solid var(--ok); color: #B9E8CF; }
.flash-error { background: rgba(224, 91, 75, 0.12); border: 1px solid var(--danger); color: #F3C2BB; }

/* ------------------------------------------------ video grids & cards */
.feed-section h2 { font-size: 21px; margin: 22px 0 14px; }
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 22px 18px;
}
.video-card { min-width: 0; }
.video-card .thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #060A10;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: var(--muted); font-size: 14px;
}
.video-card .duration {
    position: absolute; right: 8px; bottom: 8px;
    background: rgba(0, 0, 0, 0.8); color: #fff;
    font-size: 12.5px; padding: 1px 6px; border-radius: 4px;
}
.card-title { font-size: 16px; margin: 10px 0 4px; }
.card-title a { color: var(--heading); }
.card-meta { color: var(--muted); font-size: 13.5px; margin: 2px 0; }
.empty-note { color: var(--muted); font-size: 16px; padding: 18px 0; }

/* ------------------------------------------------ watch page */
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.player-wrap { background: #000; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.player-wrap video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }
.watch-title { font-size: 24px; margin: 16px 0 6px; }
.watch-meta { color: var(--muted); margin: 0 0 12px; }
.watch-channel { font-size: 17px; font-weight: 600; margin-bottom: 14px; }
.watch-description {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    white-space: normal;
}
.watch-tags { margin-top: 14px; }
.tag { color: var(--brand-hover); margin-right: 10px; font-size: 14.5px; }
.watch-side h2 { font-size: 19px; margin-top: 4px; }
.side-list { display: grid; gap: 20px; }

/* ------------------------------------------------ channel */
.channel-head { padding: 10px 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.channel-head h1 { margin: 6px 0; font-size: 30px; }
.channel-about { margin: 12px 0 16px; max-width: 760px; }

/* ------------------------------------------------ tables, badges, admin */
.admin-table { width: 100%; border-collapse: collapse; margin: 14px 0 26px; font-size: 15px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; }
.row-actions { white-space: nowrap; }
.row-actions a, .row-actions form { margin-right: 10px; }
.row-actions form { display: inline; }
.row-error { color: var(--danger); font-size: 13px; margin-top: 4px; white-space: normal; }

.badge {
    display: inline-block; font-size: 12.5px; font-weight: 700;
    padding: 2px 9px; border-radius: 999px; text-transform: capitalize;
    background: #233C51; color: var(--heading);
}
.badge-ready { background: rgba(63, 185, 124, 0.2); color: #9FE3BC; }
.badge-processing, .badge-uploaded { background: rgba(232, 163, 61, 0.18); color: #F2CD93; }
.badge-failed { background: rgba(224, 91, 75, 0.18); color: #F3B3AA; }
.badge-unpublished { background: rgba(179, 180, 180, 0.16); color: #D5D8D8; }
.badge-featured { background: rgba(85, 137, 175, 0.35); color: #BFE0F5; margin-left: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin: 18px 0 26px; }
.stat-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.stat-num { display: block; font-size: 30px; font-weight: 800; color: var(--heading); }
.stat-label { color: var(--muted); font-size: 14px; }
.admin-links { display: flex; gap: 14px; flex-wrap: wrap; }

.application-card {
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 10px; padding: 20px 22px; margin: 16px 0;
}
.application-card h2 { margin: 0 0 4px; font-size: 20px; }
.application-about { margin: 12px 0 16px; max-width: 820px; }
.application-actions { display: flex; gap: 12px; }
.application-actions form { margin: 0; }

.filter-links { display: flex; gap: 14px; flex-wrap: wrap; }
.filter-links a { color: var(--muted); text-transform: capitalize; }
.filter-links a.active { color: var(--heading); font-weight: 700; }

.studio-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.studio-head h1 { font-size: 26px; }

/* ------------------------------------------------ upload progress */
.progress-wrap {
    margin-top: 18px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: 6px;
    height: 26px; position: relative; overflow: hidden;
}
.progress-bar { background: var(--brand); height: 100%; width: 0%; transition: width 0.15s linear; }
.progress-text {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: #fff; font-weight: 600;
}

/* ------------------------------------------------ pagination */
.pagination { display: flex; gap: 18px; align-items: center; margin: 26px 0 6px; color: var(--muted); }

/* ------------------------------------------------ responsive */
@media (max-width: 900px) {
    .watch-layout { grid-template-columns: 1fr; }
    .header-inner { gap: 12px; }
    .header-search { order: 3; flex-basis: 100%; max-width: none; }
}
