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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c2b5e 0%, #1a4a8a 25%, #2b6cb0 50%, #1a4a8a 75%, #0c2b5e 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
    z-index: 0;
}

/* Contenedor principal */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Contenedores de autenticación */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-box {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.2);
    max-width: 450px;
    width: 100%;
    animation: slideInUp 0.6s ease-out;
}

.auth-box h1 {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2em;
    margin-bottom: 10px;
}

/* Formularios */
.auth-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43,108,176,0.1);
}

/* Botones */
.btn-primary {
    background: linear-gradient(135deg, #2b6cb0, #1a4a8a);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(43,108,176,0.3);
}

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

/* Mensajes de error y éxito */
.error-message {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #c00;
}

.success-message {
    background: #efe;
    color: #2ecc71;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #2ecc71;
}

/* Dashboard */
.dashboard-container {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.dashboard-nav {
    background: linear-gradient(135deg, #1a4a8a, #2b6cb0);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.nav-brand {
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

.dashboard-content {
    padding: 30px;
}

/* Tarjetas de estadísticas */
.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #2b6cb0;
    margin: 10px 0;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

/* Grid de temas */
.topics-section {
    margin-bottom: 40px;
}

.topics-section h2 {
    margin-bottom: 20px;
    color: #1a4a8a;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.topic-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.topic-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.topic-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.topic-card h3 {
    color: #1a4a8a;
    margin-bottom: 10px;
}

.topic-card p {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.btn-play {
    background: linear-gradient(135deg, #2b6cb0, #1a4a8a);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    width: 100%;
    font-size: 1em;
    transition: all 0.3s;
}

.btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(43,108,176,0.4);
}

/* Tabla de estadísticas */
.stats-section {
    margin-top: 40px;
}

.stats-section h2 {
    margin-bottom: 20px;
    color: #1a4a8a;
}

.stats-table-container {
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.stats-table th {
    background: linear-gradient(135deg, #1a4a8a, #2b6cb0);
    color: white;
    font-weight: 600;
}

.stats-table tr:hover {
    background: #f5f5f5;
}

.stats-table .correct {
    color: #27ae60;
    font-weight: bold;
}

.stats-table .incorrect {
    color: #e74c3c;
    font-weight: bold;
}

/* Animaciones */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .dashboard-nav {
        flex-direction: column;
        text-align: center;
    }
    
    .user-stats {
        grid-template-columns: 1fr;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
    
    .hero-title {
        font-size: 2em;
    }
}

/* Enlaces */
a {
    color: #2b6cb0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}