/* ============================================================
   Aninha Aulas — Design System
   Dark Mode Premium com Glassmorphism
   ============================================================ */

/* ─── Reset & Variables ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent-purple: #7C3AED;
    --accent-pink: #EC4899;
    --accent-blue: #3B82F6;
    --accent-green: #10B981;
    --accent-yellow: #F59E0B;
    --accent-red: #EF4444;
    --gradient-primary: linear-gradient(135deg, #7C3AED, #EC4899);
    --gradient-secondary: linear-gradient(135deg, #3B82F6, #7C3AED);
    --gradient-bg: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-body: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-purple); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-pink); }
img { max-width: 100%; height: auto; }

/* ─── Glass Effect ─────────────────────────────────────── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

/* ─── Navbar ───────────────────────────────────────────── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 1.5rem;
    height: 64px;
}
.nav-container {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 100%;
}
.nav-logo { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.logo-icon { font-size: 1.5rem; }
.logo-accent, .text-accent { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links { display: flex; gap: 0.25rem; }
.nav-link {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: var(--surface-hover); }
.nav-link.active { background: rgba(124, 58, 237, 0.15); color: var(--accent-purple); }
.nav-link.locked { opacity: 0.5; }
.nav-link-admin { color: var(--accent-yellow) !important; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-stats { display: flex; gap: 0.5rem; }
.stat-badge {
    display: flex; align-items: center; gap: 0.3rem;
    padding: 0.35rem 0.7rem; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600;
    background: var(--surface); border: 1px solid var(--glass-border);
}
.stat-badge.pulse { animation: pulse 0.6s ease; }
.stat-label { color: var(--text-muted); font-size: 0.7rem; }
.avatar-circle {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; cursor: pointer;
    color: white;
}
.nav-avatar { position: relative; }
.avatar-dropdown {
    display: none; position: absolute; top: 100%; right: 0; margin-top: 0.5rem;
    background: var(--bg-secondary); border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: 0.5rem; min-width: 200px;
    box-shadow: var(--shadow-lg); z-index: 100;
}
.avatar-dropdown.show { display: block; }
.dropdown-header { padding: 0.75rem; border-bottom: 1px solid var(--glass-border); }
.dropdown-header strong { display: block; font-size: 0.9rem; }
.dropdown-header small { color: var(--text-muted); font-size: 0.75rem; }
.dropdown-item { display: block; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.85rem; }
.dropdown-item:hover { background: var(--surface-hover); color: var(--text-primary); }

/* Hamburger */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-primary); margin: 5px 0; transition: var(--transition); border-radius: 2px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Main Content ─────────────────────────────────────── */
.main-content { max-width: 1400px; margin: 80px auto 2rem; padding: 0 1.5rem; }

