/* 
   Colores Requeridos:
   🟢 Verde menta (#2ECC71) → acciones o respuestas correctas
   🔵 Azul claro (#3498DB) → encabezados
   ⚪ Gris claro (#F5F7FA) → fondo
   ⚫ Gris oscuro (#2C3E50) → texto
*/

:root {
    --color-success: #2ECC71;
    --color-header: #3498DB;
    --color-bg: #F5F7FA;
    --color-text: #2C3E50;
    
    --color-white: #FFFFFF;
    --color-primary-dark: #2980B9;
    --color-warning: #F1C40F;
    --color-danger: #E74C3C;
    --color-shadow: rgba(44, 62, 80, 0.1);
    
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}

.slide-up-anim { animation: slideUp 0.5s ease forwards; }
.fade-in-anim { animation: fadeIn 0.4s ease forwards; }
.pulse-anim { animation: pulse 2s infinite; }

/* LAYOUT */
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    flex-grow: 1;
}

/* HEADER */
.main-header {
    background-color: var(--color-header);
    color: var(--color-white);
    padding: 20px 30px;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 20px var(--color-shadow);
}

.main-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* CARDS E INTERFACES */
.card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: 0 8px 16px var(--color-shadow);
    margin-bottom: 20px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 12px 24px var(--color-shadow);
    transform: translateY(-2px);
}

.login-card {
    max-width: 400px;
    margin: 60px auto;
    text-align: center;
}

.login-card h2 {
    color: var(--color-header);
    margin-bottom: 10px;
}

.login-card p {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.margin-top {
    margin-top: 20px;
}

.dashboard-header h2 {
    color: var(--color-header);
    margin-bottom: 20px;
    border-bottom: 3px solid var(--color-header);
    display: inline-block;
    padding-bottom: 5px;
}

/* FORMS Y BOTONES */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text);
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--color-header);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form input, .inline-form select {
    flex: 1;
    min-width: 150px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary { background: var(--color-header); color: var(--color-white); }
.btn-success { background: var(--color-success); color: var(--color-white); }
.btn-warning { background: var(--color-warning); color: var(--color-text); }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-level {
    background: var(--color-white);
    border: 2px solid #e0e6ed;
    color: var(--color-text);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn-level:hover {
    border-color: var(--color-header);
    box-shadow: 0 8px 16px rgba(52, 152, 219, 0.15);
}

.btn-level .emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.level-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

/* TABLAS */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e6ed;
}

th {
    background-color: #eef2f5;
    color: var(--color-header);
    font-weight: 600;
}

tbody tr:hover {
    background-color: #f8fafc;
}

/* MODALES */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(44, 62, 80, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
}

.modal-content h3 { color: var(--color-header); margin-bottom: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* FEEDBACK Y ALERTAS */
.error-msg {
    color: var(--color-danger);
    background: #fadbd8;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 600;
}

.feedback-alerts .alert {
    background: #fff3cd;
    border-left: 5px solid var(--color-warning);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px 8px 8px 4px;
    box-shadow: 0 4px 6px var(--color-shadow);
}

/* JUEGO / ACTIVIDADES */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.game-stats {
    display: flex;
    gap: 15px;
}

.stat-badge {
    background: var(--color-white);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    color: var(--color-header);
    box-shadow: 0 2px 5px var(--color-shadow);
    border: 2px solid var(--color-bg);
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 25px 0 15px;
    text-align: center;
}

.data-table-wrapper {
    background: #eef2f5;
    padding: 2px;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 600px;
    border: 1px solid #dcdcdc;
}

.data-table th, .data-table td {
    text-align: center;
    padding: 8px;
    font-size: 0.95rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.option-btn {
    background: var(--color-bg);
    border: 2px solid #e0e6ed;
    color: var(--color-text);
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.option-btn:hover {
    background: var(--color-white);
    border-color: var(--color-header);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.1);
}

.option-btn.correct { background: var(--color-success); color: white; border-color: var(--color-success); }
.option-btn.incorrect { background: var(--color-danger); color: white; border-color: var(--color-danger); opacity: 0.7;}

.game-actions {
    text-align: center;
    margin-top: 20px;
    border-top: 1px dashed #ccc;
    padding-top: 20px;
}

.hint-text {
    margin-top: 15px;
    padding: 15px;
    background: #eef2f5;
    border-left: 4px solid var(--color-warning);
    border-radius: 4px;
    font-style: italic;
    color: #555;
    animation: fadeIn 0.3s;
}

.game-feedback {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: bold;
    font-size: 1.2rem;
    animation: fadeIn 0.3s;
}

.game-feedback.success { background: rgba(46, 204, 113, 0.2); color: #27ae60; }
.game-feedback.error { background: rgba(231, 76, 60, 0.2); color: #c0392b; }

.final-score {
    font-size: 4rem;
    color: var(--color-header);
    margin: 20px 0;
    text-shadow: 2px 2px 0px rgba(52, 152, 219, 0.2);
}

/* Utilidades de texto */
.text-center { text-align: center; }
