/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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;
    line-height: 1.6;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px;
    max-width: 1000px;
    width: 100%;
    animation: fadeIn 0.6s ease-out;
    position: relative;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Dashboard */
.dashboard {
    display: block;
}

.license-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.license-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.license-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.license-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.license-card h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.license-card p {
    color: #6c757d;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Selección de modo */
.mode-selection {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-top: 20px;
}

.mode-selection h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.mode-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 160px;
    padding: 20px;
}

.mode-btn small {
    font-size: 0.8em;
    opacity: 0.8;
}

/* Temporizador */
.timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    font-weight: bold;
    color: #2c3e50;
    display: none;
    z-index: 1000;
}

.timer.show {
    display: block;
}

.timer.warning {
    background: #ffeaa7;
    color: #d63031;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Contenedor del cuestionario */
.quiz-container {
    display: none;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.progress-text {
    font-weight: 600;
    color: #495057;
    font-size: 1.1em;
}

.license-info {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

/* Barra de progreso */
.progress-bar {
    background: #e9ecef;
    border-radius: 50px;
    height: 12px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 50px;
    width: 5%;
}

/* Tarjeta de pregunta */
.question-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border-left: 5px solid #667eea;
    position: relative;
}

.question-number {
    position: absolute;
    top: -10px;
    left: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1em;
}

.question-text {
    font-size: 1.2em;
    color: #2c3e50;
    margin-bottom: 25px;
    line-height: 1.6;
    padding-top: 10px;
}

.question-image {
    text-align: center;
    margin-bottom: 20px;
}

.question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.question-image .question-image-specific {
    width: 100px ;
    height: 100px ;
}

/* Opciones */
.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.option.correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.option.incorrect {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option input[type="radio"] {
    margin: 0;
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.option label {
    cursor: pointer;
    flex: 1;
}

/* Explicación */
.explanation {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    display: none;
}

.explanation.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.explanation h4 {
    color: #495057;
    margin-bottom: 10px;
}

.explanation p {
    color: #6c757d;
    line-height: 1.5;
}

/* Navegación */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.nav-center {
    display: flex;
    justify-content: center;
}

/* Botones */
.btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

/* Resultados */
.results {
    display: none;
    text-align: center;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(
        #28a745 0deg, 
        #28a745 var(--score-angle, 0deg), 
        #e9ecef var(--score-angle, 0deg), 
        #e9ecef 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
    position: relative;
}

.score-circle::before {
    content: '';
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    position: absolute;
}

.score-text {
    position: relative;
    z-index: 1;
    font-size: 2em;
    font-weight: bold;
    color: #2c3e50;
}

.results h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.summary-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.summary-card h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.summary-card p {
    font-size: 1.5em;
    font-weight: bold;
    color: #2c3e50;
}

.results-status {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
}

.results-status.passed {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
}

.results-status.failed {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

.results-status h3 {
    margin-bottom: 10px;
}

.results-status.passed h3 {
    color: #28a745;
}

.results-status.failed h3 {
    color: #dc3545;
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalIn 0.3s ease-out;
}

.modal-small {
    max-width: 400px;
    max-height: none;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2c3e50;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 30px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Revisión de respuestas */
.review-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #dee2e6;
}

.review-item.correct {
    border-left-color: #28a745;
}

.review-item.incorrect {
    border-left-color: #dc3545;
}

.review-question {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.review-options {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-options p {
    padding: 8px 15px;
    margin: 0;
    border-radius: 5px;
    border: 1px solid transparent;
}

.review-options p.correct {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-color: rgba(40, 167, 69, 0.2);
}

.review-options p.incorrect {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-color: rgba(220, 53, 69, 0.2);
}

.review-explanation {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 5px;
    font-size: 0.9em;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    .header h1 {
        font-size: 2em;
    }

    .license-grid {
        grid-template-columns: 1fr;
    }

    .mode-buttons {
        flex-direction: column;
        align-items: center;
    }

    .navigation {
        flex-direction: column;
        gap: 15px;
    }

    .quiz-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .timer {
        position: static;
        margin-bottom: 20px;
        text-align: center;
    }

    .modal-content {
        max-width: 95%;
        max-height: 90%;
        margin: 20px;
    }

    .modal-body {
        padding: 20px;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .question-card {
        padding: 20px;
    }

    .option {
        padding: 12px 15px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}