/* ─── Auth Pages ───────────────────────────────────────── */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; overflow: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; }
.auth-orb {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4;
    animation: float 8s ease-in-out infinite;
}
.auth-orb-1 { width: 400px; height: 400px; background: var(--accent-purple); top: -10%; left: -10%; }
.auth-orb-2 { width: 350px; height: 350px; background: var(--accent-pink); bottom: -10%; right: -10%; animation-delay: -3s; }
.auth-orb-3 { width: 250px; height: 250px; background: var(--accent-blue); top: 50%; left: 50%; animation-delay: -5s; }
.auth-container { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.auth-card { padding: 2.5rem; }
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-logo { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.auth-title { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; margin-bottom: 0.25rem; }
.auth-subtitle { color: var(--text-secondary); font-size: 0.95rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; color: var(--text-secondary); font-size: 0.9rem; }
.link-accent { color: var(--accent-purple); font-weight: 600; }
.link-accent:hover { color: var(--accent-pink); }

/* ─── Forms ────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.form-input, .form-textarea {
    width: 100%; padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    color: var(--text-primary); font-family: var(--font-body); font-size: 0.95rem;
    transition: var(--transition); outline: none;
}
.form-input:focus, .form-textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; }

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.7rem 1.5rem; border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
    cursor: pointer; border: none; transition: var(--transition);
    text-decoration: none;
}
.btn-primary { background: var(--gradient-primary); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4); color: white; }
.btn-success { background: var(--accent-green); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--glass-border); color: var(--text-primary); }
.btn-outline:hover { background: var(--surface-hover); color: var(--text-primary); }
.btn-block { width: 100%; }

/* ─── Alerts ───────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #6ee7b7; }

/* ─── Page Headers ─────────────────────────────────────── */
.page-header { margin-bottom: 2rem; }
.page-title { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; margin-bottom: 0.25rem; }
.page-subtitle { color: var(--text-secondary); font-size: 1rem; }
.section-title { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; margin-bottom: 1.25rem; }

/* ─── Breadcrumb ───────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 1.5rem; flex-wrap: wrap; color: var(--text-muted); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent-purple); }
.breadcrumb-sep { color: var(--text-muted); }

/* ─── Progress Bars ────────────────────────────────────── */
.progress-bar-container { display: flex; align-items: center; gap: 0.5rem; }
.progress-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.08); border-radius: 10px; overflow: hidden; }
.progress-bar.mini { height: 6px; }
.progress-fill { height: 100%; background: var(--gradient-primary); border-radius: 10px; transition: width 0.5s ease; min-width: 2px; }
.progress-text { font-size: 0.8rem; font-weight: 600; color: var(--accent-purple); min-width: 35px; }
.progress-text-sm { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Course Cards (Catalog) ───────────────────────────── */
.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem; margin-bottom: 3rem;
}
.curso-card {
    overflow: hidden; transition: var(--transition); cursor: pointer;
    color: var(--text-primary); display: block;
}
.curso-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent-purple); color: var(--text-primary); }
.curso-card-thumb {
    position: relative; height: 180px; overflow: hidden;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    display: flex; align-items: center; justify-content: center;
}
.curso-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.curso-card-icon { font-size: 4rem; }
.curso-badge {
    position: absolute; top: 0.75rem; right: 0.75rem;
    padding: 0.3rem 0.75rem; border-radius: 20px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-new { background: rgba(124, 58, 237, 0.9); color: white; }
.badge-progress { background: rgba(59, 130, 246, 0.9); color: white; }
.badge-success { background: rgba(16, 185, 129, 0.9); color: white; }
.curso-card-body { padding: 1.25rem; }
.curso-card-title { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.curso-card-desc { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 0.75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.curso-card-meta { display: flex; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* ─── Conquistas ───────────────────────────────────────── */
.conquistas-section { margin-top: 2rem; }
.conquistas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.conquista-card { padding: 1.5rem; text-align: center; transition: var(--transition); }
.conquista-card.bloqueada { opacity: 0.5; }
.conquista-card.desbloqueada { border-color: var(--accent-purple); }
.conquista-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }

/* ─── Dashboard ────────────────────────────────────────── */
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.dashboard-info { flex: 1; }
.dashboard-progress { padding: 1.5rem; display: flex; align-items: center; gap: 1.25rem; min-width: 200px; }
.progress-circle { position: relative; width: 70px; height: 70px; }
.circular-chart { width: 100%; height: 100%; }
.circle-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 3; }
.circle-fill { fill: none; stroke: var(--accent-purple); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.progress-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 700; }
.progress-detail { font-size: 0.85rem; color: var(--text-secondary); }

/* ─── Module Cards ─────────────────────────────────────── */
.modulos-list { display: flex; flex-direction: column; gap: 1rem; }
.modulo-card { overflow: hidden; }
.modulo-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem; cursor: pointer; transition: var(--transition); }
.modulo-header:hover { background: var(--surface-hover); }
.modulo-info { display: flex; align-items: center; gap: 1rem; }
.modulo-numero {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gradient-primary); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0; color: white;
}
.modulo-titulo { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; }
.modulo-desc { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.2rem; }
.modulo-right { display: flex; align-items: center; gap: 1rem; }
.modulo-progresso { display: flex; align-items: center; gap: 0.5rem; min-width: 120px; }
.modulo-toggle { font-size: 0.8rem; color: var(--text-muted); transition: var(--transition); }

/* Aulas List */
.modulo-aulas { border-top: 1px solid var(--glass-border); }
.aula-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.85rem 1.25rem 0.85rem 3.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-primary); transition: var(--transition); font-size: 0.9rem;
}
.aula-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.aula-item.concluida { color: var(--text-muted); }
.aula-item.concluida .aula-titulo { text-decoration: line-through; opacity: 0.7; }
.aula-check { font-size: 1rem; }
.aula-titulo { flex: 1; }
.aula-play { color: var(--accent-purple); opacity: 0; transition: var(--transition); }
.aula-item:hover .aula-play { opacity: 1; }

