/**
 * style.css - Sistema de Diseño y Estilos para EduCraft AI
 * Suite Pedagógica y Entorno Escolar para Docentes
 */

/* ======================================================== */
/* 1. VARIABLES GLOBALES Y PALETA PEDAGÓGICA                */
/* ======================================================== */
:root {
    /* Fondos y Superficies */
    --bg-main: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f2937;
    --bg-surface-card: rgba(31, 41, 55, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.18);
    
    /* Colores Principales */
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    /* Modelos de Inteligencia Artificial */
    --sunburst: #f59e0b;
    --sunburst-glow: rgba(245, 158, 11, 0.25);
    --luna: #8b5cf6;
    --luna-glow: rgba(139, 92, 246, 0.25);
    --flare: #ef4444;
    --flare-glow: rgba(239, 68, 68, 0.25);

    /* Estados y Utilidades */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --info: #0284c7;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Textos */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-accent: #ffffff;

    /* Fuentes y Radios */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;

    /* Sombras y Transiciones */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======================================================== */
/* 2. RESET Y ESTILOS BASE                                  */
/* ======================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

button, input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    border: none;
    outline: none;
}

button {
    cursor: pointer;
    transition: var(--transition);
}

.hidden {
    display: none !important;
}

/* Utilidades de Texto */
.gradient-text {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-amber { color: var(--sunburst); }
.text-purple { color: var(--luna); }
.text-red { color: var(--flare); }
.text-emerald { color: var(--success); }
.text-blue { color: var(--info); }

/* ======================================================== */
/* 3. VISTA DE AUTENTICACIÓN (LOGIN & REGISTRO)              */
/* ======================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
                var(--bg-main);
}

.auth-container {
    width: 100%;
    max-width: 1050px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.auth-hero {
    padding: 3rem;
    background: linear-gradient(145deg, rgba(31, 41, 55, 0.7) 0%, rgba(17, 24, 39, 0.95) 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-pill);
    color: #a5b4fc;
    font-size: 0.825rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.auth-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.hero-tagline {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.5;
}

.model-features-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--border-color-hover);
    transform: translateX(4px);
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.feature-icon.sunburst { background: var(--sunburst-glow); color: var(--sunburst); }
.feature-icon.luna { background: var(--luna-glow); color: var(--luna); }
.feature-icon.flare { background: var(--flare-glow); color: var(--flare); }

.feature-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.feature-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.auth-credits-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
}

.bolt-icon {
    font-size: 1.6rem;
    color: #34d399;
}

.auth-credits-banner strong {
    display: block;
    font-size: 0.95rem;
    color: #34d399;
}

.auth-credits-banner p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Columna Formulario */
.auth-card {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-surface);
}

.auth-tabs {
    display: flex;
    background: var(--bg-main);
    padding: 0.35rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--text-on-accent);
    box-shadow: 0 2px 8px var(--primary-glow);
}

.form-title {
    margin-bottom: 1.5rem;
}

.form-title h3 {
    font-size: 1.45rem;
    margin-bottom: 0.35rem;
}

.form-title p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.input-group input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: var(--transition);
}

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

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 2.75rem;
}

.btn-toggle-eye {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    color: var(--text-muted);
    padding: 0.4rem;
}

.btn-toggle-eye:hover {
    color: var(--text-primary);
}

.btn-primary-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-on-accent);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Caja de Acceso Rápido de Demostración */
.demo-access-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(31, 41, 55, 0.4);
    border: 1px dashed var(--border-color-hover);
    border-radius: var(--radius-md);
}

