/* ============================================================
   Review Platform — Main Stylesheet
   Fonts: Bebas Neue (headings) / DM Sans 300 (body)
   Brand themes applied via CSS custom properties
   ============================================================ */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 300;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Default dark brand vars (Jake Ward) — overridden per-brand by inline <style> */
:root {
    --bg:       #0a0a0a;
    --text:     #f5f4f0;
    --accent:   #c8b89a;
    --surface:  #141414;
    --surface2: #1e1e1e;
    --border:   rgba(245,244,240,0.08);
    --input-bg: #1a1a1a;
    --muted:    rgba(245,244,240,0.45);
    --danger:   #c0392b;
    --success:  #27ae60;
}

h1, h2, h3, h4 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.1;
}

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

code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    background: var(--surface2);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

textarea, input, select, button { font-family: inherit; font-weight: 300; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    padding: 0.65em 1.4em;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn:active { opacity: 0.7; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 500;
}
.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-approve {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.08em;
    padding: 0.8em 1.6em;
}

.btn-full   { width: 100%; }
.btn-sm     { padding: 0.4em 0.9em; font-size: 0.8rem; }
.btn-xs     { padding: 0.25em 0.6em; font-size: 0.75rem; }

.link-btn {
    background: none; border: none; cursor: pointer;
    color: var(--accent); text-decoration: underline; font-size: inherit;
}

/* ── Flash messages ───────────────────────────────────────── */
.flash {
    padding: 0.85em 1.2em;
    border-radius: 3px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border-left: 3px solid currentColor;
}
.flash-error   { background: rgba(192,57,43,0.12); color: #e74c3c; }
.flash-success { background: rgba(39,174,96,0.12);  color: #2ecc71; }
.flash-warn    { background: rgba(230,126,34,0.12); color: #e67e22; }

/* ── Form elements ────────────────────────────────────────── */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}
.form-field label {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.form-field input,
.form-field select,
.form-field textarea {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.65em 0.85em;
    font-size: 0.95rem;
    width: 100%;
    transition: border-color 0.15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--muted); }
.form-field select option { background: var(--surface); }

.field-hint {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.2rem;
}
.req { color: var(--accent); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
}
.form-field-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; align-items: center; }

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.75rem;
    margin-bottom: 1.25rem;
}
.card-title {
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 1.2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* ── Status badges ────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 0.2em 0.7em;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.status-draft        { background: rgba(245,244,240,0.08); color: var(--muted); }
.status-review       { background: rgba(52,152,219,0.18);  color: #5dade2; }
.status-changes      { background: rgba(230,126,34,0.18);  color: #e67e22; }
.status-approved     { background: rgba(39,174,96,0.18);   color: #2ecc71; }
.status-delivered    { background: rgba(155,89,182,0.18);  color: #a569bd; }
.status-processing   { background: rgba(230,126,34,0.18);  color: #e67e22; }
.status-ready        { background: rgba(39,174,96,0.18);   color: #2ecc71; }
.status-none         { background: rgba(245,244,240,0.08); color: var(--muted); }

/* Brand pill */
.brand-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.15em 0.6em;
    border-radius: 20px;
}
.brand-jakeward  { background: rgba(200,184,154,0.15); color: #c8b89a; }
.brand-glassfull { background: rgba(10,10,10,0.08);    color: var(--muted); border: 1px solid var(--border); }

/* ── Login page ───────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.login-wrap {
    width: 100%;
    max-width: 400px;
    padding: 2rem 1.5rem;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2.5rem 2rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-wordmark {
    display: block;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.8rem;
    letter-spacing: 0.15em;
    color: var(--accent);
    line-height: 1;
}
.login-brand-name {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 0.3rem;
}
.login-intro {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.install-intro {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* ── Admin layout ─────────────────────────────────────────── */
.admin-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 2rem;
    height: 56px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-wordmark {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.12em;
    color: var(--accent);
}
.logo-sep { color: var(--border); font-size: 1rem; }
.logo-brand { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.admin-nav { display: flex; gap: 0.25rem; flex: 1; }
.admin-nav a {
    padding: 0.4em 0.9em;
    border-radius: 3px;
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}
.admin-nav a:hover,
.admin-nav a.active { color: var(--text); background: var(--surface2); }

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--muted);
    flex-shrink: 0;
}
.admin-logout { color: var(--muted); font-size: 0.82rem; }
.admin-logout:hover { color: var(--text); }

.admin-main { padding: 2rem 0 4rem; }
.admin-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

.admin-footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 0;
    font-size: 0.8rem;
    color: var(--muted);
}
.admin-footer .admin-container { display: flex; justify-content: center; }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.page-title {
    font-size: 2rem;
    letter-spacing: 0.06em;
}
.page-subtitle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.4rem;
}
.page-header-actions { display: flex; gap: 0.5rem; flex-shrink: 0; margin-top: 0.25rem; }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.filter-search {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.5em 0.85em;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 300;
    flex: 1;
    min-width: 180px;
}
.filter-search:focus { outline: none; border-color: var(--accent); }
.filter-select {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.5em 0.85em;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--accent); }

/* ── Project list ─────────────────────────────────────────── */
.project-list { display: flex; flex-direction: column; gap: 0; }

.project-row {
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background: var(--surface);
    transition: border-color 0.15s;
}
.project-row:hover { border-color: rgba(245,244,240,0.18); }

.project-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    gap: 1rem;
}

.project-title-line {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}
.project-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
}
.project-title:hover { color: var(--accent); }

.project-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.25rem;
    flex-wrap: wrap;
}
.meta-sep { opacity: 0.4; }
.meta-date { font-size: 0.75rem; }

.comment-count { display: flex; align-items: center; gap: 0.3rem; }
.comment-count.has-open { color: #e67e22; }
.open-badge {
    background: rgba(230,126,34,0.18);
    color: #e67e22;
    padding: 0.1em 0.5em;
    border-radius: 10px;
    font-size: 0.7rem;
}

.project-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
    align-items: center;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}
.empty-state p { margin-bottom: 1.5rem; font-size: 1.05rem; }

/* ── Edit layout ──────────────────────────────────────────── */
.edit-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}
.edit-main, .edit-sidebar { display: flex; flex-direction: column; }

