/* ============================================
   EXAMEN - ESTILOS ESPECÍFICOS
   ============================================ */

:root {
    --exam-primary: #FFB84D;
    --exam-success: #5CB85C;
    --exam-danger: #d9534f;
    --exam-warning: #f0ad4e;
    --exam-info: #4A90E2;
}

/* Body del Examen */
.exam-body {
    background: #f5f7fa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFB84D 0%, #FF9500 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-screen.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.loading-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ============================================
   HEADER DEL EXAMEN
   ============================================ */
.exam-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    color: white;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.exam-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.exam-info .exam-title {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.exam-info .exam-profile {
    font-size: 1rem;
    margin: 0;
    opacity: 0.8;
}

.exam-stats {
    display: flex;
    gap: 2rem;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.stat-box i {
    font-size: 2rem;
    color: var(--exam-primary);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ============================================
   BARRA DE PROGRESO
   ============================================ */
.progress-bar-container {
    height: 8px;
    background: #e9ecef;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--exam-primary) 0%, var(--exam-success) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.exam-main {
    padding: 3rem 0;
}

.exam-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   INDICADOR DE SECCIÓN
   ============================================ */
.section-indicator {
    text-align: center;
    margin-bottom: 2rem;
}

.section-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--exam-info) 0%, #357ABD 100%);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* ============================================
   TARJETA DE PREGUNTA
   ============================================ */
.question-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.question-number {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

.question-statement {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* ============================================
   IMAGEN DE PREGUNTA
   ============================================ */
.question-image-container {
    margin: 2rem 0;
    text-align: center;
    position: relative;
}

.question-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.question-image:hover {
    transform: scale(1.02);
}

.image-zoom-btn {
    margin-top: 1rem;
    background: var(--exam-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-zoom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 184, 77, 0.4);
}

/* ============================================
   OPCIONES DE RESPUESTA
   ============================================ */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 3px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item:hover {
    background: #e9ecef;
    border-color: var(--exam-primary);
    transform: translateX(5px);
}

.option-item.selected {
    background: linear-gradient(135deg, #FFF9F0 0%, #ffffff 100%);
    border-color: var(--exam-primary);
    box-shadow: 0 5px 20px rgba(255, 184, 77, 0.3);
}

.option-letter {
    width: 50px;
    height: 50px;
    background: white;
    border: 3px solid #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #6c757d;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.option-item.selected .option-letter {
    background: var(--exam-primary);
    border-color: var(--exam-primary);
    color: white;
}

.option-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #2c3e50;
}

/* ============================================
   CRONÓMETRO DE PREGUNTA
   ============================================ */
.question-timer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

.question-timer-bar {
    height: 8px;
    background: linear-gradient(90deg, var(--exam-success) 0%, var(--exam-danger) 100%);
    border-radius: 10px;
    margin-bottom: 1rem;
    width: 100%;
    transition: width 1s linear;
}

.question-timer-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: #666;
}

/* ============================================
   NAVEGACIÓN
   ============================================ */
.exam-navigation {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.nav-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.prev-btn {
    background: #e9ecef;
    color: #6c757d;
}

.prev-btn:hover:not(:disabled) {
    background: #dee2e6;
    transform: translateY(-2px);
}

.prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.next-btn {
    background: linear-gradient(135deg, var(--exam-primary) 0%, #FF9500 100%);
    color: white;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 184, 77, 0.4);
}

.finish-btn {
    background: linear-gradient(135deg, var(--exam-success) 0%, #449D44 100%);
    color: white;
}

.finish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(92, 184, 92, 0.4);
}

/* ============================================
   NAVEGACIÓN RÁPIDA
   ============================================ */
.quick-nav {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.quick-nav-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1.5rem;
    cursor: pointer;
}

.quick-nav-header i {
    color: var(--exam-primary);
    font-size: 1.5rem;
}

.quick-nav-header span {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
}

.toggle-quick-nav {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.quick-nav-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.quick-nav-content.collapsed {
    max-height: 0;
}

.quick-nav-section {
    margin-bottom: 2rem;
}

.quick-nav-section h4 {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.quick-nav-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.75rem;
}

.quick-nav-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-nav-btn:hover {
    border-color: var(--exam-primary);
    transform: scale(1.1);
}

.quick-nav-btn.answered {
    background: var(--exam-success);
    border-color: var(--exam-success);
    color: white;
}

.quick-nav-btn.current {
    background: var(--exam-primary);
    border-color: var(--exam-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 184, 77, 0.4);
}

.quick-nav-legend {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #e9ecef;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.legend-dot {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid #dee2e6;
}

.legend-dot.answered {
    background: var(--exam-success);
    border-color: var(--exam-success);
}

.legend-dot.current {
    background: var(--exam-primary);
    border-color: var(--exam-primary);
}

.legend-dot.unanswered {
    background: white;
}

/* ============================================
   MODALES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-image-content {
    position: relative;
    max-width: 95%;
    max-height: 95vh;
    margin: auto;
}

.modal-image-content img {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 10px;
}

.close-zoom-btn {
    position: absolute;
    top: -50px;
    right: 0;
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ============================================
   MODAL DE REGISTRO
   ============================================ */
.register-intro {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--exam-primary);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #999;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--exam-primary) 0%, #FF9500 100%);
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 184, 77, 0.4);
}

/* ============================================
   PANTALLA DE RESULTADOS
   ============================================ */
.results-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f7fa;
    overflow-y: auto;
    z-index: 9999;
}

.results-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.results-header {
    text-align: center;
    margin-bottom: 3rem;
}

.results-header i {
    font-size: 5rem;
    color: var(--exam-primary);
    margin-bottom: 1rem;
}

.results-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.results-header p {
    font-size: 1.3rem;
    color: #666;
}

.results-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Tarjeta de Puntuación */
.score-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.score-circle {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto 2rem;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 12;
}

.score-fill {
    fill: none;
    stroke: var(--exam-success);
    stroke-width: 12;
    stroke-dasharray: 565;
    stroke-dashoffset: 565;
    transition: stroke-dashoffset 2s ease;
    stroke-linecap: round;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    color: #2c3e50;
}

.score-max {
    font-size: 2rem;
    color: #999;
}

.score-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1rem 2rem;
    border-radius: 50px;
    display: inline-flex;
    margin: 0 auto;
}

.score-status.approved {
    background: #d4edda;
    color: #155724;
}

.score-status.failed {
    background: #f8d7da;
    color: #721c24;
}

/* Desglose por Partes */
.results-breakdown {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.results-breakdown h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breakdown-item {
    margin-bottom: 2rem;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.breakdown-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.breakdown-score {
    font-weight: 700;
    color: var(--exam-primary);
}

.breakdown-bar {
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.breakdown-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--exam-success) 0%, var(--exam-primary) 100%);
    transition: width 1.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 1rem;
    color: white;
    font-weight: 600;
}

.breakdown-details {
    font-size: 0.9rem;
    color: #666;
}

/* Botones de Acción */
.results-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.results-btn {
    flex: 1;
    min-width: 200px;
    padding: 1.25rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.review-btn {
    background: linear-gradient(135deg, var(--exam-info) 0%, #357ABD 100%);
    color: white;
}

.ranking-btn {
    background: linear-gradient(135deg, var(--exam-primary) 0%, #FF9500 100%);
    color: white;
}

.home-btn {
    background: #e9ecef;
    color: #2c3e50;
}

.results-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .exam-header-container {
        flex-direction: column;
        text-align: center;
    }

    .exam-stats {
        width: 100%;
        justify-content: center;
    }

    .question-card {
        padding: 2rem 1.5rem;
    }

    .exam-navigation {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
    }

    .quick-nav-buttons {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    }

    .results-actions {
        flex-direction: column;
    }

    .results-btn {
        width: 100%;
    }

    .score-circle {
        width: 200px;
        height: 200px;
    }

    .score-value {
        font-size: 3rem;
    }
}
