/* ========================================
   ESTILOS GLOBALES DE TEMAS PARA TODAS LAS VISTAS
   ======================================== */

/* Variables CSS para temas */
:root {
    --primary-color: #0c2544;
    --secondary-color: #e27328;
    --accent-color: #1e3a5f;
    --text-light: #ffffff;
    --text-dark: #2c3e50;
    --glass-bg: rgba(18, 36, 84, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --shadow-hover: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
    --gradient-primary: linear-gradient(135deg, #0c2544 0%, #1e3a5f 50%, #2d5d8a 100%);
    --gradient-primary-light: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%);
    --gradient-glass: linear-gradient(135deg, rgba(18, 36, 84, 0.9) 0%, rgba(30, 58, 95, 0.8) 100%);
    --gradient-glass-light: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.8) 100%);
}

/* ========================================
   ESTILOS BASE PARA TODAS LAS VISTAS
   ======================================== */

/* Estilos base del body */
body {
    background: var(--gradient-primary);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

/* ========================================
   MODO CLARO
   ======================================== */

body.light-mode {
    background: var(--gradient-primary-light) !important;
}

/* Estilos de texto para modo claro - ALTA PRIORIDAD */
body.light-mode .module-title,
body.light-mode .welcome-title,
body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode h5,
body.light-mode h6,
body.light-mode .module-card .module-title,
body.light-mode .module-card .module-description {
    color: var(--text-dark) !important;
}

/* Estilos específicos para texto en contenedores con imagen de fondo en modo claro */
body.light-mode .module-card .module-title,
body.light-mode .module-card .module-description {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7) !important;
}

/* Asegurar que el contenido de los módulos sea visible en modo claro - TONO MÁS SUTIL */
body.light-mode .module-content {
    background: rgba(18, 36, 84, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Contenedores internos en modo claro - TONO MÁS SUTIL */
body.light-mode .module-card {
    background: rgba(18, 36, 84, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

body.light-mode .module-card:hover {
    background: rgba(30, 58, 95, 0.4) !important;
    border-color: var(--secondary-color) !important;
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5) !important;
}

/* Efecto hover para texto en modo claro */
body.light-mode .module-card:hover .module-title {
    color: var(--secondary-color) !important;
}

body.light-mode .module-description,
body.light-mode .welcome-description,
body.light-mode p,
body.light-mode span,
body.light-mode label {
    color: var(--text-dark) !important;
}

body.light-mode .form-control {
    border: 2px solid rgba(0, 0, 0, 0.2) !important;
    background: rgba(248, 249, 250, 0.95) !important;
    color: var(--text-dark) !important;
}

/* Partículas en modo claro */
body.light-mode .background-particles div,
body.light-mode .background-particles::before,
body.light-mode .background-particles::after,
body.light-mode .background-particles .particle-1,
body.light-mode .background-particles .particle-2,
body.light-mode .background-particles .particle-3,
body.light-mode .background-particles .particle-4,
body.light-mode .background-particles .particle-5 {
    background: rgba(226, 115, 40, 0.6) !important;
}

/* Partículas en modo oscuro */
body.dark-mode .background-particles div,
body.dark-mode .background-particles::before,
body.dark-mode .background-particles::after,
body.dark-mode .background-particles .particle-1,
body.dark-mode .background-particles .particle-2,
body.dark-mode .background-particles .particle-3,
body.dark-mode .background-particles .particle-4,
body.dark-mode .background-particles .particle-5 {
    background: rgba(255, 255, 255, 0.5) !important;
}

/* ========================================
   ESTILOS DEL HEADER PARA TODAS LAS VISTAS
   ======================================== */

/* Header en modo claro - títulos más visibles */
body.light-mode .navbar h1,
body.light-mode .navbar .navbar-title,
body.light-mode .navbar .navbar-brand,
body.light-mode header h1 {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7) !important;
    font-weight: 700 !important;
}

/* Header en modo oscuro */
body.dark-mode .navbar h1,
body.dark-mode .navbar .navbar-title,
body.dark-mode .navbar .navbar-brand,
body.dark-mode header h1 {
    color: #ffffff !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
    font-weight: 600 !important;
}

/* Estilos adicionales para elementos del header en modo claro */
body.light-mode .navbar {
    background-color: #0c2544 !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
}

body.light-mode .navbar .navbar-brand {
    color: #ffffff !important;
    font-weight: 700 !important;
}

body.light-mode .navbar .nav-link {
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

body.light-mode .navbar .nav-link:hover {
    color: var(--secondary-color) !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7) !important;
}

/* Título principal del header en modo claro - MÁXIMA VISIBILIDAD */
body.light-mode #navbarTitle,
body.light-mode .navbar h1#navbarTitle,
body.light-mode header h1 {
    color: #ffffff !important;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9) !important;
    font-weight: 800 !important;
    font-size: 1.5rem !important;
    letter-spacing: 0.5px !important;
}

/* Título del header en modo oscuro */
body.dark-mode #navbarTitle,
body.dark-mode .navbar h1#navbarTitle,
body.dark-mode header h1 {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6) !important;
    font-weight: 700 !important;
}

/* ========================================
   MODO OSCURO
   ======================================== */

body.dark-mode {
    background: var(--gradient-primary) !important;
}

body.dark-mode .module-title,
body.dark-mode .welcome-title,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: var(--text-light) !important;
}