.demo-access-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.demo-credentials-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.demo-credentials-row .chip {
    padding: 0.3rem 0.65rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.demo-credentials-row .chip strong {
    color: var(--text-primary);
}

.btn-demo-fill {
    margin-left: auto;
    padding: 0.35rem 0.75rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fde68a;
    border-radius: var(--radius-sm);
    font-size: 0.785rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-demo-fill:hover {
    background: rgba(245, 158, 11, 0.25);
}

/* ======================================================== */
/* 4. BARRA DE NAVEGACIÓN SUPERIOR (TOP NAVBAR)             */
/* ======================================================== */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-navbar {
    height: 70px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 50;
    gap: 1rem;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    font-size: 1.15rem;
    color: var(--text-secondary);
    background: transparent;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    font-size: 1.75rem;
    color: var(--primary-light);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.app-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.app-subtitle {
    font-size: 0.725rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Selector Central de Modelos */
.navbar-center {
    display: flex;
    align-items: center;
}

.model-pill-selector {
    display: flex;
    background: var(--bg-main);
    padding: 0.25rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    gap: 0.25rem;
}

.model-pill-btn {
    padding: 0.45rem 0.9rem;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: var(--transition);
}

.model-pill-btn .cost-badge {
    padding: 0.1rem 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.model-pill-btn.active {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.model-pill-btn[data-model="gpt-2.5-flare"].active {
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
.model-pill-btn[data-model="gpt-2.5-sunburst"].active {
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fde68a;
}
.model-pill-btn[data-model="gpt-6-luna"].active {
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #d8b4fe;
}

/* Widget de Créditos y Recarga 24h */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.credits-widget {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.45rem 0.9rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 145px;
}

.credits-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.credits-count-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.bolt-pulse {
    color: #fbbf24;
    animation: boltGlow 2s infinite ease-in-out;
}

@keyframes boltGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

.credits-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: #fbbf24;
}

.credits-max {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.credits-timer-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.725rem;
    color: var(--text-secondary);
}

.credits-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.credits-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #10b981);
    transition: width 0.4s ease;
}

/* Menú Perfil */
.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--primary-light);
    object-fit: cover;
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.btn-logout {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}

.btn-logout:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ======================================================== */
/* 5. ESTRUCTURA CENTRAL (SIDEBAR + CHAT WORKSPACE)          */
/* ======================================================== */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Sidebar */
.app-sidebar {
    width: 320px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.25rem;
    gap: 1.5rem;
    flex-shrink: 0;
}

.app-sidebar::-webkit-scrollbar {
    width: 5px;
}
.app-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-pill);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Tarjetas de Modelos en Sidebar */
.models-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.model-card {
    padding: 0.85rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.model-card:hover {
    border-color: var(--border-color-hover);
    background: rgba(31, 41, 55, 0.5);
}

.model-card.active {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary-light), 0 4px 12px var(--primary-glow);
    background: var(--bg-surface-elevated);
}

.model-card#card-gpt-2.5-sunburst.active {
    border-color: var(--sunburst);
    box-shadow: 0 0 0 1px var(--sunburst), 0 4px 12px var(--sunburst-glow);
}

.model-card#card-gpt-6-luna.active {
    border-color: var(--luna);
    box-shadow: 0 0 0 1px var(--luna), 0 4px 12px var(--luna-glow);
}

.model-card#card-gpt-2.5-flare.active {
    border-color: var(--flare);
    box-shadow: 0 0 0 1px var(--flare), 0 4px 12px var(--flare-glow);
}

.model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.model-name {
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.model-cost {
    padding: 0.15rem 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.model-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.model-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.675rem;
    font-weight: 600;
}

.tag-amber { background: rgba(245, 158, 11, 0.15); color: #fde68a; }
.tag-purple { background: rgba(139, 92, 246, 0.15); color: #d8b4fe; }
.tag-red { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

/* Cuadrícula de Acciones de Aula */
.quick-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.quick-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
    padding: 0.75rem 0.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
}

.quick-tool-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-color-hover);
    background: var(--bg-surface-elevated);
    transform: translateY(-1px);
}

.tool-icon-slides { color: #f59e0b; font-size: 1.25rem; }
.tool-icon-workshop { color: #10b981; font-size: 1.25rem; }
.tool-icon-image { color: #38bdf8; font-size: 1.25rem; }
.tool-icon-angles { color: #a855f7; font-size: 1.25rem; }

/* Lista de Plantillas */
.templates-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.template-item {
    padding: 0.6rem 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.template-item:hover {
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
    border-color: var(--border-color-hover);
}

.saved-decks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.empty-state-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem;
    text-align: center;
}

/* ======================================================== */
/* 6. ÁREA DE CHAT Y WORKSPACE                              */
/* ======================================================== */
.chat-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.04) 0%, transparent 60%),
                var(--bg-main);
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}
.chat-messages-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-pill);
}

/* Mensajes */
.chat-message {
    display: flex;
    gap: 1.1rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    animation: fadeIn 0.25s ease-out;
}

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

.chat-message.user-message {
    justify-content: flex-end;
}

