* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0066cc;
    --secondary-color: #00a4ef;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

/* Pantallas */
.screen {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: block;
}

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

/* Pantalla de inicio */
.start-content {
    padding: 40px;
    max-height: 85vh;
    overflow-y: auto;
}

.start-content h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
    font-size: 2.5em;
}

.start-content h2 {
    color: var(--dark-color);
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.8em;
}

.exam-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.info-card h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    color: var(--dark-color);
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.info-card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.instructions {
    background: #fff3cd;
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--warning-color);
    margin-bottom: 30px;
}

.instructions h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
}

.instructions ul {
    list-style: none;
    padding-left: 20px;
}

.instructions li {
    color: var(--dark-color);
    margin-bottom: 8px;
    position: relative;
}

.instructions li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--warning-color);
    font-weight: bold;
}

.mode-selection {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    color: white;
}

.mode-selection h3 {
    margin-bottom: 20px;
    font-size: 1.3em;
}

.mode-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Botones */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    min-width: 200px;
}

.btn-primary:hover {
    background: #0052a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #0091d1;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
    min-width: auto;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Pantalla del examen */
.exam-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    border-bottom: 3px solid var(--primary-color);
}

.header-left h2 {
    margin-bottom: 5px;
    font-size: 1.4em;
}

.header-left p {
    font-size: 0.9em;
    opacity: 0.9;
}

.header-center {
    text-align: center;
}

.timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    border-radius: var(--border-radius);
    border: 2px solid white;
}

.timer #timerDisplay {
    font-size: 1.8em;
    font-weight: bold;
    display: block;
}

.timer p {
    font-size: 0.8em;
    margin-top: 5px;
}

.timer.warning {
    background: rgba(255, 193, 7, 0.3);
    border-color: var(--warning-color);
}

.timer.danger {
    background: rgba(220, 53, 69, 0.3);
    border-color: var(--danger-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.header-right {
    display: flex;
    gap: 10px;
}

.exam-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 0;
    min-height: 600px;
}

.question-panel {
    padding: 40px;
    overflow-y: auto;
    max-height: 75vh;
}

.review-panel {
    background: #f8f9fa;
    padding: 20px;
    border-left: 2px solid var(--gray-color);
    overflow-y: auto;
    max-height: 75vh;
}

.question-number {
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.question-text {
    font-size: 1.2em;
    color: var(--dark-color);
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 500;
}

.question-type {
    display: inline-block;
    background: var(--warning-color);
    color: var(--dark-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    margin-bottom: 20px;
    font-weight: 600;
}

.options-container {
    margin-bottom: 30px;
}

.option {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.option input[type="radio"],
.option input[type="checkbox"] {
    margin-top: 2px;
    margin-right: 15px;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.option.selected {
    background: #e3f2fd;
    border-color: var(--primary-color);
}

.option-text {
    flex: 1;
    color: var(--dark-color);
    line-height: 1.5;
}

.question-actions {
    margin-bottom: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--dark-color);
}

.checkbox-label input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.navigation-buttons {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.navigation-buttons button {
    flex: 1;
}

/* Panel de revisión */
.review-panel h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
    font-size: 1.1em;
}

.review-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-item {
    padding: 10px;
    background: white;
    border-radius: 5px;
    border-left: 3px solid var(--gray-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.review-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.review-item.answered {
    border-left-color: var(--success-color);
}

.review-item.unanswered {
    border-left-color: var(--danger-color);
}

.review-item.marked {
    border-left-color: var(--warning-color);
    background: #fffbea;
}

.review-item.current {
    border-left-color: var(--primary-color);
    background: #e3f2fd;
}

.review-item-number {
    display: block;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 3px;
}

/* Pantalla de resultados */
.results-content {
    padding: 40px;
    max-height: 85vh;
    overflow-y: auto;
}

.results-content h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.score-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.final-score {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.pass-status {
    font-size: 1.5em;
    font-weight: 600;
}

.pass-status.pass {
    color: var(--success-color);
}

.pass-status.fail {
    color: var(--danger-color);
}

.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
}

.summary-card h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--dark-color);
    border-bottom: 1px solid #e9ecef;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
}

.stat-value {
    font-weight: bold;
    color: var(--primary-color);
}

.domain-result {
    padding: 10px;
    margin-bottom: 10px;
    background: white;
    border-radius: 5px;
    border-left: 3px solid var(--secondary-color);
}

.domain-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.domain-score {
    font-size: 0.9em;
    color: var(--gray-color);
}

.detailed-review {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.detailed-review h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
}

.review-question {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 4px solid var(--gray-color);
}

.review-question.correct {
    border-left-color: var(--success-color);
}

.review-question.incorrect {
    border-left-color: var(--danger-color);
}

.review-question h4 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 1em;
}

.review-answer {
    font-size: 0.9em;
    margin-bottom: 8px;
}

.review-answer strong {
    color: var(--dark-color);
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .exam-info {
        grid-template-columns: 1fr;
    }

    .exam-header {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .header-right {
        flex-direction: column;
        width: 100%;
    }

    .header-right button {
        width: 100%;
    }

    .exam-content {
        grid-template-columns: 1fr;
    }

    .review-panel {
        border-left: none;
        border-top: 2px solid var(--gray-color);
        margin-top: 20px;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }

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

    .results-actions button {
        width: 100%;
    }

    .start-content {
        padding: 20px;
    }

    .start-content h1 {
        font-size: 1.8em;
    }

    .start-content h2 {
        font-size: 1.3em;
    }

    .question-panel {
        padding: 20px;
    }
}

/* Utilidades */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