/* ─── Lesson Page (Split Screen) ───────────────────────── */
.aula-container { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; min-height: calc(100vh - 140px); }
.video-wrapper {
    position: relative; width: 100%;
    border-radius: var(--radius-lg); overflow: hidden; background: #000;
}
.video-wrapper iframe { width: 100%; height: 100%; }
.aula-info { margin: 1.25rem 0; }
.aula-titulo { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; }
.aula-modulo { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }
.aula-actions { margin-bottom: 1rem; }
.btn-concluir { font-size: 1rem; padding: 0.85rem 2rem; }
.aula-nav { display: flex; justify-content: space-between; gap: 1rem; }
.btn-nav { font-size: 0.8rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Chat ─────────────────────────────────────────────── */
.chat-section {
    display: flex; flex-direction: column;
    height: calc(100vh - 140px); position: sticky; top: 80px;
}
.chat-header {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
}
.chat-header-info { display: flex; align-items: center; gap: 0.75rem; }
.chat-avatar { font-size: 1.5rem; }
.chat-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; }
.chat-status { font-size: 0.75rem; color: var(--accent-green); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }
.chat-welcome { text-align: center; padding: 2rem 1rem; color: var(--text-secondary); }
.chat-welcome-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.chat-bubble { max-width: 85%; padding: 0.75rem 1rem; border-radius: var(--radius-md); font-size: 0.9rem; line-height: 1.5; word-wrap: break-word; }
.chat-user { align-self: flex-end; background: var(--gradient-primary); color: white; border-bottom-right-radius: 4px; }
.chat-bot { align-self: flex-start; background: rgba(255,255,255,0.08); border-bottom-left-radius: 4px; }
.chat-time { display: block; font-size: 0.65rem; color: rgba(255,255,255,0.4); margin-top: 0.25rem; text-align: right; }
.chat-bot .chat-time { color: var(--text-muted); }

/* Markdown in chat */
.markdown-content h1, .markdown-content h2, .markdown-content h3 { font-family: var(--font-heading); margin: 0.75rem 0 0.5rem; }
.markdown-content h1 { font-size: 1.2rem; } .markdown-content h2 { font-size: 1.1rem; } .markdown-content h3 { font-size: 1rem; }
.markdown-content p { margin-bottom: 0.5rem; }
.markdown-content ul, .markdown-content ol { padding-left: 1.25rem; margin-bottom: 0.5rem; }
.markdown-content code { background: rgba(0,0,0,0.3); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85em; }
.markdown-content pre { background: rgba(0,0,0,0.3); padding: 0.75rem; border-radius: var(--radius-sm); overflow-x: auto; margin: 0.5rem 0; }
.markdown-content pre code { background: none; padding: 0; }
.markdown-content strong { color: var(--accent-purple); }

/* Chat Input */
.chat-input-area {
    display: flex; gap: 0.5rem; padding: 1rem;
    border-top: 1px solid var(--glass-border);
}
.chat-input {
    flex: 1; padding: 0.7rem 1rem; border-radius: 24px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    color: var(--text-primary); font-size: 0.9rem; outline: none;
    font-family: var(--font-body);
}
.chat-input:focus { border-color: var(--accent-purple); }
.btn-send {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--gradient-primary); border: none;
    color: white; font-size: 1.1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.btn-send:hover { transform: scale(1.1); }

