/* webrtc-direct — style.css
   Dark theme, video call layout */

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

:root {
    --bg:        #0f0f0f;
    --surface:   #1a1a1a;
    --border:    #2a2a2a;
    --accent:    #6c63ff;
    --accent-h:  #574fd6;
    --warn:      #f59e0b;
    --danger:    #ef4444;
    --text:      #e5e5e5;
    --muted:     #888;
    --radius:    12px;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

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

/* ── Landing card ─────────────────────────────────────────────────────────── */

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    max-width: 440px;
    margin: 80px auto 0;
    padding: 40px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}

.hint {
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
}

.input-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.input-row input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
}

.input-row input:focus {
    border-color: var(--accent);
}

.divider {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
    color: var(--muted);
    font-size: 0.82rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn-primary, .btn-secondary {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
}

.btn-primary:hover  { background: var(--accent-h); }
.btn-primary:active { opacity: 0.85; }

.btn-secondary {
    background: var(--border);
    color: var(--text);
    width: 100%;
}

.btn-secondary:hover { background: #333; }

/* ── Call view ────────────────────────────────────────────────────────────── */

.call-view {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.status-bar {
    background: var(--surface);
    text-align: center;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.video-container {
    flex: 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

.video-full {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-self {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 160px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: #111;
    z-index: 10;
}

/* ── Controls row ─────────────────────────────────────────────────────────── */

.controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.ctrl-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    font-size: 1.4rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:hover  { background: #3a3a3a; }
.ctrl-btn:active { transform: scale(0.95); }

.ctrl-btn.muted   { background: #444; opacity: 0.7; }
.ctrl-btn.warning { background: var(--warn); }
.ctrl-btn.warning:hover { background: #d97706; }
.ctrl-btn.danger  { background: var(--danger); }
.ctrl-btn.danger:hover  { background: #dc2626; }
.ctrl-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Searching overlay ────────────────────────────────────────────────────── */

.searching-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 20;
    color: var(--text);
    font-size: 1.1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ──────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .card { margin: 24px 16px; padding: 28px 20px; }
    .video-self { width: 100px; height: 75px; }
}
