/* ===== RESET BÁSICO ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.quiz-container {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
    text-align: center;
    transition: transform 0.3s ease;
}

.quiz-container:hover {
    transform: translateY(-5px);
}

/* ===== TIPOGRAFÍA ===== */
h1 {
    font-size: 1.8rem;
    color: #1a237e;
    margin-bottom: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.4rem;
    color: #1565c0;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.2rem;
    color: #3949ab;
    margin: 1rem 0;
    font-weight: 600;
}

/* ===== PANTALLA DE INICIO ===== */
#start-screen {
    text-align: left;
}

#start-screen label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #424242;
}

#student-name {
    width: 100%;
    padding: 0.9rem 1rem;
    margin-bottom: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

#student-name:focus {
    outline: none;
    border-color: #3f51b5;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.1);
}

#start-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

#start-button:hover {
    background: linear-gradient(135deg, #43a047, #388e3c);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4);
}

#start-button:active {
    transform: translateY(0);
}

/* ===== BARRA DE ESTADO ===== */
#status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    padding: 0.8rem 1rem;
    background-color: #f5f7fa;
    border-radius: 12px;
    color: #546e7a;
    font-weight: 500;
    flex-wrap: wrap;
    gap: 10px;
}

#timer-display {
    color: #d32f2f;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* ===== PREGUNTA ===== */
#question-area {
    margin-bottom: 1.5rem;
}

#question-text {
    font-size: 1.2rem;
    color: #263238;
    text-align: left;
    line-height: 1.5;
    padding: 1rem;
    background-color: #f8fafc;
    border-left: 4px solid #3f51b5;
    border-radius: 8px;
}

/* ===== OPCIONES ===== */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 500px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.option-btn {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 2px solid #bbdefb;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.option-btn:hover:not([disabled])::before {
    transform: translateX(100%);
}

.option-btn:hover:not([disabled]) {
    background-color: #bbdefb;
    border-color: #2196f3;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.2);
}

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

/* ===== FEEDBACK ===== */
#feedback-area {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    min-height: 50px;
    text-align: left;
    font-weight: 500;
    transition: all 0.3s ease;
}

.feedback-success {
    background-color: #e8f5e9;
    border-left: 5px solid #4caf50;
    color: #1b5e20;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.feedback-error {
    background-color: #ffebee;
    border-left: 5px solid #f44336;
    color: #b71c1c;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.1);
}

/* ===== ESTADOS DE BOTONES ===== */
.correct {
    background: linear-gradient(135deg, #66bb6a, #4caf50) !important;
    color: white !important;
    border-color: #43a047 !important;
    animation: pulse 0.6s ease;
}

.incorrect {
    background: linear-gradient(135deg, #ef5350, #f44336) !important;
    color: white !important;
    border-color: #e53935 !important;
}

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

/* ===== RESULTADOS ===== */
#results-area {
    text-align: center;
}

#results-area p {
    margin: 0.8rem 0;
    font-size: 1.1rem;
}

#results-area button {
    margin-top: 1.5rem;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, #3f51b5, #303f9f);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
}

#results-area button:hover {
    background: linear-gradient(135deg, #303f9f, #283593);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(63, 81, 181, 0.4);
}

/* ===== REINTENTO ===== */
#retry-section {
    margin: 1.5rem 0;
    padding: 1.2rem;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 2px solid #ffb74d;
    border-radius: 12px;
    font-size: 1.05rem;
    color: #e65100;
}

#retry-button {
    background: linear-gradient(135deg, #ff9800, #f57c00) !important;
    margin-top: 0.8rem !important;
    width: 100%;
    padding: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

#retry-button:hover {
    background: linear-gradient(135deg, #f57c00, #ef6c00) !important;
    transform: translateY(-2px);
}

/* ===== RANKING ===== */
#ranking-area {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px dashed #bbdefb;
}

#ranking-area h3 {
    text-align: center;
    color: #1a237e;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

#score-ranking {
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 10px;
    background-color: #f8fafc;
    padding: 0.5rem;
}

#score-ranking li {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    transition: background 0.2s;
}

#score-ranking li:hover {
    background-color: #e3f2fd;
    border-radius: 8px;
}

#score-ranking li strong {
    color: #1565c0;
    font-weight: 600;
}

#score-ranking li span {
    background-color: #3f51b5;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .quiz-container {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    h1 { font-size: 1.5rem; }
    #question-text { font-size: 1.1rem; }
    .option-btn { font-size: 0.95rem; padding: 0.9rem; }
    #status-bar { font-size: 0.95rem; flex-direction: column; gap: 8px; }
}

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