/* ==========================================================================
   Plataforma de Videoaulas - Design System Moderno
   ========================================================================== */

/* Import de Fontes Modernas (Plus Jakarta Sans) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   VariÃ¡veis CSS (Light Mode)
   ========================================================================== */
:root {
    /* Paleta Principal (Tons de LilÃ¡s/Roxo baseados em #B1A1ED e #D0C3F1) */
    --primary-light: #D0C3F1;
    --primary: #B1A1ED;
    --primary-dark: #8c73d9;
    --primary-text: #ffffff; /* Texto branco a pedido do usuario */
    
    /* Backgrounds e SuperfÃ­cies (Light) */
    --bg: #F8FAFC;
    --bg-gradient: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    --surface-glass: rgba(255, 255, 255, 0.7);
    
    /* Texto */
    --text-main: #0F172A;
    --text-muted: #64748B;
    
    /* Bordas e UI */
    --border: #E2E8F0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    /* Estados */
    --danger: #ef4444;
    --success: #10b981;
    
    /* Layout */
    --sidebar-width: 260px;
}

/* ==========================================================================
   VariÃ¡veis CSS (Dark Mode)
   ========================================================================== */
html.dark {
    /* Paleta Principal mantÃ©m-se vibrante, mas texto muda para branco */
    --primary-text: #ffffff;
    
    /* Backgrounds e SuperfÃ­cies (Dark) */
    --bg: #09090b; /* Preto quase absoluto */
    --bg-gradient: linear-gradient(135deg, #09090b 0%, #18181b 100%);
    --surface: #18181b; /* SuperfÃ­cie muito escura */
    --surface-hover: #27272a;
    --surface-glass: rgba(24, 24, 27, 0.7);
    
    /* Texto */
    --text-main: #FAFAFA;
    --text-muted: #A1A1AA;
    
    /* Bordas e UI */
    --border: #27272a;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--primary);
    color: var(--primary-text);
}

/* ==========================================================================
   Componentes Core
   ========================================================================== */

/* BotÃµes */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
}

.btn:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--primary-text);
    border: none;
    box-shadow: 0 4px 14px 0 rgba(177, 161, 237, 0.39);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    box-shadow: 0 6px 20px rgba(177, 161, 237, 0.23);
    color: var(--primary-text);
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Glassmorphism Classes */
.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
html.dark .glass {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Layout - Admin / Dashboard (PainÃ©is)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: #09090b;
    border-right: 1px solid #27272a;
    color: #FAFAFA;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    height: 100dvh;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #27272a;
    font-weight: 800;
    color: var(--primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #A1A1AA;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    color: #FAFAFA;
    background: #27272a;
}

/* Indicador animado na sidebar */
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.sidebar-nav a svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}

.sidebar-nav a:hover svg {
    transform: scale(1.1);
    color: var(--primary);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #27272a;
}

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s;
}

.topbar {
    /* Usando Glassmorphism na topbar dos painÃ©is */
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.content {
    padding: 2.5rem;
    flex: 1;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .topbar { padding: 1rem; }
    .menu-toggle { display: block !important; }
    .content { padding: 1rem; }
}

.sidebar-overlay {
    display: none;
}
@media (max-width: 768px) {
    .sidebar-overlay.open {
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9;
        backdrop-filter: blur(4px);
    }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto; /* Fix for tables breaking layout on mobile */
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    margin-right: 1rem;
}

.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    color: var(--primary);
    transform: rotate(15deg);
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Tabelas (Painel)
   ========================================================================== */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}
th {
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg);
}
th:first-child { border-top-left-radius: var(--radius-md); }
th:last-child { border-top-right-radius: var(--radius-md); }

td {
    padding: 1rem;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

tr { transition: background-color 0.2s ease; }
tr:hover td { background-color: var(--surface-hover); }

/* Inputs e Forms Genéricos */
input, select, textarea {
    font-family: inherit;
    background-color: var(--bg);
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(177, 161, 237, 0.2) !important;
}

/* ==========================================================================
   Layout - Público (Páginas Externas e Autenticação)
   ========================================================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; width: 100%; }

/* Navbar Glassmorphism */
nav.site-header { 
    background: rgba(0, 0, 0, 0.9); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0; 
    border-bottom: 1px solid var(--border); 
    position: sticky; top: 0; z-index: 100; 
}
nav.site-header .container { display: flex; justify-content: space-between; align-items: center; position: relative; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.mobile-nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text-main); }
nav.site-header a { text-decoration: none; color: var(--text-main); font-weight: 600; transition: color 0.2s; }
nav.site-header a:hover { color: var(--primary); }
nav.site-header .brand { font-size: 1.5rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 0.5rem; letter-spacing: -0.5px; }

@media (max-width: 768px) {
    .mobile-nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 1.5rem;
        border: 1px solid var(--border);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        box-shadow: var(--shadow-md);
        gap: 1rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a.btn { width: 100%; text-align: center; justify-content: center; }
}

/* Layout Geral */
.main-content { padding: 2.5rem 0; min-height: calc(100vh - 160px); display: flex; flex-direction: column; }

/* Footer */
footer { text-align: center; padding: 2rem 0; color: var(--text-muted); font-size: 0.875rem; border-top: 1px solid var(--border); margin-top: auto; }

/* Auth Forms Layout (Login / Registro) */
.auth-container { display: flex; align-items: center; justify-content: center; flex: 1; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; }

