/* ==========================================================================
   Plataforma LMS EduMeet - Estilos Globales y Diseño Premium
   Colores, Typography, Layout, Modo Claro/Oscuro, Sidebar y Auth
   ========================================================================== */

:root {
    /* Paleta de Colores Primarios (Modo Claro) */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-subtle: #EEF2F6;
    --secondary: #64748B;
    --success: #10B981;
    --success-subtle: #ECFDF5;
    --warning: #F59E0B;
    --warning-subtle: #FEF3C7;
    --danger: #EF4444;
    --danger-subtle: #FEF2F2;
    --info: #06B6D4;
    --info-subtle: #ECFEFF;

    /* Neutros */
    --bg-app: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-navbar: #FFFFFF;
    --bg-sidebar: #0F172A;
    --border-color: #E2E8F0;
    
    /* Texto */
    --text-main: #0F172A;
    --text-muted: #64748B;
    --text-sidebar: #94A3B8;
    --text-sidebar-active: #FFFFFF;

    /* Sombras y Bordes */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Colores en Modo Oscuro */
    --bg-app: #0B0F19;
    --bg-card: #151F32;
    --bg-navbar: #151F32;
    --bg-sidebar: #090D16;
    --border-color: #1E293B;

    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    
    --primary-subtle: rgba(79, 70, 229, 0.15);
    --success-subtle: rgba(16, 185, 129, 0.15);
    --warning-subtle: rgba(245, 158, 11, 0.15);
    --danger-subtle: rgba(239, 68, 68, 0.15);
    --info-subtle: rgba(6, 182, 212, 0.15);
}

/* ==========================================================================
   Básicos y Tipografía
   ========================================================================== */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
    transition: var(--transition);
}

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

/* ==========================================================================
   Contenedor Principal y Sidebar
   ========================================================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    transition: var(--transition);
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #818CF8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    letter-spacing: -0.5px;
}

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

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-sidebar);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
}

.sidebar-nav .nav-link.active {
    background-color: var(--primary);
    color: var(--text-sidebar-active);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    background-color: rgba(0,0,0,0.15);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

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

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
}

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

/* ==========================================================================
   Contenido Principal e Interfaz Navbar
   ========================================================================== */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

.top-navbar {
    height: 70px;
    background-color: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    transition: var(--transition);
}

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

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

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

.navbar-search {
    position: relative;
    display: none;
}
@media (min-width: 768px) {
    .navbar-search { display: block; }
}

.navbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.navbar-search input {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 1rem 0.4rem 2.2rem;
    font-size: 0.875rem;
    color: var(--text-main);
    width: 220px;
    transition: var(--transition);
}

.navbar-search input:focus {
    width: 300px;
    border-color: var(--primary);
    outline: none;
}

.navbar-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.navbar-btn:hover {
    background-color: var(--primary-subtle);
    color: var(--primary);
    border-color: var(--primary);
}

.notif-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--danger);
    color: white;
    font-size: 0.65rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-subtle);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.navbar-user-btn {
    background: none;
    border: none;
    padding: 0;
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
}

/* ==========================================================================
   Dashboard Cards
   ========================================================================== */
.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.25rem 0;
    color: var(--text-main);
}

.stat-change {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.stat-change.positive { color: var(--success); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Variaciones de Tarjetas */
.stat-card-primary .stat-icon { background-color: var(--primary-subtle); color: var(--primary); }
.stat-card-success .stat-icon { background-color: var(--success-subtle); color: var(--success); }
.stat-card-warning .stat-icon { background-color: var(--warning-subtle); color: var(--warning); }
.stat-card-danger .stat-icon { background-color: var(--danger-subtle); color: var(--danger); }

.stat-card-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    padding-top: 0.5rem;
    font-size: 0.8rem;
}

.content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
}

.content-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.content-card-body {
    padding: 1.5rem;
}

/* ==========================================================================
   Listas de Clases y Actividad
   ========================================================================== */
.class-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.class-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-app);
    border-radius: var(--radius-sm);
    padding: 1rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.class-color-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.class-info {
    flex: 1;
    padding-left: 0.75rem;
}

.class-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.15rem 0;
}

.class-course {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.class-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.class-actions {
    padding-left: 1.5rem;
}

.btn-glow {
    box-shadow: 0 0 12px var(--success);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    padding-left: 1rem;
}

.activity-feed::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background-color: var(--border-color);
}

.activity-item {
    position: relative;
    display: flex;
    gap: 1rem;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    position: absolute;
    left: -13px;
    top: 6px;
    z-index: 2;
    border: 2px solid var(--bg-card);
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 0.85rem;
    margin: 0;
}

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

/* ==========================================================================
   Páginas de Autenticación
   ========================================================================== */
.auth-body {
    background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-container {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: flex;
    overflow: hidden;
    width: 1000px;
    max-width: 100%;
    min-height: 600px;
    transition: var(--transition);
}

.auth-brand-panel {
    background: linear-gradient(135deg, #4F46E5 0%, #312E81 100%);
    width: 45%;
    display: none;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}
@media (min-width: 992px) {
    .auth-brand-panel { display: flex; }
}

.brand-particles .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 50%;
}
.brand-particles .particle:nth-child(1) { top: 20%; left: 30%; animation: floatParticle 8s infinite linear; }
.brand-particles .particle:nth-child(2) { top: 60%; left: 80%; animation: floatParticle 12s infinite linear; }
.brand-particles .particle:nth-child(3) { top: 80%; left: 20%; animation: floatParticle 10s infinite linear; }

@keyframes floatParticle {
    0% { transform: translateY(0) scale(1); opacity: 0.3; }
    50% { transform: translateY(-40px) scale(1.5); opacity: 0.8; }
    100% { transform: translateY(-80px) scale(1); opacity: 0.3; }
}

.brand-logo-lg {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.brand-title {
    font-weight: 800;
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.brand-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3rem;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.brand-feature i {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
@media (max-width: 576px) {
    .auth-form-panel { padding: 1.5rem; }
}

.auth-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.auth-form-header {
    margin-bottom: 2.5rem;
}

.auth-form-header h2 {
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-form-header p {
    color: var(--text-muted);
}

.form-floating-custom {
    margin-bottom: 1.25rem;
    position: relative;
}

.input-icon-group {
    position: relative;
}

.input-icon-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.input-icon-group .form-control {
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-main);
    transition: var(--transition);
}

.input-icon-group .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    background-color: var(--bg-card);
}

.form-floating-custom label {
    display: none;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.custom-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-auth {
    width: 100%;
    padding: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
    border: none;
    color: white;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Responsive e Interacciones
   ========================================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1025;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-260px);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .sidebar.show {
        transform: translateX(0);
    }
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}