.share-url-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.6em 0.9em;
    margin-bottom: 0.75rem;
}
.share-url-box code {
    flex: 1;
    background: none;
    padding: 0;
    font-size: 0.78rem;
    word-break: break-all;
}
.share-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.75rem; }
.share-actions { display: flex; gap: 0.5rem; }

.danger-card { border-color: rgba(192,57,43,0.25); }

/* ── Video upload zone ────────────────────────────────────── */
.video-status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}
.video-id-label { color: var(--muted); }
.video-thumb { margin-bottom: 1rem; border-radius: 3px; overflow: hidden; max-width: 100%; }
.video-thumb img { width: 100%; display: block; }

.upload-zone {
    border: 1px dashed var(--border);
    border-radius: 4px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 1rem;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(200,184,154,0.04);
}
.upload-icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.4; }
.upload-zone p { color: var(--muted); font-size: 0.875rem; margin-bottom: 0.25rem; }
.upload-hint { font-size: 0.78rem !important; }

.upload-progress { margin-top: 1rem; }
.progress-bar {
    height: 4px;
    background: var(--surface2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
}

/* ── Notice ───────────────────────────────────────────────── */
.notice {
    padding: 0.75em 1em;
    border-radius: 3px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.notice-warn { background: rgba(230,126,34,0.12); color: #e67e22; border-left: 3px solid #e67e22; }

/* ── Status toolbar ───────────────────────────────────────── */
.status-toolbar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.toolbar-label { font-size: 0.8rem; color: var(--muted); margin-right: 0.25rem; }

/* ── Review layout (admin view) ───────────────────────────── */
.review-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.75rem;
    align-items: start;
}
.review-player-col, .review-comments-col { display: flex; flex-direction: column; }

.external-link { color: var(--accent); font-size: 0.85rem; }

/* ── Player wrapper ───────────────────────────────────────── */
.player-wrap { margin-bottom: 1rem; }
.player-ratio {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    border-radius: 3px;
    overflow: hidden;
}
.player-ratio iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

.player-placeholder {
    aspect-ratio: 16/9;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--muted);
    margin-bottom: 1rem;
}
.player-placeholder.processing { border-style: solid; }
.placeholder-icon { font-size: 2.5rem; opacity: 0.25; }

/* ── Comment timeline ─────────────────────────────────────── */
.comment-timeline { padding: 0.4rem 0; }
.timeline-track {
    position: relative;
    height: 4px;
    background: var(--surface2);
    border-radius: 2px;
    cursor: pointer;
}
.timeline-track:hover { background: var(--border); }
.timeline-playhead {
    position: absolute;
    top: -3px;
    left: 0%;
    width: 2px;
    height: 10px;
    background: var(--accent);
    border-radius: 1px;
    pointer-events: none;
    transform: translateX(-50%);
    transition: left 0.1s;
}
.timeline-marker {
    position: absolute;
    top: -3px;
    width: 8px;
    height: 10px;
    background: var(--muted);
    border-radius: 1px;
    transform: translateX(-50%);
    cursor: pointer;
    transition: background 0.15s;
}
.timeline-marker:hover { background: var(--accent); }
.timeline-marker.open    { background: #e67e22; }
.timeline-marker.resolved { background: var(--muted); opacity: 0.5; }

.player-time-display {
    display: flex;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.5rem;
    font-variant-numeric: tabular-nums;
}
.time-sep { opacity: 0.4; }

/* ── Comments panel ───────────────────────────────────────── */
.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.comments-title {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.comment-badge {
    background: var(--surface2);
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    padding: 0.1em 0.55em;
    border-radius: 20px;
}
.toggle-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.toggle-label input { accent-color: var(--accent); }

.comments-list { display: flex; flex-direction: column; gap: 0.75rem; }
.comments-empty { color: var(--muted); font-size: 0.875rem; text-align: center; padding: 1.5rem; }

.comment-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.9rem 1rem;
    transition: opacity 0.2s;
}
.comment-item.is-resolved { opacity: 0.45; }
.show-resolved .comment-item.is-resolved { opacity: 1; }

/* Hide resolved by default */
body:not(.show-resolved) .comment-item.is-resolved { display: none; }

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}
.comment-author { font-weight: 400; font-size: 0.85rem; }
.comment-date   { font-size: 0.75rem; color: var(--muted); }
.resolved-tag   { font-size: 0.72rem; color: var(--muted); background: var(--surface2); padding: 0.1em 0.5em; border-radius: 10px; }

.comment-text { font-size: 0.875rem; line-height: 1.5; }

.comment-actions { margin-top: 0.6rem; display: flex; gap: 0.4rem; }
.resolve-btn { font-size: 0.75rem; color: var(--muted); }

.ts-pill {
    display: inline-flex;
    align-items: center;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.15em 0.6em;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    letter-spacing: 0.04em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.ts-pill.seek-btn { cursor: pointer; }
.ts-pill.seek-btn:hover { opacity: 0.8; }

/* ── Project description ──────────────────────────────────── */
.project-description {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
}
.project-description h3 { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }

.muted-text { color: var(--muted); font-size: 0.875rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .edit-layout       { grid-template-columns: 1fr; }
    .review-layout     { grid-template-columns: 1fr; }
    .form-grid         { grid-template-columns: 1fr; }
    .form-field-full   { grid-column: 1; }
}
@media (max-width: 680px) {
    .admin-header-inner { padding: 0 1rem; }
    .admin-container    { padding: 0 1rem; }
    .project-row-main   { flex-direction: column; align-items: flex-start; }
    .project-actions    { width: 100%; }
    .filter-bar         { flex-direction: column; align-items: stretch; }
    .page-header        { flex-direction: column; }
    .page-header-actions { width: 100%; }
    .status-toolbar     { gap: 0.3rem; }
}
