/* ===== VARIABLES & RESET ===== */
:root {
    --bg:         #0f1117;
    --bg2:        #1a1d27;
    --bg3:        #22263a;
    --border:     #2e3350;
    --text:       #e2e8f0;
    --text-muted: #8892a4;
    --accent:     #3b82f6;
    --accent-h:   #2563eb;
    --success:    #22c55e;
    --danger:     #ef4444;
    --warning:    #f59e0b;
    --radius:     10px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ===== NAVBAR ===== */
.navbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { font-weight: 700; font-size: 1.1rem; }
.nav-links  { display: flex; align-items: center; gap: 1.25rem; }
.btn-nav {
    background: var(--accent);
    color: #fff;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}
.btn-nav:hover { background: var(--accent-h); text-decoration: none; }

/* ===== CONTAINER ===== */
.container { max-width: 780px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ===== ALERTS ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-error   { background: #3b1515; border: 1px solid var(--danger);  color: #fca5a5; }
.alert-success { background: #0f2e1a; border: 1px solid var(--success); color: #86efac; }

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-h); text-decoration: none; }

.btn-danger {
    display: inline-block;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-danger:hover { background: #3b1515; }

/* ===== AUTH ===== */
.auth-container {
    max-width: 420px;
    margin: 5vh auto;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
}
.auth-container h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.9rem; }
.auth-form { text-align: left; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text-muted); }
.form-group input[type="text"],
.form-group input[type="password"],
input[type="text"] {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.6rem 0.9rem;
    font-size: 1rem;
}
.form-group input:focus, input[type="text"]:focus {
    outline: 2px solid var(--accent);
    border-color: transparent;
}

.auth-form .btn-primary { width: 100%; margin-top: 0.5rem; }
.ssl-notice { margin-top: 1.5rem; color: var(--text-muted); font-size: 0.8rem; }

/* ===== DASHBOARD ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.page-header h2 { font-size: 1.4rem; }

.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state .btn-primary { margin-top: 1rem; }

.meetings-list { display: flex; flex-direction: column; gap: 0.75rem; }

.meeting-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text);
}
.meeting-card:hover { border-color: var(--accent); background: var(--bg3); text-decoration: none; }
.meeting-card-body h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.meeting-meta { display: flex; gap: 1rem; font-size: 0.82rem; color: var(--text-muted); flex-wrap: wrap; }
.mode-tag { background: var(--bg3); padding: 0.1rem 0.5rem; border-radius: 4px; }

/* ===== RECORD ===== */
.record-container { max-width: 520px; margin: 0 auto; }
.record-container h2 { margin-bottom: 1.5rem; }

.mode-selector { margin: 1.25rem 0; }
.mode-selector > label { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.5rem; display: block; }
.mode-options { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.mode-option {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.mode-option:has(input:checked) { border-color: var(--accent); background: var(--bg3); }
.mode-option input { display: none; }
.mode-option small { color: var(--text-muted); }

.recorder-controls { text-align: center; padding: 2rem 0 1rem; }

.timer {
    font-size: 3.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

#status-text { color: var(--text-muted); margin-bottom: 1.5rem; }

.btn-record {
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}
.btn-record:hover { background: #dc2626; transform: scale(1.03); }

.btn-stop {
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}
.btn-stop:hover { background: var(--bg2); }
.btn-stop:disabled { opacity: 0.5; cursor: not-allowed; }

.progress-section { margin-top: 1.5rem; }
.progress-bar-container {
    background: var(--bg3);
    border-radius: 50px;
    height: 10px;
    overflow: hidden;
}
.progress-bar {
    background: var(--accent);
    height: 100%;
    border-radius: 50px;
    transition: width 0.4s ease;
}
#progress-label { text-align: center; margin-top: 0.6rem; font-size: 0.9rem; color: var(--text-muted); }

.wake-lock-notice { margin-top: 2rem; text-align: center; color: var(--text-muted); }

/* ===== MEETING DETAIL ===== */
.back-link { font-size: 0.9rem; color: var(--text-muted); display: block; margin-bottom: 0.75rem; }
.detail-header { margin-bottom: 2rem; }
.detail-header h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.detail-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-muted); flex-wrap: wrap; margin-bottom: 1rem; }
.detail-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.processing-notice {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.detail-section {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.detail-section h3 { font-size: 1.05rem; margin-bottom: 1rem; }

.summary-content { line-height: 1.8; }
.transcript-content {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

details summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; }

/* ===== SPINNER ===== */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .navbar { padding: 0.6rem 1rem; }
    .nav-links { gap: 0.75rem; font-size: 0.9rem; }
    .timer { font-size: 2.5rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

.hidden { display: none !important; }
