/* Estilos Dashboard Clean (Replica Mockup) */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.context-title {
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    color: #f8fafc;
}

.context-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Stats Grid - Replica style */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: #1f1f1f;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
}

/* Tinted backgrounds per stat */
.stat-box--score {
    background: linear-gradient(135deg, #1f1f1f 60%, rgba(59, 130, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.15);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
}

.stat-box--accuracy {
    background: linear-gradient(135deg, #1f1f1f 60%, rgba(16, 185, 129, 0.1));
    border-color: rgba(16, 185, 129, 0.15);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.08);
}

.stat-box--mastery {
    background: linear-gradient(135deg, #1f1f1f 60%, rgba(139, 92, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.15);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08);
}

.stat-box--score:hover {
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
}

.stat-box--accuracy:hover {
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15);
}

.stat-box--mastery:hover {
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.15);
}

.stat-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
}

.stat-box--score::before {
    background: linear-gradient(180deg, #3b82f6, #60a5fa);
}

.stat-box--accuracy::before {
    background: linear-gradient(180deg, #10b981, #34d399);
}

.stat-box--mastery::before {
    background: linear-gradient(180deg, #8b5cf6, #a78bfa);
}

.stat-box--score .stat-value {
    color: #60a5fa;
}

.stat-box--accuracy .stat-value {
    color: #34d399;
}

.stat-box--mastery .stat-value {
    color: #a78bfa;
}

.stat-box--score .stat-icon {
    color: #3b82f6;
}

.stat-box--accuracy .stat-icon {
    color: #10b981;
}

.stat-box--mastery .stat-icon {
    color: #8b5cf6;
}

.stat-icon {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.stat-label {
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

/* Feature Soon / Disabled Badge */
.mode-card--disabled {
    filter: grayscale(0.8);
    opacity: 0.7;
    cursor: not-allowed !important;
    position: relative;
    overflow: hidden;
    pointer-events: all;
    /* Allow click event to be captured then blocked by JS */
}

.mode-card--disabled:hover {
    transform: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(31, 31, 31, 0.4) !important;
}

.badge-soon {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-sub {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

/* Detailed Grid */
.detailed-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .detailed-row {
        grid-template-columns: 1fr;
    }
}

.detail-card {
    background: linear-gradient(135deg, #1f1f1f 70%, rgba(59, 130, 246, 0.05));
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    opacity: 0.6;
}

.section-heading {
    margin: 2rem 0 1rem 0;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
}

.section-heading i {
    font-size: 1rem;
}

.mode-card {
    background: linear-gradient(180deg, rgba(31, 31, 31, 0.6) 0%, rgba(20, 20, 20, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 1.8rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 200px;
}

.mode-card:hover {
    transform: translateY(-5px);
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    background: linear-gradient(180deg, rgba(31, 31, 31, 0.8) 0%, rgba(30, 41, 59, 0.6) 100%);
}

.mode-card.mode-card--disabled {
    background: rgba(20, 20, 20, 0.6);
    border-color: rgba(255, 255, 255, 0.03);
    transform: none;
    cursor: default;
}

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #60a5fa;
    flex-shrink: 0;
}

/* Estilos para el Modal de Configuración */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    /* Garantizar sobreponerse al Header */
}

.config-modal {
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

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

.exam-target-option input[type="radio"] {
    display: none;
}

.target-card {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.exam-target-option input[type="radio"]:checked+.target-card {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.exam-target-option:hover .target-card {
    border-color: rgba(96, 165, 250, 0.5);
}

/* Modificador para opciones desactivadas (ej. Residentado) */
.exam-target-option--disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.exam-target-option--disabled .target-card {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 52px; /* Alineación con los otros botones */
}

.area-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #cbd5e1;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.area-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.area-checkbox-label input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#config-difficulty option,
#config-career option {
    background: #1f1f1f;
    color: white;
}

#btn-start-config {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

#btn-start-config:hover {
    background: rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
}

#btn-save-config:hover {
    background: #2563eb;
}

@media (max-width: 480px) {
    .context-title {
        font-size: 1.2rem;
        /* Achica un poco el texto en celulares */
    }
}

/* --- HTML Native Bar Chart Styles --- */
.html-chart-group-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    font-weight: 600;
}

.html-bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.html-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.85rem;
}

.html-bar-label {
    color: #cbd5e1;
    font-weight: 500;
}

.html-bar-value {
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.9rem;
}

.html-bar-track {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5); /* Profundidad */
}

.html-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); /* Resplandor */
}