/* ==========================================================================
   GEOMETRY WORLD - ESTILOS GLOBALES (LIGHT MODE ESTÁNDAR)
   ========================================================================== */

:root {
    /* Fondo Claro Estándar */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.94);

    /* Colores del Logo y Juego (Optimizados para fondo blanco) */
    --primary-cyan: #0284c7;
    --primary-cyan-light: #e0f2fe;
    --secondary-blue: #0369a1;

    --accent-gold: #d97706;
    --accent-gold-light: #fef3c7;
    --accent-orange: #ea580c;

    --accent-green: #059669;
    --accent-green-light: #d1fae5;

    /* Textos */
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Tipografía */
    --font-title: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-pixel: 'Pixelify Sans', cursive;

    /* Bordes y Sombras Elegantes */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-body);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: inline-block;
    transition: transform 0.3s ease;
}

.nav-logo:hover .nav-logo-img {
    transform: rotate(12deg) scale(1.08);
}


.logo-highlight {
    color: var(--primary-cyan);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-body);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-cyan);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--secondary-blue));
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
}

.btn-outline {
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    background: transparent;
}

.btn-outline:hover {
    background: var(--accent-gold-light);
    color: var(--accent-gold);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* Hero Section */
.hero-section {
    padding: 4rem 2rem;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 3.5rem;
    position: relative;
    overflow: hidden;
}

.hero-badge {
    display: inline-block;
    background-color: var(--primary-cyan-light);
    color: var(--primary-cyan);
    font-family: var(--font-pixel);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    margin-bottom: 1.2rem;
}

.hero-title {
    font-family: var(--font-title);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-cyan), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 720px;
    margin: 0 auto 2rem auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Sección de Mundos Grid */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

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

.mundos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.8rem;
}

.mundo-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mundo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--accent-gold));
}

.mundo-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-cyan);
}

.badge-world {
    background-color: var(--accent-gold-light);
    color: var(--accent-gold);
    font-family: var(--font-pixel);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.card-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.6rem;
    color: var(--text-heading);
}

.card-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 1.2rem 0;
    line-height: 1.5;
}

.card-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.btn-card {
    color: var(--primary-cyan);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.3s ease;
}

.btn-card:hover {
    color: var(--secondary-blue);
}

/* Footer */
.footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 3rem;
}

.footer-sub {
    font-size: 0.85rem;
    margin-top: 0.4rem;
    color: var(--primary-cyan);
    font-weight: 600;
}

/* Detalle de Localización */
.detalle-container {
    max-width: 900px;
    margin: 0 auto;
}

.btn-back {
    display: inline-block;
    color: var(--primary-cyan);
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 1rem;
}

.location-banner {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.location-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    color: var(--text-heading);
    margin: 0.5rem 0;
}

.location-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Guía Avatar */
.guide-box {
    background: var(--primary-cyan-light);
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.6rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.guide-avatar {
    font-size: 2.5rem;
}

.guide-text h4 {
    font-family: var(--font-title);
    color: var(--primary-cyan);
    margin-bottom: 0.2rem;
}

.guide-text p {
    color: var(--text-body);
    font-size: 0.95rem;
}

/* Preguntas Card */
.section-title-left {
    font-family: var(--font-title);
    font-size: 1.6rem;
    color: var(--text-heading);
    margin-bottom: 1.5rem;
}

.pregunta-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.8rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.pregunta-num {
    font-family: var(--font-pixel);
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 0.9rem;
}

.pregunta-text {
    font-family: var(--font-title);
    font-size: 1.25rem;
    color: var(--text-heading);
    margin: 0.4rem 0 0.8rem 0;
}

.pregunta-guia {
    background: #f8fafc;
    border-left: 4px solid var(--accent-gold);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--text-body);
    margin-bottom: 1.2rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Opciones de Respuesta */
.respuestas-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.respuesta-option {
    background: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.2rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-body);
    transition: all 0.2s ease;
}

