/*
  StreamIt - CSS Design System
  Copyright (C) 2026 StreamIt Dev Team
  Licensed under GNU GPL v3.0 (Code & Interface)
  All other creative assets (design, graphics) licensed under CC BY-NC-SA 4.0
*/

/* ── Custom Properties / Variables ───────────────────────────────────────── */
:root {
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Light Theme (Default) */
    --bg-base: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.6);
    --bg-surface-opaque: #ffffff;
    --border-color: rgba(226, 232, 240, 0.8);
    --border-glow: rgba(99, 102, 241, 0.15);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.2);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --glass-blur: 16px;
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --gradient-hero: linear-gradient(135deg, #e0e7ff 0%, #fae8ff 100%);
}

/* System Dark Mode / Explicit Class Theme Override */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #090d16;
        --bg-surface: rgba(15, 23, 42, 0.4);
        --bg-surface-opaque: #0f172a;
        --border-color: rgba(51, 65, 85, 0.5);
        --border-glow: rgba(99, 102, 241, 0.25);
        
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        
        --primary: #6366f1;
        --primary-hover: #818cf8;
        --primary-glow: rgba(99, 102, 241, 0.3);
        
        --glass-border: rgba(255, 255, 255, 0.05);
        --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.05);
        --gradient-hero: linear-gradient(135deg, #090e1a 0%, #1e112c 100%);
    }
}

/* Manual Light/Dark Theme override via HTML attributes */
html[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.6);
    --bg-surface-opaque: #ffffff;
    --border-color: rgba(226, 232, 240, 0.8);
    --border-glow: rgba(99, 102, 241, 0.15);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.2);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --gradient-hero: linear-gradient(135deg, #e0e7ff 0%, #fae8ff 100%);
}

html[data-theme="dark"] {
    --bg-base: #090d16;
    --bg-surface: rgba(15, 23, 42, 0.4);
    --bg-surface-opaque: #0f172a;
    --border-color: rgba(51, 65, 85, 0.5);
    --border-glow: rgba(99, 102, 241, 0.25);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.05);
    --gradient-hero: linear-gradient(135deg, #090e1a 0%, #1e112c 100%);
}

/* ── Base resets ─────────────────────────────────────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.15s ease;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Layout Elements ─────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-item {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    color: var(--primary);
}

.nav-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 9999px;
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.nav-btn:hover {
    background-color: var(--primary-hover);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Footer style */
.footer {
    backdrop-filter: blur(var(--glass-blur));
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 2rem 1.5rem;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 1.5rem;
}

.footer-col h4 {
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.4rem;
}

.footer-col ul li a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* ── Premium Glassmorphism Cards ─────────────────────────────────────────── */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 1.2rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-main);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, #a855f7 100%);
    opacity: 0.8;
}

/* ── Page Specific Styles ────────────────────────────────────────────────── */

/* 1. Hero / Main page */
.hero-section {
    text-align: center;
    padding: 4rem 1.5rem;
    border-radius: 2rem;
    background: var(--gradient-hero);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-main);
    border: 1px solid var(--glass-border);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.8rem;
    border-radius: 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

/* Feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 1.2rem;
    padding: 2rem;
    box-shadow: var(--shadow-main);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.8rem;
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Contribution and Info Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/* 2. Login / Register form styles */
.auth-container {
    max-width: 480px;
    width: 100%;
    margin: 3rem auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem 0;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.8rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-opaque);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-action-btn {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-glow);
    color: var(--primary);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.input-action-btn:hover {
    background-color: var(--primary);
    color: #ffffff;
}

.form-submit-btn {
    width: 100%;
    margin-top: 1.5rem;
    background-color: var(--primary);
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.form-submit-btn:hover {
    background-color: var(--primary-hover);
}

/* 3. Dashboard and Table styling */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-main);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 0.2rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-opaque);
    margin-bottom: 2rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background-color: var(--bg-base);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: rgba(99, 102, 241, 0.03);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* ── Typography & Markdown-like pages ────────────────────────────────────── */
.document-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto 3rem;
}

.document-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.document-content {
    font-size: 0.98rem;
    color: var(--text-secondary);
}

.document-content h2 {
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
}

.document-content p {
    margin-bottom: 1.2rem;
}

.document-content ul, .document-content ol {
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

.document-content li {
    margin-bottom: 0.4rem;
}

.document-content code {
    font-family: monospace;
    background-color: var(--border-color);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.document-content pre {
    background-color: var(--bg-base);
    padding: 1.25rem;
    border-radius: 0.8rem;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin-bottom: 1.2rem;
}

.document-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.85rem;
}

/* ── Theme Switcher ──────────────────────────────────────────────────────── */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
}

.theme-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background-color: var(--primary-glow);
}

