/* ==========================================================================
   MASTER CSS - EDUCATIF
   Contiene: Global, Dashboard, Login, Admin, Comunidades, Cronograma, Eventos
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET Y ESTILOS BASE GLOBALES
   -------------------------------------------------------------------------- */

:root {
    --primary-blue: #122C4F;
    --accent-blue: #00b7ff;
    --text-cream: #FBF9E4;
    --sidebar-width: 260px;
    --glass-bg: rgba(251, 249, 228, 0.05);
    --glass-border: rgba(251, 249, 228, 0.2);
    --transition-speed: 0.3s;

}

   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



html, body {
    width: 100%;
    overflow-x: hidden !important; /* Obligatorio en ambos para bloquear el scroll */
    position: relative;
    overscroll-behavior-x: none; /* Evita el efecto "rebote" al deslizar */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #122C4F;
    color: #FBF9E4;
    min-height: 100vh;
    background-image: linear-gradient(to top, #1760be, #0f5fe0, #1656ce, #115df7, #156cb4);
    background-attachment: fixed;
}

/* Esto obliga a todos los enlaces a usar el color que tú definas, ignorando el estado "visitado" */
a, a:visited, a:hover, a:active {
    color: inherit;
    text-decoration: none;
}

/* Contenedor estándar */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Contenedor principal centrado (usado en Index/Landing) */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

/* --------------------------------------------------------------------------
   2. COMPONENTES COMPARTIDOS (Headers, Footers, Botones)
   -------------------------------------------------------------------------- */

/* --- Pie de Página (Unificado) --- */
.site-footer {
    background: rgba(0, 0, 0, 0.3);
    color: #FBF9E4;
    text-align: center;
    padding: 1rem;
    position: relative;
    width: 100%;
    margin-top: 40px;
    font-weight: 300;
}

/* --- Header Global Moderno --- */
.global-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    /* Fondo Glassmorphism más refinado */
    background: rgba(18, 44, 79, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(251, 249, 228, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.6rem;
    font-weight: 800;
    color: #FBF9E4;
    letter-spacing: -0.5px;
}

.logo-img {
    width: 35px;
    height: 35px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-link:hover .logo-img {
    transform: rotate(15deg) scale(1.1);
}

/* Navegación Desktop */
.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    position: relative;
    font-weight: 500;
    color: rgba(251, 249, 228, 0.8);
    transition: color 0.3s ease;
    padding: 5px 0;
}

.nav-link:hover, .nav-link.active {
    color: #FBF9E4;
}

/* Animación de subrayado mágico */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #00b7ff;
    transition: width 0.3s ease-in-out;
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 100%;
}

/* Botones de Autenticación */
.user-auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(251, 249, 228, 0.2);
}

.auth-button {
    background: rgba(251, 249, 228, 0.1);
    border: 1px solid rgba(251, 249, 228, 0.3);
    color: #FBF9E4;
    padding: 0.5rem 1.2rem;
    border-radius: 50px; /* Botones redondeados modernos */
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.auth-button:hover {
    background: #FBF9E4;
    color: #122C4F;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 183, 255, 0.3);
}

.logout-btn {
    padding: 0.5rem;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: #ff6b6b;
    color: #ff6b6b;
}
.logout-btn:hover {
    background: #ff6b6b;
    color: white;
}

/* Botón Hamburguesa (Oculto en Desktop) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #FBF9E4;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Responsive / Mobile Menu --- */
@media (max-width: 900px) {
    .mobile-menu-btn {
        display: block; /* Mostrar botón hamburguesa */
        z-index: 1002;
    }

/* --- CAMBIO 2: DENTRO DE @MEDIA (MAX-WIDTH: 900PX) --- */

.nav-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    height: 100vh;
    background: rgba(13, 31, 56, 0.98);
    backdrop-filter: blur(20px);
    
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 100px;
    
    /* TRUCO MAESTRO: */
    transform: translateX(100%);     /* 1. Lo saca de la pantalla */
    visibility: hidden;              /* 2. Lo hace invisible para el scroll */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s step-end;
    
    box-shadow: -5px 0 30px rgba(0,0,0,0.5);
    z-index: 1002;
}

.nav-wrapper.active {
    transform: translateX(0);        /* 1. Lo trae de vuelta */
    visibility: visible;             /* 2. Lo hace visible al instante */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s step-start;
}
    .main-nav {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .nav-link {
        font-size: 1.5rem;
    }

    .user-auth-section {
        flex-direction: column;
        border-left: none;
        padding-left: 0;
        margin-top: 1rem;
        padding-top: 2rem;
        border-top: 1px solid rgba(251, 249, 228, 0.2);
        width: 80%;
    }
}
/* --------------------------------------------------------------------------
   3. ANIMACIONES GENERALES
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-light {
    0% { box-shadow: 0 0 0 0 rgba(91, 136, 178, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(91, 136, 178, 0); }
    100% { box-shadow: 0 0 0 0 rgba(91, 136, 178, 0); }
}

/* Pantallas ocultas por defecto (SPA logic) */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.5s ease-in-out;
}
.screen.active {
    display: block;
}

/* --------------------------------------------------------------------------
   4. MÓDULO: LOGIN Y AUTENTICACIÓN
   -------------------------------------------------------------------------- */
