/* Watch Party - lightweight stylesheet */
* { box-sizing: border-box; }

:root {
    --bg:        #0f1115;
    --surface:   #181b22;
    --surface-2: #20242d;
    --border:    #2a2f3a;
    --text:      #e6e8ee;
    --muted:     #8b94a3;
    --primary:   #5b8def;
    --primary-h: #4773d4;
    --danger:    #e15a5a;
    --danger-h:  #c84545;
    --ok:        #4ec07e;
    --warn:      #e0a23a;
    --error:     #e15a5a;
    --radius:    8px;
}

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

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

/* ----- Top nav ----- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.topbar .brand { font-weight: 600; font-size: 1.05rem; color: var(--text); }
.topbar .nav-right { display: flex; gap: 18px; align-items: center; }
.topbar .user { color: var(--muted); }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* ----- Headings & rows ----- */
h1 { margin: 0 0 16px; font-size: 1.6rem; }
h2 { margin: 0 0 12px; font-size: 1.2rem; }
h3 { margin: 0 0 8px;  font-size: 1.05rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ----- Cards ----- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.card.narrow { max-width: 400px; margin: 64px auto; }
.card.empty  { text-align: center; color: var(--muted); }

/* ----- Forms ----- */
form label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.92rem;
    color: var(--muted);
}
form label.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text); }
form input[type="text"],
form input[type="password"],
form select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 4px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
}
form input:focus, form select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ----- Buttons ----- */
.btn {
    display: inline-block;
    padding: 9px 16px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.btn:hover { background: var(--border); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn.danger  { background: var(--danger);  border-color: var(--danger);  color: white; }
.btn.danger:hover  { background: var(--danger-h);  border-color: var(--danger-h); }
.btn.small   { padding: 5px 10px; font-size: 0.83rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----- Alerts ----- */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid;
}
.alert.error { background: rgba(225,90,90,0.1);  border-color: var(--error); }
.alert.ok    { background: rgba(78,192,126,0.1); border-color: var(--ok); }

/* ----- Sessions ----- */
.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.session-card {
    display: block;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text) !important;
    text-decoration: none !important;
    transition: border-color 0.15s, transform 0.15s;
}
.session-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.session-card h3 { margin: 0 0 6px; }
.session-card p  { margin: 0; }

/* ----- Session player page ----- */
.session-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.session-header h1 { margin: 0 0 4px; }
.session-actions { display: flex; gap: 8px; flex-shrink: 0; }

.player-wrap {
    background: black;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
#player {
    width: 100%;
    display: block;
    background: black;
    max-height: calc(100vh - 240px);
}
.status {
    padding: 8px 14px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.status.ok    { color: var(--ok); }
.status.warn  { color: var(--warn); }
.status.error { color: var(--error); }

/* ----- Modals ----- */
.modal {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    min-width: 360px;
    max-width: 90vw;
}
.modal::backdrop { background: rgba(0,0,0,0.6); }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ----- Data tables ----- */
table.data {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
table.data th, table.data td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
table.data th {
    background: var(--surface-2);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--muted);
}
table.data tr:last-child td { border-bottom: 0; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.actions form { margin-left: 4px; }