.chat-message.user-message .message-content {
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
    border: none;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    padding: 1.25rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-sm);
    line-height: 1.65;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.assistant-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.badge-role {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.model-used-badge {
    margin-left: auto;
    font-size: 0.725rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.message-text {
    font-size: 0.95rem;
}

.message-text p {
    margin-bottom: 0.85rem;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul, .message-text ol {
    margin: 0.5rem 0 0.85rem 1.5rem;
}

.message-text li {
    margin-bottom: 0.35rem;
}

.message-text blockquote {
    margin: 0.85rem 0;
    padding: 0.65rem 1rem;
    background: rgba(79, 70, 229, 0.08);
    border-left: 4px solid var(--primary-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
}

.message-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.message-text th, .message-text td {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.message-text th {
    background: var(--bg-surface-elevated);
    font-weight: 600;
}

/* Tarjetas de Acción de Bienvenida */
.welcome-action-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.action-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    background: var(--bg-surface-elevated);
}

.action-card i {
    font-size: 1.5rem;
}

.action-card strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.action-card span {
    font-size: 0.775rem;
    color: var(--text-secondary);
}

/* ======================================================== */
/* 7. WIDGET DE DIAPOSITIVAS INTERACTIVAS (SLIDE VIEWER)     */
/* ======================================================== */
.slide-deck-container {
    margin: 1.25rem 0;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.deck-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.15rem;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color);
}

.deck-title-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.deck-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-deck-action {
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

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

/* Tarjeta de Diapositiva Individual */
.slide-card-viewport {
    padding: 2.25rem 2rem;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(145deg, #131b2e 0%, #0d121f 100%);
    position: relative;
}

.slide-badge-category {
    align-self: flex-start;
    padding: 0.25rem 0.65rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-pill);
    color: #fde68a;
    font-size: 0.725rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.slide-card-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1.15rem;
}

.slide-card-bullets {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.slide-bullet-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.slide-bullet-dot {
    color: var(--primary-light);
    margin-top: 0.25rem;
    font-size: 0.65rem;
}

.slide-interactive-box {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px dashed rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: #93c5fd;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Navegación de Diapositivas */
.deck-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}

.deck-nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-nav-slide {
    padding: 0.4rem 0.85rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-nav-slide:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-nav-slide:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.deck-pagination-dots {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.deck-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.deck-dot.active {
    width: 22px;
    background: var(--primary-light);
}

/* Acordeón de Notas del Docente */
.deck-teacher-notes {
    border-top: 1px solid var(--border-color);
    background: rgba(17, 24, 39, 0.9);
}

.deck-notes-header {
    padding: 0.65rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.deck-notes-body {
    padding: 0.85rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    border-top: 1px dashed var(--border-color);
}

/* ======================================================== */
/* 8. CONTENEDOR DE IMÁGENES DIDÁCTICAS Y MULTI-ÁNGULO      */
/* ======================================================== */
.ai-image-container {
    margin: 1.25rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    position: relative;
}

.ai-image-container img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
}

.ai-image-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}

.image-meta-text {
    font-size: 0.775rem;
    color: var(--text-muted);
}

.btn-download-image {
    padding: 0.35rem 0.75rem;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-download-image:hover {
    background: var(--primary-light);
}

/* ======================================================== */
/* 9. ENTRADA DE MENSAJES INFERIOR (INPUT DOCK)             */
/* ======================================================== */
.chat-input-wrapper {
    padding: 1rem 2.5rem 1.5rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prompt-chips-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.prompt-chips-bar::-webkit-scrollbar {
    height: 3px;
}
.prompt-chips-bar::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

.chip-btn {
    padding: 0.35rem 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

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

.chat-input-box {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.75rem;
    gap: 0.75rem;
    transition: var(--transition);
}

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

.selected-model-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.selected-model-indicator .cost-tag {
    padding: 0.1rem 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    font-size: 0.675rem;
}

#chatInput {
    flex: 1;
    background: transparent;
    color: var(--text-primary);
    resize: none;
    max-height: 120px;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 0.4rem 0;
}

#chatInput::placeholder {
    color: var(--text-muted);
}

.btn-send-message {
    padding: 0.65rem 1.15rem;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-send-message:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.input-footer-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.725rem;
    color: var(--text-muted);
}

.input-footer-legend kbd {
    padding: 0.1rem 0.35rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.675rem;
}

/* ======================================================== */
/* 10. MODAL DE PRESENTACIÓN PANTALLA COMPLETA              */
/* ======================================================== */
.presentation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.presentation-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.presentation-bar {
    height: 60px;
    background: rgba(17, 24, 39, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 10;
}

.bar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.bar-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.slide-indicator {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 700;
}

.btn-pres-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.btn-pres-icon:hover {
    background: var(--primary);
}

.btn-close-pres:hover {
    background: var(--danger);
}

.presentation-slide-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 6rem;
    background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
    color: #ffffff;
    text-align: left;
}

.presentation-teacher-drawer {
    background: #111827;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    max-height: 45px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.presentation-teacher-drawer.expanded {
    max-height: 200px;
}

.drawer-header {
    padding: 0.75rem 2rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fde68a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.drawer-content {
    padding: 0.75rem 2rem 1.5rem;
    font-size: 0.95rem;
    color: #cbd5e1;
}

/* ======================================================== */
/* 11. SISTEMA DE NOTIFICACIONES TOAST                      */
/* ======================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    min-width: 280px;
    max-width: 420px;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info { border-left: 4px solid var(--info); }

/* ======================================================== */
/* 12. ESTILOS DEL PANEL ADMIN: EDITOR DE api.php           */
/* ======================================================== */
.btn-admin-editor-nav {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    color: #fde68a;
    font-size: 0.825rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-admin-editor-nav:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--sunburst-glow);
}

.btn-admin-sidebar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.825rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-admin-sidebar:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--sunburst);
    color: #ffffff;
    transform: translateX(3px);
}

/* Modal del Editor */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease-out;
}

.admin-modal-card {
    width: 100%;
    max-width: 1280px;
    height: 92vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.75rem;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-color);
}

.admin-header-title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.admin-icon-wrapper {
    width: 40px;
    height: 40px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--sunburst);
}

.admin-header-title h3 {
    font-size: 1.15rem;
    margin-bottom: 0.1rem;
}

.admin-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-path-badge {
    padding: 0.3rem 0.65rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    color: #93c5fd;
    font-family: 'Consolas', 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.file-status-badge {
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.725rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.file-status-badge.writable {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.file-status-badge.readonly {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.btn-close-admin {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.btn-close-admin:hover {
    color: #ffffff;
    background: var(--danger);
}

.admin-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0b0f19;
}

.code-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    background: #111827;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.775rem;
    color: var(--text-muted);
}

.editor-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.editor-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-editor-tool {
    padding: 0.3rem 0.65rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-editor-tool:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.code-editor-wrapper {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
    background: #090d16;
}

.line-numbers-col {
    width: 60px;
    padding: 1.25rem 0.5rem 1.25rem 0;
    background: #0b0f19;
    border-right: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: 'Consolas', 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    text-align: right;
    user-select: none;
    overflow-y: hidden;
    white-space: pre-wrap;
    opacity: 0.6;
}

#apiCodeTextarea {
    flex: 1;
    height: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    color: #e2e8f0;
    font-family: 'Consolas', 'Fira Code', 'Courier New', monospace;
    font-size: 13.5px;
    line-height: 1.6;
    tab-size: 4;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: auto;
    resize: none;
    border: none;
    outline: none;
}

#apiCodeTextarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
#apiCodeTextarea::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-pill);
}

.admin-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.75rem;
    background: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-color);
}

.footer-alert-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-alert-note code {
    padding: 0.15rem 0.4rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: #fbbf24;
}

.footer-alert-note kbd {
    padding: 0.15rem 0.35rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-secondary {
    padding: 0.65rem 1.15rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-save-code {
    padding: 0.65rem 1.35rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px var(--sunburst-glow);
}

.btn-save-code:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4);
}

/* ======================================================== */
/* 13. RESPONSIVIDAD (MOBILE & TABLET)                      */
/* ======================================================== */
@media (max-width: 992px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    .auth-hero {
        padding: 2rem;
    }
    .auth-card {
        padding: 2rem;
    }
    .app-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-toggle {
        display: block;
    }
    .navbar-center {
        display: none;
    }
    .chat-messages-container {
        padding: 1.5rem;
    }
    .chat-input-wrapper {
        padding: 0.75rem 1.25rem 1rem;
    }
    .presentation-slide-view {
        padding: 2rem 2.5rem;
    }
}
