/* ══════════════════════════════════════════
   Live Victorina — Design System
   Two themes: light (default, green) + dark
   ══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Light Theme (default) ── */
:root, [data-theme="light"] {
    --bg: #f6f8fa;
    --bg-card: #ffffff;
    --bg-input: #f0f2f5;
    --bg-hover: #e8eaef;
    --border: #d8dbe5;
    --border-hover: #b8bdd0;
    --text: #1a1d2d;
    --text-muted: #6b7085;
    --primary: #2ea043;
    --primary-hover: #27893a;
    --primary-glow: rgba(46, 160, 67, 0.12);
    --success: #2ea043;
    --success-bg: rgba(46, 160, 67, 0.08);
    --danger: #dc3c3c;
    --danger-bg: rgba(220, 60, 60, 0.08);
    --warning: #d4a020;
    --warning-bg: rgba(212, 160, 32, 0.08);
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    color-scheme: light;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
    --bg: #0c0e14;
    --bg-card: #161923;
    --bg-input: #1e2230;
    --bg-hover: #232840;
    --border: #272d42;
    --border-hover: #3a4260;
    --text: #eaecf0;
    --text-muted: #7c829a;
    --primary: #3fb950;
    --primary-hover: #2ea043;
    --primary-glow: rgba(63, 185, 80, 0.15);
    --success: #3fb950;
    --success-bg: rgba(63, 185, 80, 0.1);
    --danger: #f06c6c;
    --danger-bg: rgba(240, 108, 108, 0.1);
    --warning: #f0c060;
    --warning-bg: rgba(240, 192, 96, 0.1);
    --shadow: 0 4px 24px rgba(0,0,0,0.25);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.35);
    color-scheme: dark;
}

/* ── Transitions ── */
body, .navbar, .card, .auth-card, .modal, .project-card,
input, textarea, select, .btn-outline, .tab, .badge {
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

html { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.nav-logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text) !important;
    text-decoration: none !important;
    letter-spacing: -0.02em;
}
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.nav-user { color: var(--text-muted); font-size: 0.9rem; }

/* Theme toggle */
.theme-toggle {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: all 0.15s;
}
.theme-toggle:hover { border-color: var(--border-hover); color: var(--text); }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: var(--text);
    letter-spacing: -0.01em;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 16px var(--primary-glow); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-hover); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-icon {
    width: 36px; height: 36px; padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
}

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 600;
}
input[type="text"], input[type="password"], input[type="number"],
textarea, select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
textarea { resize: vertical; min-height: 80px; }

.form-error {
    color: var(--danger);
    font-size: 1.05rem;
    font-weight: 600;
    min-height: 1.3rem;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    text-align: center;
}
.form-error:not(:empty) {
    background: var(--danger-bg, rgba(248,81,73,0.1));
    border: 1px solid var(--danger);
}
.form-error a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Auth Pages ── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background:
        radial-gradient(ellipse at 30% 20%, var(--primary-glow) 0%, transparent 50%),
        var(--bg);
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.25rem;
    letter-spacing: -0.03em;
}
.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.auth-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 1.05rem;
    color: var(--text-muted);
}
.auth-link a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.card-title { font-size: 1.1rem; font-weight: 600; }

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.page-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }

/* ── Grid ── */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── Project Card ── */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}
.project-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 32px var(--primary-glow);
    transform: translateY(-2px);
}
.project-card h3 { font-size: 1.1rem; margin-bottom: 0.35rem; font-weight: 600; }
.project-card p { font-size: 0.85rem; color: var(--text-muted); }

/* ── List items ── */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item-info { flex: 1; }
.list-item-title { font-weight: 500; }
.list-item-sub { font-size: 0.8rem; color: var(--text-muted); }
.list-item-actions { display: flex; gap: 0.5rem; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab {
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Badge ── */
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-primary { background: var(--primary-glow); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state p { font-size: 0.95rem; }

/* ── Modal ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ── Invite link ── */
.invite-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85rem;
    word-break: break-all;
    border: 1px solid var(--border);
}
.invite-box .btn { flex-shrink: 0; }

/* ── Utility ── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