/* IMPORTANTE: Añadir class="login-page" al <body> de login.html */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.auth-box {
    background: rgba(18, 44, 79, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(91, 136, 178, 0.2);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    text-align: center;
}

.form-container {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}
.form-container.active { display: block; }
.form-container h2 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; }
.form-container p { color: #b4c2d0; margin-bottom: 30px; }

.input-group { text-align: left; margin-bottom: 20px; }
.input-group label { display: block; color: #b4c2d0; margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; }
.input-group input {
    width: 100%; padding: 14px; border-radius: 10px; border: 1px solid #5B88B2;
    background-color: rgba(0, 0, 0, 0.3); color: #FBF9E4; font-size: 1rem; transition: all 0.3s ease;
}
.input-group input:focus { outline: none; border-color: #00a2ff; box-shadow: 0 0 0 3px rgba(0, 162, 255, 0.3); }

/* Separadores y Botones Extra Auth */
.separator {
    display: flex; align-items: center; text-align: center; color: #b4c2d0; margin: 25px 0;
}
.separator::before, .separator::after { content: ''; flex: 1; border-bottom: 1px solid #5B88B2; }
.separator:not(:empty)::before { margin-right: .25em; }
.separator:not(:empty)::after { margin-left: .25em; }

.google-button {
    width: 100%; padding: 15px; font-size: 1rem; font-weight: 600; border-radius: 10px; cursor: pointer;
    transition: all 0.3s ease; background: #FBF9E4; color: #122C4F; border: none;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.google-button:hover { opacity: 0.9; box-shadow: 0 5px 15px rgba(251, 249, 228, 0.2); }

.switch-form, .forgot-password { margin-top: 20px; color: #b4c2d0; }
.switch-form a, .forgot-password a { color: #00a2ff; font-weight: 600; text-decoration: none; }
.switch-form a:hover, .forgot-password a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   5. MÓDULO: INDEX / DASHBOARD / PORTAL
   -------------------------------------------------------------------------- */
.welcome-header {
    text-align: center; margin-bottom: 60px; color: #FBF9E4; animation: fadeInDown 1s ease-out;
}
.welcome-header .logo {
    width: 100px; height: 100px; margin: 0 auto 20px; border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1); padding: 10px;
}
.welcome-header h1 { font-size: 2.5rem; font-weight: 800; }
.welcome-header p { font-size: 1.2rem; max-width: 600px; opacity: 0.8; margin: 0 auto; }

/* Grilla del Portal (Index) */
.portal-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px;
    width: 100%; max-width: 1200px;
}

.portal-card {
    padding: 30px; display: flex; align-items: center; text-decoration: none;
    color: #FBF9E4; border-radius: 20px; transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out forwards; opacity: 0;
    /* Efecto Vidrio */
    background: rgba(251, 249, 228, 0.05); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(251, 249, 228, 0.2); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.portal-card, .portal-card:visited {
    color: #FBF9E4 !important; /* Fuerza el color blanco/crema siempre */
}

.portal-card:hover {
    background: rgba(251, 249, 228, 0.15); transform: translateY(-10px) scale(1.02);
}
.card-icon {
    font-size: 2rem; margin-right: 25px; color: #FBF9E4; width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(18, 44, 79, 0.5); border-radius: 50%; flex-shrink: 0;
}
.card-content h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.card-content p { font-size: 1rem; opacity: 0.7; line-height: 1.5; }
.card-arrow {
    margin-left: auto; font-size: 1.5rem; opacity: 0.5; transition: all 0.3s ease;
}
.portal-card:hover .card-arrow { opacity: 1; transform: translateX(5px); color: #FBF9E4; }

/* Grilla de Cursos (Dashboard) */
.course-grid, .dashboard-grid {
    display: grid; grid-template-columns: 1fr; gap: 30px; margin-top: 40px;
}
.dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); width: 100%; max-width: 1200px; }

.course-card, .dashboard-card {
    padding: 40px 30px; text-align: center; cursor: pointer; border-radius: 20px;
    transition: all 0.3s ease; position: relative; overflow: hidden;
    background: rgba(251, 249, 228, 0.1); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(251, 249, 228, 0.2); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    color: #FBF9E4;
}
.course-card:hover { transform: translateY(-10px); }

.course-icon {
    width: 80px; height: 80px; margin: 0 auto 20px;
    background: linear-gradient(135deg, #00b7ff, #1678d4); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: all 0.3s ease;
}
.course-card:hover .course-icon { transform: scale(1.1); box-shadow: 0 10px 25px rgba(91, 136, 178, 0.4); }
.course-icon i { font-size: 2rem; color: #FBF9E4; position: relative; z-index: 2; }
.course-card h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 10px; color: #FBF9E4; position: relative; z-index: 2; }
.course-card p { color: #b4c2d0; font-weight: 400; position: relative; z-index: 2; }

/* Dashboard card specific styles */
.dashboard-card { padding: 30px; background: rgba(251, 249, 228, 0.05); }
.dashboard-card h3 { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(251, 249, 228, 0.2); margin-bottom: 20px;}
.dashboard-card ul { list-style: none; padding: 0; margin-bottom: 20px; }
.dashboard-card li { padding: 10px 0; border-bottom: 1px solid rgba(251, 249, 228, 0.1); }
.dashboard-card li:last-child { border-bottom: none; }
.module-link { color: #00a2ff; text-decoration: none; font-weight: 600; display: inline-block; margin-top: 10px; }

/* --------------------------------------------------------------------------
   6. MÓDULO: CRONOGRAMA Y TAREAS
   -------------------------------------------------------------------------- */
.schedule-header {
    display: flex; flex-direction: column; justify-content: space-between; align-items: center;
    margin-bottom: 30px; padding: 20px; border-radius: 15px; gap: 15px;
    background: rgba(18, 44, 79, 0.3); backdrop-filter: blur(15px);
    border: 1px solid rgba(91, 136, 178, 0.25); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
.header-left { display: flex; align-items: center; gap: 20px; }
.back-btn {
    background: linear-gradient(135deg, #c14444, #b43b34); color: #FBF9E4;
    border: none; padding: 12px 20px; border-radius: 10px; cursor: pointer;
    font-weight: 500; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px;
}
.back-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(193, 68, 68, 0.4); }

.academic-btn {
    background: #5B88B2; color: #122C4F; border: none; padding: 12px 20px;
    border-radius: 10px; cursor: pointer; font-weight: 600; transition: all 0.3s ease;
    display: flex; align-items: center; gap: 8px;
}
.academic-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(91, 136, 178, 0.4); }
.academic-btn.active {
    background: linear-gradient(135deg, #FBF9E4, #e0dccc); color: #122C4F;
    box-shadow: 0 0 20px rgba(251, 249, 228, 0.5);
}

/* Panel Académico */
.academic-panel {
    background: linear-gradient(135deg, #5b88b2, #4a6f90); border-radius: 15px;
    padding: 25px; margin-bottom: 30px; box-shadow: 0 10px 30px rgba(0,0,0, 0.3);
    border: 1px solid rgba(251, 249, 228, 0.2); animation: slideDown 0.5s ease;
}
.academic-panel.hidden { display: none; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.form-group { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.form-group input, .form-group select {
    padding: 12px 15px; border: 1px solid #5B88B2; border-radius: 10px;
    background: #FBF9E4; color: #122C4F; min-width: 200px; flex-grow: 1;
}
#addTaskBtn {
    background: #122C4F; color: #FBF9E4; border: 1px solid #FBF9E4;
    padding: 12px 20px; border-radius: 10px; cursor: pointer; flex-grow: 1;
}

/* Grilla del Cronograma */
.schedule-grid {
    display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 20px;
}
.schedule-grid.academic-mode-active {
    background-color: rgba(91, 136, 178, 0.1); border-radius: 15px; padding: 10px; transition: background-color 0.4s ease;
}
.schedule-grid.academic-mode-active .task-item { cursor: pointer; animation: pulse-light 2s infinite; }

.day-column {
    padding: 20px; min-height: 400px; border-radius: 15px; transition: all 0.3s ease;
    background: rgba(18, 44, 79, 0.4); backdrop-filter: blur(12px); border: 1px solid rgba(91, 136, 178, 0.2);
}
.day-column:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.day-header { text-align: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #5B88B2; }

/* Tareas */
.task-item {
    background: rgba(18, 44, 79, 0.7); border: 1px solid #5B88B2; border-radius: 10px;
    padding: 15px; position: relative; animation: taskAppear 0.5s ease; color: #FBF9E4;
}
@keyframes taskAppear { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.task-item:hover { border-color: #FBF9E4; background: rgba(91, 136, 178, 0.2); }
.task-item.completed { background: rgba(91, 136, 178, 0.3); border-color: #FBF9E4; }
.task-content { display: flex; align-items: flex-start; gap: 12px; }
.task-checkbox {
    width: 20px; height: 20px; border: 2px solid #5B88B2; border-radius: 5px; cursor: pointer;
    flex-shrink: 0; margin-top: 2px; position: relative;
}
.task-checkbox.checked { background: #5B88B2; border-color: #FBF9E4; }
.task-checkbox.checked::after {
    content: '✓'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: #122C4F; font-weight: bold; font-size: 12px;
}
.task-text { flex: 1; font-size: 0.95rem; line-height: 1.4; }
.task-text.completed { text-decoration: line-through; opacity: 0.6; }
.delete-btn {
    position: absolute; top: 10px; right: 10px; background: #c14444; color: white;
    border: none; width: 25px; height: 25px; border-radius: 50%; cursor: pointer;
    opacity: 0; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
}
.task-item:hover .delete-btn { opacity: 1; }

/* --------------------------------------------------------------------------
   7. MÓDULO: ADMIN
   -------------------------------------------------------------------------- */
.admin-container {
    max-width: 900px; margin: 40px auto; padding: 30px;
    background: rgba(18, 44, 79, 0.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(91, 136, 178, 0.2); border-radius: 15px; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.filter-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; border-bottom: 1px solid rgba(91, 136, 178, 0.3); padding-bottom: 20px; }
.filter-tab {
    background: transparent; border: 1px solid #5B88B2; color: #FBF9E4; padding: 10px 20px;
    border-radius: 9999px; cursor: pointer; font-weight: 600; transition: all 0.3s ease;
}
.filter-tab:hover { background-color: rgba(91, 136, 178, 0.5); border-color: #FBF9E4; }
.filter-tab.active {
    background-color: #FBF9E4; color: #122C4F; border-color: #FBF9E4;
    box-shadow: 0 0 15px rgba(251, 249, 228, 0.3);
}

.user-card {
    background: rgba(18, 44, 79, 0.7); border-left: 5px solid #5B88B2; border-radius: 10px;
    padding: 20px; margin-bottom: 15px; display: flex; flex-direction: column; gap: 15px; transition: all 0.3s ease;
}
.user-card:hover { transform: translateX(5px); border-left-color: #00a2ff; }
.user-info p { margin: 0 0 8px 0; color: #b4c2d0; font-size: 0.9rem; }
.user-info p strong { color: #FBF9E4; font-weight: 600; margin-right: 5px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 10px; align-self: flex-start; }

.action-btn { padding: 8px 15px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.action-btn:hover { transform: translateY(-2px); }
.edit-btn { background-color: #5B88B2; color: #122C4F; }
.approve-btn { background-color: #28a745; color: white; }
.deny-btn { background-color: #dc3545; color: white; }

/* --------------------------------------------------------------------------
   8. MÓDULO: COMUNIDADES
   -------------------------------------------------------------------------- */
.community-section { margin-bottom: 80px; text-align: center; }
.community-title {
    font-size: 2.2rem; font-weight: 700; color: #FBF9E4; margin-bottom: 40px;
    padding-bottom: 15px; border-bottom: 2px solid #107bdf; display: inline-block;
}

.polaroid-grid { display: grid; grid-template-columns: 1fr; gap: 20px; justify-items: center; }

.polaroid-card {
    background: #fcfae8; border: 1px solid #ccc; padding: 15px; padding-bottom: 70px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2), 0 10px 20px rgba(0,0,0,0.2);
    transform: rotate(-2deg); transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative; width: 100%; max-width: 300px;
}
.polaroid-card:nth-child(2n) { transform: rotate(2deg); }
.polaroid-card:nth-child(3n) { transform: rotate(-3deg); }
.polaroid-card:nth-child(4n) { transform: rotate(3deg); }
.polaroid-card:hover { transform: rotate(0deg) scale(1.05); z-index: 10; box-shadow: 0 10px 20px rgba(0,0,0,0.4); }

.polaroid-image { width: 100%; height: 250px; object-fit: cover; border: 1px solid #ddd; background-color: #e0e0e0; }
.polaroid-caption { position: absolute; bottom: 15px; left: 15px; right: 15px; text-align: center; }
.polaroid-caption h3 { font-family: 'Georgia', serif; font-size: 1.3rem; color: #122C4F; font-weight: 600; margin: 0; }
.polaroid-caption p { font-family: 'Georgia', serif; font-style: italic; font-size: 0.9rem; color: #5B88B2; margin-top: 5px; }

/* Flip Card 3D */
.flip-card { background-color: transparent; width: 100%; max-width: 300px; height: 400px; perspective: 1000px; }
.flip-card-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.8s; transform-style: preserve-3d; }
.flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-card-back {
    background: #fcfae8; color: #122C4F; transform: rotateY(180deg);
    border-radius: 5px; padding: 20px; display: flex; flex-direction: column;
    justify-content: center; align-items: center; box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* --------------------------------------------------------------------------
   9. MÓDULO: EVENTOS Y CALENDARIO
   -------------------------------------------------------------------------- */
.event-card {
    animation: fadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; opacity: 0;
}
.event-card small { color: #FBF9E4; }

.create-event-main-button {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.5rem; background: linear-gradient(135deg, #00b7ff, #3f94e4);
    color: #00070f; font-weight: 600; border-radius: 9999px; border: none;
    cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(91, 136, 178, 0.911);
}

.create-event-main-button, .create-event-main-button:visited {
    color: #00070f !important; /* Fuerza el color oscuro del texto siempre */
    text-decoration: none;
}

.create-event-main-button:hover { transform: translateY(-3px); box-shadow: 0 7px 20px rgba(91, 136, 178, 0.4); }

.filter-container {
    display: flex; justify-content: center; align-items: center; padding: 1rem;
    background: rgba(18, 44, 79, 0.4); border-radius: 1rem; margin-bottom: 2rem;
    backdrop-filter: blur(10px); flex-wrap: wrap; gap: 0.75rem;
}
.filter-button {
    background-color: transparent; border: 1px solid #5B88B2; color: #FBF9E4;
    padding: 0.6rem 1.2rem; border-radius: 9999px; cursor: pointer; font-weight: 600; transition: all 0.2s ease-in-out;
}
.filter-button:hover, .filter-button.active {
    background-color: #FBF9E4; color: #122C4F; border-color: #FBF9E4;
}
.filter-button:hover { background-color: rgba(91, 136, 178, 0.5); } /* Solo hover */

/* Formulario Modal de Eventos (Glassmorphism Intenso) */
.event-creator-form {
    border-radius: 1rem; overflow: hidden;
    background: rgba(18, 44, 79, 0.5); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(91, 136, 178, 0.3); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
.form-title {
    background: linear-gradient(135deg, #3f94e4, #00b7ff); color: #FBF9E4;
    font-size: 1.25rem; font-weight: 600; padding: 1rem 2rem; text-align: center;
}
.event-creator-form .form-content {
    padding: 2rem; max-height: 75vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1.25rem;
}
/* Scroll personalizado para WebKit */
.event-creator-form .form-content::-webkit-scrollbar { width: 8px; }
.event-creator-form .form-content::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 10px; }
.event-creator-form .form-content::-webkit-scrollbar-thumb { background: #5B88B2; border-radius: 10px; }

.event-creator-form .form-content input,
.event-creator-form .form-content textarea,
.event-creator-form .form-content select {
    display: block; width: 100%; background-color: rgba(0,0,0, 0.3); color: #FBF9E4;
    border: 1px solid #5B88B2; border-radius: 0.5rem; padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif; font-size: 1rem;
}
.event-creator-form input:focus, .event-creator-form select:focus {
    outline: none; border-color: #FBF9E4; box-shadow: 0 0 0 3px rgba(5, 120, 228, 0.3);
}

/* Grilla interna del formulario */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }

/* Subida de Archivos Personalizada */
.file-input-container { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
#event-image.file-input-hidden { display: none !important; visibility: hidden !important; }
.file-input-label {
    display: inline-flex; align-items: center; gap: 0.5rem; background-color: #5B88B2;
    color: #122C4F; padding: 0.6rem 1.2rem; border-radius: 0.5rem; cursor: pointer; font-weight: 600;
    transition: background-color 0.2s ease;
}
.file-chosen-text { font-size: 0.875rem; color: #94a3b8; font-style: italic; }

/* Botones de acción formulario */
.form-actions { display: flex; gap: 1rem; margin-top: 1rem; }
.form-actions button { width: 100%; padding: 0.85rem; border-radius: 0.5rem; cursor: pointer; font-weight: bold; }
.form-actions .cancel-button { background: transparent; border: 1px solid #f87171; color: #FBF9E4; }
.form-actions .cancel-button:hover { background: #f87171; color: white; }
.event-creator-form button[type="submit"] { background: linear-gradient(135deg, #3f94e4, #00b7ff); border: none; color: #122C4F; }

/* Acciones de Autor (Editar, Borrar) */
.author-actions { display: flex; justify-content: flex-end; gap: 0.75rem; padding-top: 1rem; border-top: 1px solid rgba(6, 132, 250, 0.2); margin-top: 1rem; }
.drive-button, .edit-button, .delete-button { padding: 0.5rem 1rem; border-radius: 0.5rem; transition: all 0.2s ease; background: transparent; }
.drive-button { color: #4ade80; border: 1px solid #4ade80; }
.drive-button:hover { background-color: #4ade80; color: #1e293b; }
.edit-button { color: #60a5fa; border: 1px solid #60a5fa; }
.edit-button:hover { background-color: #60a5fa; color: white; }
.delete-button { color: #f87171; border: 1px solid #f87171; }
.delete-button:hover { background-color: #f87171; color: white; }

/* FullCalendar Overrides */
#calendar-container {
    padding: 1.5rem; border-radius: 1rem; background: rgba(18, 44, 79, 0.4);
    backdrop-filter: blur(10px); border: 1px solid rgba(91, 136, 178, 0.2); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
.fc { color: #FBF9E4; }
.fc .fc-toolbar-title { color: #FBF9E4; }
.fc .fc-button { background-color: #5B88B2; border: none; color: #122C4F; font-weight: bold; }
.fc .fc-button:hover { background-color: #4a6f90; }
.fc .fc-daygrid-day { border: 1px solid rgba(91, 136, 178, 0.1); transition: background-color 0.3s; }
.fc .fc-daygrid-day:hover { background-color: rgba(91, 136, 178, 0.05); }
.fc .fc-col-header-cell-cushion { font-weight: 600; font-size: 0.9rem; color: #FBF9E4; text-transform: uppercase; }
.fc .fc-event-main { color: #122C4F; font-weight: 600; }
.fc-event { background-color: #5B88B2; border: 1px solid #FBF9E4; }

/* --------------------------------------------------------------------------
   10. MODALES (Genéricos y Overlays)
   -------------------------------------------------------------------------- */
/* Modal Base (usado en Cronograma/Admin) */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000;
    background: rgba(18, 44, 79, 0.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.modal.active { opacity: 1; pointer-events: auto; display: flex; }

/* Modal Overlay (Específico para Eventos/Styles.css legacy) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 100;
    display: flex; justify-content: center; align-items: center;
    background-color: rgba(18, 44, 79, 0.3); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    background: rgba(18, 44, 79, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(91, 136, 178, 0.3); border-radius: 20px; width: 90%; max-width: 500px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); overflow: hidden; transform: scale(0.95); transition: transform 0.3s ease;
    /* Animación */
    animation: modalSlideIn 0.3s ease forwards;
}
.modal.active .modal-content { transform: scale(1); }
@keyframes modalSlideIn { from { opacity: 0; transform: scale(0.8) translateY(-50px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-header {
    background: linear-gradient(135deg, rgba(91, 136, 178, 0.3), rgba(18, 44, 79, 0.5));
    padding: 20px 30px; border-bottom: 1px solid rgba(91, 136, 178, 0.2); display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { color: #FBF9E4; font-size: 1.5rem; font-weight: 600; }
.close-btn, .close-button {
    background: rgba(251, 249, 228, 0.1); border: none; width: 30px; height: 30px; border-radius: 50%; color: #FBF9E4; cursor: pointer;
}
.modal-body { padding: 30px; display: flex; flex-direction: column; gap: 20px; }

/* --------------------------------------------------------------------------
   11. NOTIFICACIONES (TOASTS)
   -------------------------------------------------------------------------- */
.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 1050; display: flex; flex-direction: column; gap: 10px;
}
.toast {
    display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 10px; color: #FBF9E4; font-weight: 500;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); animation: slideInToast 0.4s ease-out, fadeOutToast 0.4s ease-in 3.5s forwards;
    background: rgba(18, 44, 79, 0.6); backdrop-filter: blur(10px); border: 1px solid rgba(91, 136, 178, 0.3);
}
.toast.success { border-left: 5px solid #28a745; }
.toast.error { border-left: 5px solid #dc3545; }
.toast.warning { border-left: 5px solid #ffc107; }
.toast.info { border-left: 5px solid #17a2b8; }

@keyframes slideInToast { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOutToast { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); visibility: hidden; } }

/* Notificaciones en vivo (inferior izquierda) */
.toast-container-live { position: fixed; bottom: 20px; left: 20px; z-index: 2000; }
.toast-live {
    display: flex; align-items: center; gap: 15px; padding: 15px 25px; border-radius: 12px; color: #122C4F; font-weight: 600;
    background: linear-gradient(135deg, #FBF9E4, #e0dccc); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #FBF9E4; transform: translateX(-150%);
    animation: slideInToastLive 0.5s ease-out forwards, slideOutToastLive 0.5s ease-in 4.5s forwards;
}
@keyframes slideInToastLive { to { transform: translateX(0); } }
@keyframes slideOutToastLive { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-150%); opacity: 0; } }

/* --------------------------------------------------------------------------
   12. MEDIA QUERIES Y RESPONSIVIDAD AVANZADA
   -------------------------------------------------------------------------- */

/* --- TABLETS Y ESCRITORIOS PEQUEÑOS (min-width: 768px) --- */
@media (min-width: 768px) {

    
    .schedule-header { 
        flex-direction: row; 
        align-items: center; 
    }
    
    .course-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .schedule-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .user-card { 
        flex-direction: row; 
        align-items: center; 
        justify-content: space-between; 
    }
    
    .user-actions { 
        align-self: center; 
        margin-top: 0;
    }
    
    .form-grid { 
        grid-template-columns: repeat(2, 1fr); 
        align-items: start; 
    }

    .welcome-header h1 {
        font-size: 3rem;
    }
}

/* --- ESCRITORIOS GRANDES (min-width: 1024px) --- */
@media (min-width: 1024px) {
    .container {
        padding: 40px;
    }

    .course-grid { 
        grid-template-columns: repeat(3, 1fr); /* 3 columnas en pantallas grandes */
    }

    .schedule-grid { 
        grid-template-columns: repeat(5, 1fr); /* Vista semanal completa */
    }

    .polaroid-grid { 
        grid-template-columns: repeat(4, 1fr); 
        gap: 40px; 
    }
}

/* --- MÓVILES (max-width: 767px) --- */
@media (max-width: 767px) {
    
    /* 1. Ajustes Globales de Texto y Espacio */
    body {
        font-size: 14px; /* Texto base ligeramente más pequeño */
    }
    
    .container, .main-container {
        padding: 15px; /* Menos padding lateral para ganar espacio */
    }
    
    .welcome-header h1 {
        font-size: 2rem; /* Títulos más pequeños */
    }
    

    /* 3. Login y Formularios */
    .auth-box {
        padding: 25px 20px;
    }
    
    .input-group input {
        padding: 12px;
    }

    /* 4. Cronograma (Schedule) */
    .schedule-header {
        flex-direction: column;
        align-items: stretch; /* Botones ocupan todo el ancho */
    }
    
    .header-left, .header-right {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .back-btn, .academic-btn, #addTaskBtn {
        width: 100%; /* Botones full width */
        justify-content: center;
    }

    .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group input, .form-group select {
        min-width: 100%; /* El input ocupa todo el ancho */
        margin-bottom: 10px;
    }

    /* 5. Tarjetas (Cards) */
    .portal-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .card-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .card-arrow {
        display: none; /* Ocultar flecha decorativa en móvil */
    }

    .polaroid-card {
        max-width: 100%; /* Que ocupe el ancho disponible */
        transform: none !important; /* Quitar rotación en móvil para legibilidad */
        margin-bottom: 30px;
    }
    
    /* 6. Calendario (FullCalendar Overrides Móvil) */
    #calendar-container {
        padding: 10px;
    }
    
    .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc-toolbar-title {
        font-size: 1.2rem !important;
    }
    
    .fc .fc-button {
        padding: 0.4em 0.65em;
        font-size: 0.85em;
    }
    
    /* Vista lista para eventos en móvil suele ser mejor que grid */
    .fc-view-harness {
        min-height: 400px;
    }

    /* 7. Modales */
    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 90vh; /* Evitar que se salga de la pantalla */
        overflow-y: auto; /* Scroll interno si es muy alto */
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    /* Formulario creador de eventos */
    .event-creator-form {
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .form-grid {
        display: flex;
        flex-direction: column;
    }
}

/* --- MÓVILES MUY PEQUEÑOS (max-width: 380px) --- */
@media (max-width: 380px) {
    .auth-button, .home-button {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .points-display {
        display: none; /* Ocultar puntos si la pantalla es diminuta */
    }
}

/* ==========================================================================
   13. ESTILOS DE PERFIL Y WRAPPED (NUEVO)
   ========================================================================== */

.profile-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .profile-wrapper {
        grid-template-columns: 350px 1fr; /* Columna izq fija, der flexible */
    }
}

/* --- Tarjeta de Perfil Izquierda --- */
.profile-card {
    background: rgba(18, 44, 79, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(91, 136, 178, 0.3);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.profile-avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.avatar-circle {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00b7ff, #156cb4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: #FBF9E4;
    border: 3px solid rgba(251, 249, 228, 0.3);
    box-shadow: 0 0 20px rgba(0, 183, 255, 0.3);
}

.role-badge {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: #FBF9E4;
    color: #122C4F;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.email-text {
    font-size: 0.9rem;
    color: #b4c2d0;
    margin-bottom: 30px;
    word-break: break-all;
}

.profile-form .input-group {
    text-align: left;
}

.profile-form input:disabled {
    background: transparent;
    border-color: transparent;
    padding-left: 0;
    color: #FBF9E4;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.edit-profile-btn, .save-profile-btn {
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.edit-profile-btn {
    background: rgba(91, 136, 178, 0.2);
    color: #FBF9E4;
    border: 1px solid rgba(91, 136, 178, 0.4);
}

.save-profile-btn {
    background: #00b7ff;
    color: #122C4F;
}

.hidden { display: none !important; }

/* --- Sección Wrapped (Derecha) --- */
.wrapped-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wrapped-header {
    background: linear-gradient(90deg, rgba(18, 44, 79, 0.8), transparent);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #FBF9E4;
}

.wrapped-header h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.wrapped-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.wrapped-card {
    background: rgba(251, 249, 228, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.wrapped-card:hover {
    transform: translateY(-5px);
}

.wrapped-card.gradient-1 {
    background: linear-gradient(135deg, rgba(255, 221, 0, 0.1), rgba(255, 166, 0, 0.05));
    border-color: rgba(255, 221, 0, 0.3);
}

.wrapped-card.gradient-2 {
    background: linear-gradient(135deg, rgba(0, 255, 170, 0.1), rgba(0, 162, 255, 0.05));
    border-color: rgba(0, 255, 170, 0.3);
}

.card-icon-bg {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 5rem;
    opacity: 0.1;
    transform: rotate(15deg);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    margin: 10px 0;
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.stat-text {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 10px 0;
    color: #00b7ff;
}

.full-width {
    grid-column: 1 / -1;
}

/* Barra de Progreso */
.progress-bar-bg {
    width: 100%;
    height: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00b7ff, #00ffaa);
    border-radius: 10px;
    transition: width 1s ease-in-out;
    box-shadow: 0 0 10px rgba(0, 183, 255, 0.5);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

/* Animaciones de entrada */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}
.delay-1 { animation-delay: 0.2s; }

/* ==========================================================================
   ADMIN DASHBOARD MEJORADO
   ========================================================================== */

/* Tarjetas de Estadísticas */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(18, 44, 79, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(91, 136, 178, 0.3);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover { transform: translateY(-5px); }

.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
}

.stat-card.total .stat-icon { color: #00b7ff; background: rgba(0, 183, 255, 0.15); }
.stat-card.students .stat-icon { color: #00ffaa; background: rgba(0, 255, 170, 0.15); }
.stat-card.pending .stat-icon { color: #ffbb00; background: rgba(255, 187, 0, 0.15); }

.stat-info h3 { font-size: 0.9rem; color: #b4c2d0; margin-bottom: 5px; }
.stat-info span { font-size: 1.8rem; font-weight: 800; color: #FBF9E4; }

/* Controles de Filtros */
.controls-wrapper {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
}

.course-filters {
    display: flex; gap: 10px;
}

.admin-select {
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid #5B88B2;
    background: rgba(18, 44, 79, 0.8);
    color: #FBF9E4;
    cursor: pointer;
}
.admin-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* Desglose de Grados (Barras pequeñas) */
.grade-breakdown {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px;
    background: rgba(255,255,255,0.05); padding: 15px; border-radius: 10px;
}

.mini-stat {
    background: rgba(0,0,0,0.3);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    border-left: 3px solid #00b7ff;
}
.mini-stat strong { margin-left: 5px; color: #fff; }
.hidden { display: none !important; }

/* --- MEJORAS PARA COMUNIDADES --- */

/* Indicadores de Rol (Badges) */
.role-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.badge-prof { 
    background: #00b7ff; 
    color: white; 
}

.badge-student { 
    background: #2ecc71; 
    color: white; 
}

/* Animación de entrada suave */
.fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* Reajuste de la cuadrícula para que sea más flexible */
.polaroid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    justify-items: center;
    width: 100%;
}

/* Ajustes de la tarjeta Polaroid */
.polaroid-card {
    border-radius: 8px;
    overflow: hidden;
    transform: none !important; /* Quitamos la rotación fija para que se vea más limpio con el buscador */
}

.polaroid-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
}

/* Estilo para la parte de atrás de la tarjeta */
.flip-card-back h3 {
    color: #122C4F;
    border-bottom: 2px solid #00b7ff;
    padding-bottom: 5px;
    margin-bottom: 10px;
    width: 100%;
}

/* Responsive para los filtros */
@media (max-width: 767px) {
    .filter-tabs {
        display: flex;
        overflow-x: auto;
        padding: 5px;
        gap: 8px;
        width: 100%;
    }
    .filter-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* --- NUEVOS ESTILOS DEL SIDEBAR --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: rgba(18, 44, 79, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 1100;
    transform: translateX(-100%); /* Oculto por defecto */
    transition: transform var(--transition-speed) ease;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
}

@media (min-width: 901px) {
    .sidebar.active {
        transform: translateX(0);
    }
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 2rem;
}

.sidebar-header img {
    width: 40px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 12px;
    color: var(--text-cream);
    font-weight: 500;
    transition: all var(--transition-speed);
}

.side-link i {
    width: 20px;
    font-size: 1.2rem;
}

.side-link:hover, .side-link.active {
    background: var(--accent-blue);
    color: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0, 183, 255, 0.3);
}

/* Ajuste del contenedor principal cuando hay sidebar */
body.with-sidebar .main-container {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

/* Reemplaza el bloque .sidebar.active y la media query por esto: */

/* En escritorio: si es "active", se muestra */
@media (min-width: 901px) {
    .sidebar.active {
        transform: translateX(0);
    }
}

/* En celulares: se oculta por defecto y solo sale con "mobile-open" */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: 80%; /* Más ancho en móvil para legibilidad */
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0,0,0,0.8);
    }

    body.with-sidebar .main-container {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* --- ESTILOS DEL FORO --- */
.idea-card {
    background: rgba(251, 249, 228, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(251, 249, 228, 0.2);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.3s ease;
}

.idea-card:hover {
    transform: translateY(-5px);
}

.idea-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.idea-user-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-blue);
}

.idea-body {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-cream);
}

.idea-footer {
    font-size: 0.8rem;
    opacity: 0.6;
    display: flex;
    justify-content: space-between;
}

/* --- BOTONES PEQUEÑOS DEL FORO --- */
.idea-header {
    justify-content: space-between; /* Para que el nombre quede a la izquierda y botones a la derecha */
}

.idea-actions {
    display: flex;
    gap: 8px;
}

.edit-btn-small, .delete-btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-cream);
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
}

.edit-btn-small:hover {
    background: var(--accent-blue);
    color: var(--primary-blue);
}

.delete-btn-small:hover {
    background: #ff4d4d;
    color: white;
}

/* --- ESTILOS DE AYUDA Y SOPORTE LEGAL --- */

/* Navegación de Pestañas */
.tabs-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 25px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-cream);
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.tab-btn.active {
    background: var(--accent-blue);
    color: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0, 183, 255, 0.3);
}

/* Contenido de Pestañas */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Papel Legal Estilo Profesional */
.legal-paper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    color: var(--text-cream);
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.legal-paper h2 {
    color: var(--accent-blue);
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 183, 255, 0.2);
    padding-bottom: 5px;
}

.legal-paper p, .legal-paper li {
    opacity: 0.8;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* Reutilizando y mejorando FAQ */
.faq-question {
    transition: background 0.3s;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-item.active .faq-answer {
    max-height: 500px; /* Permitir respuestas más largas */
}

.faq-container { display: flex; flex-direction: column; gap: 15px; }
.faq-item { background: rgba(251, 249, 228, 0.05); border: 1px solid rgba(251, 249, 228, 0.1); border-radius: 15px; overflow: hidden; transition: 0.3s; }
.faq-question { width: 100%; padding: 20px; background: none; border: none; color: var(--text-cream); display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 1.1rem; }
.faq-answer { max-height: 0; padding: 0 20px; overflow: hidden; transition: 0.3s; background: rgba(0, 0, 0, 0.1); }
.faq-answer p { padding-bottom: 20px; opacity: 0.8; }
.faq-item.active .faq-answer { max-height: 200px; padding-top: 10px; }
.faq-item.active .faq-question i { transform: rotate(180deg); color: var(--accent-blue); }

/* --- TEMA RPG / VIDEOJUEGO --- */
.game-header {
    background: linear-gradient(135deg, rgba(18, 44, 79, 0.9), rgba(0, 183, 255, 0.2));
    padding: 30px;
    border-radius: 20px;
    border: 2px solid #00b7ff;
    box-shadow: 0 0 20px rgba(0, 183, 255, 0.3);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.avatar-frame {
    position: relative;
    width: 100px;
    height: 100px;
}

.level-tag {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #ffcc00;
    color: #122C4F;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    border: 2px solid #122C4F;
}

.rank-badge {
    background: #00b7ff;
    color: #122C4F;
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Barra de XP Estilo Videojuego */
.xp-container { flex: 1; min-width: 250px; }
.xp-text { display: flex; justify-content: space-between; font-weight: 800; font-size: 0.7rem; margin-bottom: 5px; color: #00b7ff; }
.xp-bar-bg { height: 12px; background: rgba(0,0,0,0.5); border-radius: 6px; overflow: hidden; border: 1px solid rgba(0, 183, 255, 0.3); }
.xp-fill { height: 100%; background: linear-gradient(90deg, #00b7ff, #00ffaa); box-shadow: 0 0 10px #00b7ff; transition: width 0.5s ease; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; width: 100%; max-width: 1100px; }
.quest-card { background: rgba(0,0,0,0.3); border: 1px solid rgba(251,249,228,0.1); border-radius: 15px; padding: 20px; margin-bottom: 20px; position: relative; }
.quest-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; color: #00b7ff; }
.quest-header h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }

/* Botones Estilo Juego */
.btn-game-primary { width: 100%; padding: 12px; background: #00b7ff; color: #122C4F; border: none; border-radius: 8px; font-weight: 800; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 0 #0086ba; }
.btn-game-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #0086ba; }
.btn-game-primary:active { transform: translateY(2px); box-shadow: 0 0 0; }

.big-points { font-size: 3.5rem; font-weight: 900; color: #ffcc00; text-shadow: 0 0 15px rgba(255,204,0,0.4); display: block; }

/* Medallas */
.badges-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 15px; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 0.6rem; transition: 0.3s; }
.badge-item i { font-size: 1.5rem; width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.1); border-radius: 50%; color: #ffcc00; }
.badge-item.locked { opacity: 0.2; filter: grayscale(1); }

/* Racha */
.streak-stats { display: flex; justify-content: space-around; margin-bottom: 20px; }
.stat-box { text-align: center; }
.stat-label { font-size: 0.6rem; text-transform: uppercase; opacity: 0.6; display: block; }
.stat-value { font-size: 2rem; font-weight: 800; }
.stat-separator { width: 1px; height: 40px; background: rgba(255,255,255,0.1); }

/* EFECTO DE MEDALLA DESBLOQUEADA */
.badge-item:not(.locked) i {
    background: linear-gradient(135deg, #ffcc00, #ffaa00);
    color: #122C4F;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.badge-item:not(.locked) span {
    color: #ffcc00;
    font-weight: bold;
}

/* --- ESTILOS DE FICHA DE ATRIBUTOS --- */
.attribute-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 183, 255, 0.2);
    min-height: 50px;
}

.attr-label {
    font-weight: 900;
    color: #00b7ff;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.attr-value {
    font-weight: 700;
    color: #FBF9E4;
    font-size: 1rem;
    text-transform: uppercase;
}

.game-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #00b7ff;
    color: #FBF9E4;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Inter', sans-serif;
    outline: none;
    width: 60%;
}

.hidden {
    display: none !important;
}

/* --- ESTILOS DE ATRIBUTOS ESTÁTICOS --- */
.attribute-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid rgba(0, 183, 255, 0.15);
    background: rgba(0, 183, 255, 0.03);
    margin-bottom: 5px;
    border-radius: 4px;
}

.attr-label {
    font-weight: 900;
    color: #00b7ff;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-shadow: 0 0 5px rgba(0, 183, 255, 0.3);
}

.attr-value {
    font-weight: 700;
    color: #FBF9E4;
    font-size: 0.95rem;
    text-transform: uppercase;
}