/* achievements.css - Premium Light Theme with Dark Sidebar & Header (Clon de los Mockups) */

/* Importar tipografías desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Paleta de Colores de los Mockups */
    --bg-main: #f8f9fa;
    /* Fondo gris claro de la página */
    --bg-card: #ffffff;
    /* Fondo blanco de las tarjetas */
    --bg-sidebar: #1e293b;
    /* Azul pizarra oscuro para el menú lateral (Slate 800) */
    --bg-header: #0f172a;
    /* Azul marino muy oscuro para la cabecera (Slate 900) */

    --primary: #2563eb;
    /* Azul principal de los botones y activos (Blue 600) */
    --primary-hover: #1d4ed8;
    /* Azul oscuro para hovers (Blue 700) */
    --primary-light: rgba(37, 99, 235, 0.1);

    --success: #10b981;
    /* Verde esmeralda para éxitos y desbloqueados (Emerald 500) */
    --success-light: rgba(16, 185, 129, 0.1);

    --warning: #f59e0b;
    /* Dorado para medalla Primer Acierto (Amber 500) */
    --warning-glow: rgba(245, 158, 11, 0.15);

    --silver: #94a3b8;
    /* Gris pizarra para logros plateados y bloqueados */
    --silver-glow: rgba(148, 163, 184, 0.15);

    --border-color: #e2e8f0;
    /* Bordes gris suave */
    --border-color-hover: #cbd5e1;

    /* Colores de Texto */
    --text-main: #0f172a;
    /* Texto principal (Slate 900) */
    --text-secondary: #475569;
    /* Texto secundario (Slate 600) */
    --text-muted: #94a3b8;
    /* Texto atenuado/leyendas (Slate 400) */
    --text-white: #ffffff;

    /* Configuración de Estructura */
    --sidebar-width: 260px;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 4px 12px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-medium: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

/* Estilos de Reset de Navegador */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Contenedor Principal (Flexbox) */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ==========================================================================
   BARRA LATERAL DE NAVEGACIÓN (SIDEBAR)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.4));
}

.logo-text-group {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Menú de navegación */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    /* Slate 400 */
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.nav-item.active {
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-icon {
    font-size: 1.15rem;
}

/* Footer del Sidebar */
.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: #64748b;
    /* Slate 500 */
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.architecture-label {
    color: var(--success);
    font-weight: 700;
    margin-top: 4px;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

/* Botón de comparación con mockup */
.mockup-btn {
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: var(--transition-smooth);
}

.mockup-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}


/* ==========================================================================
   CABECERA (HEADER BAR)
   ========================================================================== */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Evita desborde flex */
    padding-bottom: 240px;
    /* Espacio para consola de simulación fija */
}

.header-bar {
    height: 70px;
    background-color: var(--bg-header);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Buscador */
.header-search {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 12px;
    width: 320px;
    gap: 8px;
}

.search-icon {
    font-size: 0.85rem;
    color: #64748b;
}

.header-search input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}

.header-search input::placeholder {
    color: #64748b;
}

/* Sección Derecha de Header */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-wrapper {
    position: relative;
    cursor: pointer;
    padding: 4px;
}

.notification-icon {
    font-size: 1.25rem;
    color: #cbd5e1;
    transition: var(--transition-smooth);
}

.notification-wrapper:hover .notification-icon {
    color: #ffffff;
}

.notification-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    /* Rojo */
    border-radius: 50%;
    border: 2px solid var(--bg-header);
}