body.dark-mode .module-description,
body.dark-mode .welcome-description,
body.dark-mode p,
body.dark-mode span,
body.dark-mode label {
    color: var(--text-light) !important;
}

body.dark-mode .module-card {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--glass-border) !important;
}

body.dark-mode .form-control {
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(0, 0, 0, 0.1) !important;
    color: var(--text-light) !important;
}

/* ========================================
   ESTILOS DE CONTENEDORES PARA TODAS LAS VISTAS
   ======================================== */

/* Contenedor principal */
.main-container {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    z-index: 10;
}

/* Contenedor principal - TOTALMENTE TRANSPARENTE */
body.light-mode .main-container {
    background: transparent !important;
}

/* Contenedor de bienvenida en modo claro - COLOR CLARO */
body.light-mode .welcome-container {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

/* Grid de módulos */
.modules-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    z-index: 15;
    position: relative;
}

/* Tarjetas de módulos */
.module-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 180px;
    min-height: 180px;
    box-shadow: var(--shadow-light);
    z-index: 20;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.15);
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.module-card:hover::before {
    left: 100%;
}

.module-card:hover .module-icon {
    transform: scale(1.1) rotate(5deg);
}

.module-card:hover .module-title {
    color: var(--secondary-color);
}

/* Iconos de módulos */
.module-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 0.8rem;
    transition: all 0.4s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    object-fit: contain;
}

/* Iconos en modo claro - asegurar visibilidad */
body.light-mode .module-icon {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)) !important;
}

/* Títulos de módulos */
.module-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 0.3rem;
    transition: color 0.3s ease;
    line-height: 1.3;
}

/* Descripciones de módulos */
.module-description {
    color: var(--text-light);
    opacity: 0.8;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* ========================================
   ESTILOS DE FORMULARIOS PARA TODAS LAS VISTAS
   ======================================== */

.form-control {
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(226, 115, 40, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   RESPONSIVE DESIGN PARA TODAS LAS VISTAS
   ======================================== */

@media (max-width: 768px) {
    .modules-grid {
        grid-template-columns: 1fr;
        width: 95%;
        gap: 1rem;
    }

    .module-card {
        height: 160px;
        padding: 1.5rem;
    }

    .module-icon {
        width: 40px;
        height: 40px;
    }

    .module-title {
        font-size: 1rem;
    }

    .module-description {
        font-size: 0.75rem;
    }
}

/* ========================================
   ANIMACIONES PARA TODAS LAS VISTAS
   ======================================== */

/* Animación de entrada */
.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

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

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* ========================================
   ESTILOS DE PARTÍCULAS PARA TODAS LAS VISTAS
   ======================================== */

/* Asegurar que las partículas sean visibles */
.background-particles {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: -1000 !important;
    overflow: hidden !important;
}

/* Partículas base */
.background-particles div,
.background-particles::before,
.background-particles::after,
.background-particles .particle-1,
.background-particles .particle-2,
.background-particles .particle-3,
.background-particles .particle-4,
.background-particles .particle-5 {
    position: absolute !important;
    pointer-events: none !important;
    z-index: -1000 !important;
    border-radius: 50% !important;
    animation: floatParticle 8s ease-in-out infinite !important;
}

/* Animación de partículas */
@keyframes floatParticle {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    50% {
        transform: translateY(-30px) translateX(15px);
        opacity: 0.8;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0;
    }
}