.respuesta-option:hover {
    border-color: var(--primary-cyan);
    background: var(--primary-cyan-light);
}

.respuesta-option.selected.correct {
    border-color: var(--accent-green);
    background: var(--accent-green-light);
    color: #065f46;
}

.respuesta-option.selected.incorrect {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

/* Feedback Box */
.feedback-box {
    margin-top: 1.2rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.feedback-success {
    background: var(--accent-green-light);
    border: 1px solid var(--accent-green);
    color: #065f46;
}

.feedback-error {
    background: #fee2e2;
    border: 1px solid #f87171;
    color: #991b1b;
}

.feedback-icon {
    font-weight: 800;
    display: block;
    margin-bottom: 0.3rem;
}

/* Miniaturas de los Mundos */
.world-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border-color);
}

.thumb-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.thumb-item:hover {
    transform: scale(1.1);
    border-color: var(--primary-cyan);
    z-index: 5;
}

.gallery-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    text-align: center;
    padding: 0.1rem 0;
}

/* Modal Lightbox Galería */
.modal-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--accent-gold);
}

.modal-content-wrapper {
    max-width: 90%;
    max-height: 85vh;
    text-align: center;
    position: relative;
    margin: auto;
}

.modal-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: var(--radius-md);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 3px solid #ffffff;
    object-fit: contain;
}

.modal-caption {
    margin-top: 1rem;
    color: #ffffff;
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-weight: 600;
}

/* ==========================================================================
   PÁGINA DE LOGIN Y ESTADO DE SESIÓN
   ========================================================================== */

.login-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
    padding: 2rem 1rem;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    max-width: 460px;
    width: 100%;
    padding: 2.5rem;
    text-align: center;
}

.login-logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.login-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.8rem;
}

/* Alertas Dinámicas */
.login-alert {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background-color: var(--accent-green-light);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Inputs y Formularios */
.form-group {
    text-align: left;
    margin-bottom: 1.4rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.4rem;
}

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

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-block {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.login-footer {
    margin-top: 1.8rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-color);
}

/* Botón de Mostrar/Ocultar Contraseña */
.btn-toggle-pwd {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-toggle-pwd:hover {
    opacity: 1;
    transform: scale(1.15);
}

.btn-toggle-pwd:focus {
    outline: none;
}


.link-back {
    color: var(--primary-cyan);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.link-back:hover {
    color: var(--secondary-blue);
    text-decoration: underline;
}

/* Estado de Usuario en la Barra de Navegación */
.user-nav-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-greeting {
    font-size: 0.9rem;
    color: var(--text-heading);
    font-weight: 500;
}

.role-badge {
    background-color: var(--primary-cyan-light);
    color: var(--secondary-blue);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-logout {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: #ef4444;
    color: #ffffff;
}

/* ==========================================================================
   PANEL DE CONTROL (DASHBOARD)
   ========================================================================== */

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.dashboard-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.banner-title {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

.banner-desc {
    color: #94a3b8;
    font-size: 1rem;
}

.badge-role {
    background-color: var(--accent-gold);
    color: #ffffff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.avatar-icon {
    font-size: 3.5rem;
}

/* Grilla de Métricas (KPIs) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.icon-cyan {
    background: #e0f2fe;
}

.icon-gold {
    background: #fef3c7;
}

.icon-green {
    background: #d1fae5;
}

.icon-blue {
    background: #e0e7ff;
}

.stat-value {
    display: block;
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.2;
}

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

/* Grilla de Módulos */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.module-card:hover {
    border-color: var(--primary-cyan);
    box-shadow: var(--shadow-hover);
}

.module-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.module-icon {
    font-size: 1.8rem;
}

.module-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
}

.module-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Tablas de Datos */
.table-responsive {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.data-table th {
    background: #f1f5f9;
    color: var(--text-heading);
    padding: 1rem 1.2rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-body);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

.badge-status-active {
    background-color: #d1fae5;
    color: #065f46;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-status-inactive {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}