/* Shimmer Loading */
.shimmer-container { padding: 0.5rem 0; }
.shimmer-line {
    height: 12px; border-radius: 6px; margin-bottom: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.shimmer-line.short { width: 60%; }

/* ─── Gerador / Roteirizador ───────────────────────────── */
.locked-section { text-align: center; padding: 3rem 2rem; max-width: 500px; margin: 2rem auto; }
.locked-icon { font-size: 4rem; display: block; margin-bottom: 1rem; }
.locked-tip { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.5rem; }
.gerador-container, .roteirizador-container { max-width: 800px; margin: 0 auto; }
.gerador-form, .roteirizador-form { padding: 2rem; margin-bottom: 1.5rem; }
.gerador-form h3, .roteirizador-form h3 { font-family: var(--font-heading); margin-bottom: 1rem; }
.sugestoes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.sugestao-label { font-size: 0.8rem; color: var(--text-muted); width: 100%; }
.btn-sugestao {
    padding: 0.4rem 0.8rem; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-size: 0.8rem; cursor: pointer;
    transition: var(--transition); font-family: var(--font-body);
}
.btn-sugestao:hover { background: rgba(124, 58, 237, 0.15); color: var(--accent-purple); border-color: var(--accent-purple); }
.gerador-input-area, .roteirizador-input-area { display: flex; flex-direction: column; gap: 1rem; }
.btn-gerar { align-self: flex-end; }
.resultado-card { padding: 2rem; text-align: center; }
.imagem-gerada { max-width: 100%; border-radius: var(--radius-md); margin-bottom: 1rem; }
.resultado-actions { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1rem; }
.resultado-texto { text-align: left; color: var(--text-secondary); font-size: 0.9rem; margin-top: 1rem; }
.roteiro-content { text-align: left; }
.spinner-container { padding: 3rem; text-align: center; max-width: 300px; margin: 2rem auto; }
.spinner {
    width: 48px; height: 48px; border: 3px solid var(--glass-border);
    border-top-color: var(--accent-purple); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 0 auto 1rem;
}

/* Tipo Selector */
.tipo-selector { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.tipo-option {
    flex: 1; text-align: center; padding: 0.75rem; border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border); cursor: pointer; transition: var(--transition);
    font-size: 0.9rem;
}
.tipo-option input { display: none; }
.tipo-option.active, .tipo-option:has(input:checked) {
    background: rgba(124, 58, 237, 0.15); border-color: var(--accent-purple); color: var(--accent-purple);
}

/* ─── Admin ────────────────────────────────────────────── */
.admin-body { background: var(--gradient-bg); }
.admin-navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(15, 15, 26, 0.9); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border); height: 60px; padding: 0 1.5rem;
}
.admin-navbar .nav-container { height: 100%; }
.admin-nav-links { display: flex; gap: 0.25rem; }
.admin-content { max-width: 1200px; margin: 76px auto 2rem; padding: 0 1.5rem; }
.admin-user { color: var(--text-secondary); font-size: 0.85rem; }
.btn-logout-sm {
    padding: 0.35rem 0.75rem; border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5; font-size: 0.8rem; cursor: pointer; font-family: var(--font-body);
    text-decoration: none; transition: var(--transition);
}
.btn-logout-sm:hover { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.admin-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.admin-page-header h1 { font-family: var(--font-heading); font-size: 1.6rem; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.admin-stat-card { padding: 1.5rem; display: flex; align-items: center; gap: 1rem; transition: var(--transition); }
.admin-stat-card:hover { transform: translateY(-3px); }
.admin-stat-icon { font-size: 2rem; }
.admin-stat-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; display: block; }
.admin-stat-label { color: var(--text-muted); font-size: 0.85rem; }
.admin-section { margin-bottom: 2rem; }
.admin-section h2 { font-family: var(--font-heading); font-size: 1.2rem; margin-bottom: 1rem; }

/* Admin Tables */
.admin-table-container { padding: 0; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    padding: 0.85rem 1rem; text-align: left;
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); border-bottom: 1px solid var(--glass-border);
    font-weight: 600; background: rgba(0,0,0,0.2);
}
.admin-table td { padding: 0.85rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 0.9rem; vertical-align: middle; }
.admin-table tr:hover td { background: var(--surface-hover); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.status-badge { padding: 0.25rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status-ativo { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.status-inativo { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.badge-pontos { background: rgba(124, 58, 237, 0.15); padding: 0.2rem 0.5rem; border-radius: 12px; font-size: 0.8rem; color: var(--accent-purple); }
.action-btns { display: flex; gap: 0.4rem; }
.btn-action {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border); background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); font-size: 0.85rem;
    text-decoration: none;
}
.btn-action:hover { background: var(--surface-hover); transform: scale(1.1); }
.btn-delete:hover { border-color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }
.yt-preview { display: flex; align-items: center; gap: 0.5rem; }
.yt-thumb { width: 60px; height: 45px; object-fit: cover; border-radius: 4px; }
.yt-preview code { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Modals ───────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal { width: 100%; max-width: 520px; padding: 0; overflow: hidden; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--glass-border); }
.modal-header h3 { font-family: var(--font-heading); font-size: 1.2rem; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; transition: var(--transition); }
.modal-close:hover { color: var(--text-primary); }
.modal form { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding-top: 0.5rem; }
.yt-preview-modal { margin-top: 0.5rem; }
.yt-preview-modal img { width: 120px; border-radius: 6px; }
.empty-text { color: var(--text-muted); font-size: 0.9rem; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 3rem; color: var(--text-secondary); }
.empty-icon { font-size: 3rem; display: block; margin-bottom: 0.5rem; }

/* ─── Footer ───────────────────────────────────────────── */
.footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--glass-border); margin-top: 3rem; }
.footer-small { font-size: 0.75rem; margin-top: 0.25rem; }