.header-divider {
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

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

.user-name-mini {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f1f5f9;
}

.user-role-mini {
    font-size: 0.75rem;
    color: #64748b;
}


/* ==========================================================================
   ESTRUCTURA DE VISTAS Y CONTENEDORES
   ========================================================================== */
.tab-content {
    display: none;
    padding: 32px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.tab-content.active-tab {
    display: block;
}

/* Animación de fade-in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tarjetas Generales (Cards) */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

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

.card-header.border-none {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-action {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background-color: var(--primary-light);
    padding: 4px 10px;
    border-radius: 20px;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}


/* ==========================================================================
   VISTA: DASHBOARD (INICIO)
   ========================================================================== */
.dashboard-banner {
    background: linear-gradient(135deg, var(--bg-header) 0%, #1e293b 100%);
    border-radius: 8px;
    padding: 28px 32px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.banner-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.banner-text p {
    font-size: 0.95rem;
    color: #94a3b8;
    max-width: 600px;
}

.banner-badge {
    background-color: var(--primary);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Grilla del Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    align-items: start;
}

/* Columna Izquierda: Partidos */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.match-item {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: var(--transition-smooth);
}

.match-item:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-phase {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.team-side {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 35%;
}

.team-side.local {
    justify-content: flex-start;
}

.team-side.visitante {
    justify-content: flex-end;
}

.flag {
    font-size: 1.75rem;
}

.team-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Inputs de Marcador */
.match-score-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 30%;
}

.score-input {
    width: 48px;
    height: 40px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-smooth);
}

.score-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.score-divider {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* Fila de acción de partido */
.match-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.time-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.time-badge.limit-green {
    background-color: var(--success-light);
    color: var(--success);
}

.time-badge.limit-red {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.save-pred-btn {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.save-pred-btn:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* Columna Derecha: Leaderboard e Historial */
.text-link-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.text-link-btn:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Lista de Clasificación */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid transparent;
}

.leaderboard-item.current-user {
    background-color: var(--primary-light);
    border: 1px solid rgba(37, 99, 235, 0.15);
    font-weight: 700;
}

.lb-rank {
    width: 24px;
    font-weight: 700;
    color: var(--text-muted);
}

.leaderboard-item.current-user .lb-rank {
    color: var(--primary);
}

.lb-name {
    flex-grow: 1;
    color: var(--text-main);
}

.lb-pts {
    font-weight: 700;
    color: var(--text-secondary);
}

.leaderboard-item.current-user .lb-pts {
    color: var(--primary);
}

/* Resumen de Logros */
.progress-container {
    margin-bottom: 18px;
}

.progress-text-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.progress-lbl {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-bar-track {
    height: 8px;
    background-color: var(--bg-main);
    border-radius: 10px;
    width: 100%;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 10px;
    transition: width 0.4s ease-out;
}

.earned-badges-mini {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 10px;
}

.earned-badge-mini-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.earned-badge-mini-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-soft);
}

.no-badges-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
    padding: 12px 0;
}


/* ==========================================================================
   VISTA: MI PERFIL & LOGROS DETALLADOS (m12_perfil.png)
   ========================================================================== */
.profile-header-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    box-shadow: var(--shadow-soft);
    flex-wrap: wrap;
    gap: 24px;
}

.profile-header-main {
    display: flex;
    align-items: center;
    gap: 24px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.profile-title-details h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 2px;
}

.profile-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.profile-badges-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-tag {
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.profile-tag.status-active {
    background-color: var(--success-light);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

/* Estadísticas Dashboard del Perfil */
.profile-stats-dashboard {
    display: flex;
    gap: 16px;
}

.pstat-item {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 130px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pstat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

.pstat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Achievements Card & Grid */
.achievements-section-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.achievements-section-title p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.season-badge {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
    /* Dorado oscuro */
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.achievements-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

/* Tarjeta de Logro (Badge Card) */
.achievement-card-detailed {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.achievement-card-detailed:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--border-color-hover);
}

/* Icono del Logro */
.ach-card-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin-bottom: 16px;
    position: relative;
    transition: var(--transition-smooth);
}

.achievement-card-detailed:hover .ach-card-icon-wrapper {
    transform: scale(1.08);
}

/* Estados de Medalla */
.achievement-card-detailed.unlocked.PRIMER_ACIERTO .ach-card-icon-wrapper {
    background: radial-gradient(circle, #fef3c7 0%, #fde68a 100%);
    border-color: #fcd34d;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.achievement-card-detailed.unlocked.PLANIFICADOR .ach-card-icon-wrapper {
    background: radial-gradient(circle, #dbeafe 0%, #bfdbfe 100%);
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.achievement-card-detailed.unlocked.FIDELIDAD .ach-card-icon-wrapper {
    background: radial-gradient(circle, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.15);
}

/* Contenido de la Tarjeta */
.ach-card-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.ach-card-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

/* Indicadores de Estado */
.ach-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
}

.ach-status-badge.unlocked {
    background-color: var(--success-light);
    color: var(--success);
}

.ach-status-badge.locked {
    background-color: #f1f5f9;
    color: var(--text-muted);
}

/* Estado de Bloqueado (Locked grayscale) */
.achievement-card-detailed.locked {
    background-color: rgba(248, 250, 252, 0.6);
}

.achievement-card-detailed.locked .ach-card-icon-wrapper {
    filter: grayscale(1);
    opacity: 0.5;
}

.achievement-card-detailed.locked .ach-card-info h3,
.achievement-card-detailed.locked .ach-card-info p {
    opacity: 0.7;
}

/* Icono de Candado para Bloqueados */
.lock-icon-overlay {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #475569;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    border: 2px solid #ffffff;
    box-shadow: var(--shadow-soft);
}


/* ==========================================================================
   VISTA DE TABLA DE POSICIONES Y ESTADOS COMPLEMENTARIOS
   ========================================================================== */
.positions-table-wrapper {
    overflow-x: auto;
    margin-top: 12px;
}

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

.positions-table th,
.positions-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.positions-table th {
    font-weight: 700;
    color: var(--text-secondary);
    background-color: var(--bg-main);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.positions-table tbody tr {
    transition: var(--transition-smooth);
}

.positions-table tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.5);
}

.positions-table tbody tr.highlighted-row {
    background-color: var(--primary-light);
    font-weight: 600;
}

.positions-table tbody tr.highlighted-row td {
    border-bottom: 1px solid rgba(37, 99, 235, 0.15);
}

.text-blue {
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-icon {
    font-size: 3rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.empty-state p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.5;
}

.sim-action-btn {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: var(--transition-smooth);
}

.sim-action-btn:hover {
    background-color: var(--primary-hover);
}

.rules-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rule-group h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary);
}

.rule-group ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 4px;
}

.rule-group ul li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 16px;
    line-height: 1.5;
}

.rule-group ul li::before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0;
    font-weight: 700;
}


/* ==========================================================================
   CONSOLA DE SIMULACIÓN (DOCK FIJO EN LA PARTE INFERIOR)
   ========================================================================== */
.simulation-console-section {
    position: fixed;
    bottom: 0;
    right: 0;
    left: var(--sidebar-width);
    background-color: #0f172a;
    /* Slate 900 */
    border-top: 2px solid #334155;
    z-index: 100;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

/* Para navegadores responsive sin sidebar */
@media (max-width: 900px) {
    .simulation-console-section {
        left: 0;
    }
}

.console-card {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Cabecera del Consola */
.console-header {
    background-color: #1e293b;
    /* Slate 800 */
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #334155;
}

.console-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dot.red {
    background-color: #ef4444;
}

.terminal-dot.yellow {
    background-color: #f59e0b;
}

.terminal-dot.green {
    background-color: #10b981;
}

.console-header-left h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-left: 6px;
    letter-spacing: 0.3px;
}

.db-status-pill {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.toggle-icon {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 10px;
    transition: var(--transition-smooth);
}

/* Cuerpo de la Consola */
.console-body {
    padding: 20px 24px;
    height: 190px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition-smooth);
}

/* Estado Minimizado */
.simulation-console-section.minimized {
    transform: translateY(190px);
}

.simulation-console-section.minimized .toggle-icon {
    transform: rotate(180deg);
}

.console-intro-text {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.4;
}

.console-dashboard {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 20px;
    flex-grow: 1;
    min-height: 0;
}

.console-controls h4,
.console-log-area h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Botones de Control */
.console-btn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.sim-btn {
    background-color: #334155;
    border: 1px solid #475569;
    color: #f1f5f9;
    padding: 8px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sim-btn:hover {
    background-color: #475569;
    border-color: #64748b;
}

.sim-btn.btn-exact:hover {
    border-color: var(--warning);
    color: #fff;
}

.sim-btn.btn-early:hover {
    border-color: var(--primary);
    color: #fff;
}

.sim-btn.btn-late:hover {
    border-color: #cbd5e1;
    color: #fff;
}

.sim-btn.btn-fidelity:hover {
    border-color: var(--success);
    color: #fff;
}

.sim-btn.btn-reset {
    grid-column: span 2;
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    justify-content: center;
}

.sim-btn.btn-reset:hover {
    background-color: rgba(239, 68, 68, 0.25);
    border-color: #f87171;
    color: #ffffff;
}

/* Pantalla del Terminal */
.terminal {
    background-color: #020617;
    /* Slate 950 */
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    overflow-y: auto;
    height: 105px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-line {
    line-height: 1.4;
    word-break: break-all;
}

.terminal-line.system-line {
    color: #f1f5f9;
}

.terminal-line.event-line {
    color: #f59e0b;
    font-weight: 600;
}

.terminal-line.handler-line {
    color: #60a5fa;
}

.terminal-line.sql-line {
    color: #34d399;
}

.terminal-line.success-line {
    color: #22c55e;
    font-weight: 700;
}

.terminal-line.error-line {
    color: #f87171;
}

.terminal-line.helper-line {
    color: #64748b;
    font-style: italic;
}


/* ==========================================================================
   MODALES POPUP (BADGE DETAIL & MOCKUP COMPARISON)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    max-width: 460px;
    width: 90%;
    box-shadow: var(--shadow-medium);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: var(--text-main);
}

/* Efecto de brillo de fondo del Modal */
.modal-glowing-effect {
    position: absolute;
    top: -50px;
    left: calc(50% - 125px);
    width: 250px;
    height: 250px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}

.modal-glowing-effect.PRIMER_ACIERTO {
    background: radial-gradient(circle, var(--warning) 0%, transparent 70%);
}

.modal-glowing-effect.PLANIFICADOR {
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.modal-glowing-effect.FIDELIDAD {
    background: radial-gradient(circle, var(--success) 0%, transparent 70%);
}

.modal-body-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.modal-badge-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

#modal-badge-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
}

.modal-status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.modal-status-badge.unlocked {
    background-color: var(--success-light);
    color: var(--success);
}

.modal-status-badge.locked {
    background-color: #f1f5f9;
    color: var(--text-muted);
}

.modal-badge-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.modal-meta-section {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 100%;
    margin-bottom: 20px;
}

/* Tabs Educativas */
.architecture-tabs {
    width: 100%;
    margin-top: 12px;
    text-align: left;
}

.arch-tab-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.arch-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 6px 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.arch-tab-btn:hover {
    color: var(--primary);
}

.arch-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.arch-tab-content {
    display: none;
}

.arch-tab-content.active {
    display: block;
}

.tab-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

pre {
    background-color: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 10px;
    overflow-x: auto;
    text-align: left;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    color: #38bdf8;
    /* Azul claro */
}

.modal-footer {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    width: 100%;
}

.btn-close-modal {
    background-color: var(--text-main);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
}

.btn-close-modal:hover {
    background-color: #1e293b;
}

/* ==========================================================================
   MODAL MOCKUP COMPARATOR (MOCKUP COMPARISON MODAL)
   ========================================================================== */
.modal-card.mockup-large-card {
    max-width: 960px;
    width: 95%;
}

.mockup-large-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

.mockup-large-card .modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.mockup-comparison-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mockup-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mockup-select-row select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.mockup-view-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.mockup-view-pane {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 480px;
}

.mockup-view-pane h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.mockup-live-preview {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
    gap: 12px;
}

.mockup-live-preview p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.preview-indicator {
    background-color: var(--success-light);
    color: var(--success);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
}

.mockup-image-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background-color: #000;
    position: relative;
    max-height: 430px;
}

.mockup-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


/* ==========================================================================
   AJUSTES RESPONSIVOS (RESPONSIVE STYLES)
   ========================================================================== */
@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 16px;
    }

    .logo {
        margin-bottom: 16px;
        justify-content: center;
    }

    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 6px;
        gap: 8px;
    }

    .nav-item {
        white-space: nowrap;
        width: auto;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .sidebar-footer {
        display: none;
        /* Ocultar en móviles */
    }

    .main-content {
        padding-bottom: 260px;
        /* Más espacio en móviles */
    }

    .header-bar {
        padding: 0 16px;
    }

    .header-search {
        width: 200px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .profile-header-card {
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .profile-header-main {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats-dashboard {
        justify-content: space-between;
    }

    .pstat-item {
        min-width: 0;
        flex-grow: 1;
        padding: 10px;
    }

    .mockup-view-split {
        grid-template-columns: 1fr;
    }

    .mockup-view-pane {
        min-height: 300px;
    }
}

/* ==========================================================================
   POPUP DE ALERTA DE DESBLOQUEO (UNLOCK ALERT POPUP)
   ========================================================================== */
.unlock-alert-popup {
    position: fixed;
    bottom: 220px;
    /* Arriba de la consola de simulación */
    right: 24px;
    background: #0f172a;
    border: 1px solid var(--success);
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 320px;
}

.unlock-alert-popup.active {
    transform: translateX(0);
}

.alert-popup-icon {
    font-size: 1.75rem;
    animation: bounce-popup 1s infinite alternate;
}

@keyframes bounce-popup {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-4px);
    }
}

.alert-popup-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.alert-popup-body strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--success);
}

.alert-popup-body span {
    font-size: 0.75rem;
    color: #cbd5e1;
}

.unlock-alert-popup.PRIMER_ACIERTO {
    border-color: var(--warning);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.2);
}

.unlock-alert-popup.PRIMER_ACIERTO .alert-popup-body strong {
    color: var(--warning);
}

.unlock-alert-popup.PLANIFICADOR {
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
}

.unlock-alert-popup.PLANIFICADOR .alert-popup-body strong {
    color: var(--primary);
}