/* ── Alerts & Notifications ──────────────────────────────────────────────── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.8rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.alert-info {
    background-color: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Loading Spinner ─────────────────────────────────────────────────────── */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-base);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ── Responsive adjustments ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
    .info-section { grid-template-columns: 1fr; }
}

/* ── Language system ─────────────────────────────────────────────────────── */
/* Default: Korean. JS adds lang-en to <html> to switch. */
.en-only { display: none; }
html.lang-en .ko-only { display: none !important; }
html.lang-en .en-only { display: revert; }

.lang-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.28rem 0.6rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    height: 2.2rem;
    display: flex;
    align-items: center;
}
.lang-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background-color: var(--primary-glow);
}

/* ── Security page bilingual layout ──────────────────────────────────────── */
.bilingual-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
    align-items: start;
}
.bilingual-section .lang-col {
    border-radius: 0.8rem;
    padding: 1.5rem;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
}
.bilingual-section .lang-col h2 {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}
.notice-box {
    border-radius: 0.8rem;
    padding: 1rem 1.25rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 1rem;
}
.notice-box strong { color: var(--primary); }

@media (max-width: 768px) {
    .bilingual-section { grid-template-columns: 1fr; gap: 1rem; }
}

/* ── Button loading state ────────────────────────────────────────────────── */
.btn-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    vertical-align: -0.1em;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.form-submit-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Password toggle ─────────────────────────────────────────────────────── */
.pw-toggle {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    line-height: 0;
    border-radius: 4px;
}
.pw-toggle:hover { color: var(--primary); }
.form-input.has-pw-toggle { padding-right: 2.8rem; }

/* ── Password strength ───────────────────────────────────────────────────── */
.pw-strength-bar {
    margin-top: 0.45rem;
    height: 3px;
    background: var(--border-color);
    border-radius: 99px;
    overflow: hidden;
}
.pw-strength-fill {
    height: 100%;
    border-radius: 99px;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}
.pw-hint {
    margin-top: 0.3rem;
    font-size: 0.74rem;
    color: var(--text-muted);
    min-height: 1.1em;
    transition: color 0.2s;
}

/* ── OTP UI ──────────────────────────────────────────────────────────────── */
#group-code { display: none; }
#group-code.visible {
    display: block;
    animation: fade-down 0.3s ease both;
}
.otp-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.3rem;
    font-size: 0.76rem;
}
.otp-timer {
    font-weight: 600;
    color: var(--warning);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.otp-timer.expired { color: var(--danger); }
.otp-resend-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.otp-resend-btn:disabled {
    color: var(--text-muted);
    cursor: default;
    text-decoration: none;
}
.input-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Toast system ────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    background: var(--bg-surface-opaque);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.72rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    min-width: 240px;
    max-width: 380px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    pointer-events: auto;
    animation: toast-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    color: var(--text-primary);
    line-height: 1.45;
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-danger  { border-left: 3px solid var(--danger); }
.toast.toast-info    { border-left: 3px solid var(--primary); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.dismissing    { animation: toast-out 0.22s ease forwards; }
.toast-icon          { flex-shrink: 0; margin-top: 0.1rem; line-height: 0; }
.toast-body          { flex: 1; }
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    margin-top: -0.1rem;
}
.toast-close:hover { color: var(--text-primary); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(18px) scale(0.94); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); max-height: 80px; }
    to   { opacity: 0; transform: translateX(18px); max-height: 0; padding: 0; margin: 0; }
}

/* ── Pending user rows (dashboard) ──────────────────────────────────────── */
.pending-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
    gap: 0.75rem;
}
.pending-user-row:last-child { border-bottom: none; }
.pending-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.pending-user-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pending-user-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Skeleton loader ─────────────────────────────────────────────────────── */
.skeleton-row {
    height: 52px;
    background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-base) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: 0.6rem;
    margin-bottom: 0.5rem;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Select styling ──────────────────────────────────────────────────────── */
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
    height: 44px;
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fade-down {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-container { animation: fade-down 0.35s ease both; }

/* ── Mobile hamburger menu ───────────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .hamburger { display: flex; }

    .navbar {
        position: relative;
        padding: 0.8rem 1.25rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        background: var(--bg-surface-opaque);
        border-bottom: 1px solid var(--border-color);
        padding: 0.75rem 1.25rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    }
    .nav-links.open { display: flex; animation: fade-down 0.2s ease; }
    .nav-links .nav-item { padding: 0.4rem 0; }
    .nav-links .nav-btn { width: 100%; text-align: center; margin-top: 0.4rem; border-radius: 0.7rem; }
    .nav-links .theme-toggle-btn { align-self: flex-start; }

    #toast-container { bottom: 1rem; right: 0.75rem; left: 0.75rem; }
    .toast { min-width: unset; max-width: unset; }
}
