@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap");

:root {
    --primary-color: #a876aa;
    --gradient-start: #cbd5ff;
    --gradient-end: #902680;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #333;
    --text-light: #666;
    --success-color: #4CAF50;
    --warning-color: #ff9800;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Montserrat", sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    background-attachment: fixed;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* Pantallas */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Botón volver */
.back-btn {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.back-btn:hover {
    opacity: 1;
}

/* Títulos */
h1 {
    color: white;
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    color: rgba(255,255,255,0.9);
    text-align: center;
    font-size: 14px;
    margin-bottom: 30px;
}

/* Grid de temas */
.temas-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.tema-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--card-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tema-checkbox:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.tema-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    margin-right: 12px;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.tema-checkbox input:checked ~ .checkmark {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--gradient-end) 100%);
    border-color: transparent;
}

.tema-checkbox input:checked ~ .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.tema-info {
    flex: 1;
}

.tema-nombre {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    display: block;
}

.tema-count {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

/* Info de selección */
.selection-info {
    text-align: center;
    color: white;
    font-size: 13px;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

/* Botones */
.btn-primary {
    width: 100%;
    padding: 18px 30px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.3);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(144, 38, 128, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    flex: 1;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.buttons-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.buttons-row .btn-primary {
    flex: 1.5;
}

/* Tarjetas de preguntas */
.pregunta-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pregunta-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.pregunta-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--gradient-end) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.pregunta-tema {
    font-size: 11px;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--gradient-end) 100%);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    letter-spacing: 0.5px;
}

.pregunta-texto {
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 15px;
    padding-left: 51px;
}

.respuesta-container {
    padding-left: 51px;
}

.btn-ver-respuesta {
    background: none;
    border: 2px dashed var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-ver-respuesta:hover {
    background: rgba(168, 118, 170, 0.1);
}

.respuesta-texto {
    display: none;
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    padding: 15px;
    background: rgba(168, 118, 170, 0.08);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.respuesta-texto.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 380px) {
    .tema-nombre {
        font-size: 12px;
    }
    
    .tema-count {
        font-size: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .pregunta-texto {
        font-size: 14px;
        padding-left: 0;
    }
    
    .pregunta-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .respuesta-container {
        padding-left: 0;
    }
}

/* Estilos para impresión */
@media print {
    body {
        background: white;
        padding: 10px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .back-btn, .buttons-row, .btn-ver-respuesta {
        display: none !important;
    }
    
    h1 {
        color: #333;
        text-shadow: none;
        font-size: 20px;
    }
    
    .subtitle {
        color: #666;
    }
    
    .pregunta-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .pregunta-number {
        background: #902680;
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .pregunta-tema {
        background: #902680;
        font-size: 9px;
    }
    
    .pregunta-texto {
        font-size: 12px;
    }
    
    .respuesta-texto {
        display: block !important;
        font-size: 11px;
        background: #f5f5f5;
        margin-top: 10px;
    }
}