/* ─── Animations ───────────────────────────────────────── */
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -30px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes confetti-fall { 0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }

.fade-in { animation: fadeIn 0.4s ease; }

/* Confetti */
.confetti { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; }
.confetti-piece {
    position: absolute; width: 10px; height: 10px; top: -10px;
    animation: confetti-fall 3s ease-in forwards;
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
    .aula-container { grid-template-columns: 1fr; gap: 1rem; min-height: auto; }
    .chat-section { height: 450px; position: static; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none; position: absolute; top: 64px; left: 0; right: 0;
        background: rgba(15, 15, 26, 0.95); backdrop-filter: blur(20px);
        flex-direction: column; padding: 1rem;
        border-bottom: 1px solid var(--glass-border);
    }
    .nav-links.active { display: flex; }
    .hamburger { display: block; }
    .nav-stats { display: none; }
    .cursos-grid { grid-template-columns: 1fr; }
    .dashboard-header { flex-direction: column; gap: 1rem; }
    .dashboard-progress { width: 100%; justify-content: center; }
    .form-row { grid-template-columns: 1fr; }
    .admin-nav-links { display: none; }
    .aula-nav { flex-direction: column; gap: 0.5rem; }
    .aula-nav .btn-nav { max-width: 100%; width: 100%; text-align: center; }
    .tipo-selector { flex-direction: column; }
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-title { font-size: 1.5rem; }
    
    /* Melhorias para o Chat no Celular */
    .chat-section { height: 400px; }
    .chat-messages { padding: 0.75rem; gap: 0.5rem; }
    .chat-bubble { max-width: 90%; padding: 0.6rem 0.85rem; font-size: 0.85rem; }
    .chat-input-area { padding: 0.75rem; }
    .chat-input { padding: 0.6rem 0.85rem; font-size: 0.85rem; }
    .btn-send { width: 36px; height: 36px; font-size: 0.95rem; }
    .aula-item { padding-left: 2rem; }
}

@media (max-width: 480px) {
    .auth-card { padding: 1.5rem 1rem; }
    .main-content { padding: 0 0.75rem; margin-top: 76px; }
    .admin-stats-grid { grid-template-columns: 1fr; }
    .page-header { margin-bottom: 1.25rem; }
    .page-title { font-size: 1.4rem; }
    .page-subtitle { font-size: 0.85rem; }
    .breadcrumb { font-size: 0.75rem; margin-bottom: 1rem; }
    
    /* Ajustes das Conquistas */
    .conquistas-grid { grid-template-columns: 1fr; }
    .conquista-card { padding: 1.25rem 1rem; }
    
    /* Formulários de Autenticação */
    .auth-title { font-size: 1.7rem; }
    .auth-subtitle { font-size: 0.85rem; }
}

/* ─── Profile Page ─────────────────────────────────────── */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
}
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.profile-card-sidebar {
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-avatar-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}
.profile-avatar-large {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-purple);
    box-shadow: var(--shadow-lg);
}
.profile-avatar-large-initials {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-lg);
}
.profile-user-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.profile-user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.profile-stats-card {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: space-around;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}
.profile-stat-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0.25rem 0;
}
.profile-stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.profile-card-form {
    padding: 2.5rem;
}
.profile-card-form h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.form-divider {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 1rem 0;
}
.form-section-title {
    font-size: 1.05rem;
    font-weight: 600;
}
.form-section-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -0.5rem;
    margin-bottom: 0.25rem;
}
.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-purple);
    cursor: pointer;
}

/* responsive details for profile */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── PWA Install Banner ───────────────────────────────── */
.pwa-install-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
    padding: 1.25rem;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-purple);
}
.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.pwa-banner-icon {
    font-size: 2.2rem;
}
.pwa-banner-content h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
}
.pwa-banner-content p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.pwa-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}
.btn-pwa-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
}
.btn-pwa-close:hover {
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .pwa-install-banner {
        bottom: 16px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .pwa-banner-content {
        flex-direction: column;
        text-align: center;
    }
    .pwa-banner-actions {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
}

/* ─── Splash Screen ────────────────────────────────────── */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: #0f0f1a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}
.splash-content {
    text-align: center;
    animation: fadeIn 0.6s ease;
}
.splash-logo {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: float 4s ease-in-out infinite;
}
.splash-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}
.splash-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.25rem;
}
.splash-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* ─── Keyframe Animations ───────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
