/* =====================================================================
   KingConference — Design System (Zinc/Indigo, extraído de preview_media.html)
   ===================================================================== */
:root {
    --bg-base: #FAFAFA;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F4F4F5;

    --border-subtle: #E4E4E7;
    --border-strong: #D4D4D8;

    --text-primary: #09090B;
    --text-secondary: #71717A;
    --text-tertiary: #A1A1AA;

    --brand-main: #4F46E5;
    --brand-hover: #4338CA;
    --brand-surface: #EEF2FF;

    --status-success: #10B981;
    --status-danger: #EF4444;
    --status-warning: #F59E0B;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-base: #09090B;
    --bg-surface: #18181B;
    --bg-surface-hover: #27272A;

    --border-subtle: #27272A;
    --border-strong: #3F3F46;

    --text-primary: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-tertiary: #52525B;

    --brand-main: #6366F1;
    --brand-hover: #818CF8;
    --brand-surface: rgba(99, 102, 241, 0.1);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; }

/* =====================================================================
   SHELL (Header + Sidebar) — usado no dashboard
   ===================================================================== */
.app-container { display: flex; width: 100%; height: 100vh; overflow: hidden; }

.app-sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand-logo {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--border-subtle);
}
.brand-logo i { color: var(--brand-main); font-size: 24px; }

.nav-section { padding: 24px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; border-radius: var(--radius-md);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    transition: var(--transition-smooth);
}
.nav-link:hover { background-color: var(--bg-surface-hover); color: var(--text-primary); }
.nav-link.active { background-color: var(--brand-surface); color: var(--brand-main); font-weight: 600; }
.nav-link i { font-size: 18px; }

.sidebar-footer {
    padding: 24px; border-top: 1px solid var(--border-subtle);
    display: flex; align-items: center; gap: 12px;
}
.avatar-badge {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--brand-surface); color: var(--brand-main);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 12px;
}

.app-header {
    height: 64px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; flex-shrink: 0;
}

.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background-color: var(--bg-base); }
.main-scroll-area { flex: 1; overflow-y: auto; padding: 32px 40px; }

.icon-action {
    width: 36px; height: 36px; border-radius: var(--radius-md);
    border: 1px solid transparent; background: transparent; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    cursor: pointer; transition: var(--transition-smooth);
}
.icon-action:hover { background-color: var(--bg-surface-hover); color: var(--text-primary); border-color: var(--border-subtle); }

/* =====================================================================
   BUTTONS / FORMS
   ===================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; font-size: 14px; font-weight: 500; border-radius: var(--radius-md);
    cursor: pointer; transition: var(--transition-smooth);
    border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--bg-surface-hover); }
.btn-primary { background: var(--brand-main); color: #fff; border-color: transparent; }
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-danger { background: var(--status-danger); color: #fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.field input {
    padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
    background: var(--bg-base); color: var(--text-primary); font-size: 14px; outline: none;
    transition: var(--transition-smooth);
}
.field input:focus { border-color: var(--brand-main); box-shadow: 0 0 0 3px var(--brand-surface); }

/* =====================================================================
   AUTH CARD (login / join)
   ===================================================================== */
.auth-screen {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at top, var(--brand-surface) 0%, var(--bg-base) 60%);
    padding: 24px;
}
.auth-card {
    width: 100%; max-width: 400px; background: var(--bg-surface);
    border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 32px;
}
.auth-logo {
    display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px;
    margin-bottom: 8px;
}
.auth-logo i { color: var(--brand-main); font-size: 26px; }
.auth-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }
.auth-error {
    display: none; background: rgba(239, 68, 68, 0.1); color: var(--status-danger);
    padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: 16px;
    align-items: center; gap: 8px;
}
.auth-error.visible { display: flex; }

/* =====================================================================
   CARDS (dashboard: lista de salas)
   ===================================================================== */
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.room-card {
    background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
    padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm);
}
.room-card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.room-card-meta { font-size: 12px; color: var(--text-tertiary); }
.room-card-actions { display: flex; gap: 8px; margin-top: auto; }
.room-card-actions .btn { flex: 1; padding: 8px 12px; font-size: 13px; }

.empty-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 64px 24px; color: var(--text-tertiary); text-align: center; gap: 12px;
}
.empty-state i { font-size: 40px; }

/* =====================================================================
   TOASTS & MODALS
   ===================================================================== */
#toast-region {
    position: fixed; bottom: 24px; right: 24px;
    display: flex; flex-direction: column; gap: 12px; z-index: 9999; pointer-events: none;
}
.premium-toast {
    background: var(--text-primary); color: var(--bg-surface);
    padding: 14px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 12px;
    pointer-events: auto; animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.premium-toast.error { background: var(--status-danger); color: #FFF; }
.premium-toast i { font-size: 20px; }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.premium-modal {
    background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 24px;
    transform: scale(0.95); transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.open .premium-modal { transform: scale(1); }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }

.invite-box {
    display: flex; gap: 8px; margin-bottom: 20px;
}
.invite-box input {
    flex: 1; padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
    background: var(--bg-base); color: var(--text-primary); font-family: var(--font-mono); font-size: 13px;
}

@media (max-width: 900px) {
    .app-sidebar { display: none; }
    .main-scroll-area { padding: 20px 16px; }
}
