:root {
    --primary: #6C63FF;
    --secondary: #FF6B6B;
    --success: #4ECDC4;
    --warning: #FFE66D;
    --danger: #FF6B6B;
    --info: #4D96FF;
    --purple: #A66CFF;
    --pink: #FF9FF3;
    --orange: #FECA57;
    --green: #1DD1A1;
    --blue: #54A0FF;
    --yellow: #FECA57;
    --red: #FF6B6B;
    --dark: #2D3436;
    --light: #F8F9FA;
}

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

body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    background-attachment: fixed;
}

.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.header-main {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

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

.header-main h1 {
    font-size: 3.5rem;
    color: white;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.header-main h1 i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header-main p {
    font-size: 1.4rem;
    color: rgba(255,255,255,0.9);
}

.card-curso {
    background: white;
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.card-curso::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card-curso:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.card-curso .icono-curso {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 15px;
    color: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.card-curso h3 {
    color: var(--dark);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.card-curso p {
    color: #636e72;
    font-size: 1rem;
}

.card-curso .badge-cantidad {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--success);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

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

.card-materia {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

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

.card-materia .icono-materia {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: white;
}

.card-materia h4 {
    color: var(--dark);
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.card-materia p {
    color: #636e72;
    font-size: 0.9rem;
}

.nav-breadcrumb {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-breadcrumb a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.nav-breadcrumb a:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.nav-breadcrumb span {
    color: rgba(255,255,255,0.7);
    padding: 10px;
}

.ficha-container {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
}

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

.ficha-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 3px dashed #dfe6e9;
}

.ficha-header h1 {
    color: var(--dark);
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.ficha-header .meta-info {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.intro-game {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
    display: flex;
    align-items: center;
    gap: 25px;
    animation: slideInLeft 0.6s ease;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.intro-game .icono-grande {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.intro-game h2 {
    color: white;
    margin-bottom: 8px;
    font-size: 1.6rem;
}

.intro-game p {
    opacity: 0.95;
    font-size: 1.1rem;
    line-height: 1.6;
}

.instruccion-game {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    border-left: 5px solid #f39c12;
    padding: 20px 25px;
    border-radius: 0 15px 15px 0;
    margin-bottom: 30px;
    color: #856404;
}

.instruccion-game strong {
    font-size: 1.2rem;
}

.ejercicio-card {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 3px solid transparent;
    transition: all 0.3s;
    animation: fadeInUp 0.5s ease;
}

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

.ejercicio-card:hover {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.ejercicio-card.correcto {
    border-color: var(--success);
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.ejercicio-card.incorrecto {
    border-color: var(--danger);
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
}

.ejercicio-titulo {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ejercicio-titulo .numero-ejercicio {
    width: 35px;
    height: 35px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
}

.ejercicio-texto {
    font-size: 1.15rem;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.7;
}

.respuesta-input {
    border: 3px solid #dfe6e9;
    border-radius: 15px;
    padding: 15px 20px;
    font-size: 1.2rem;
    width: 100%;
    transition: all 0.3s;
    background: white;
}

.respuesta-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.respuesta-input.correcto {
    border-color: var(--success);
    background: #d4edda;
}

.respuesta-input.incorrecto {
    border-color: var(--danger);
    background: #f8d7da;
}

.btn-corregir {
    background: linear-gradient(135deg, var(--success), #2ecc71);
    color: white;
    border: none;
    padding: 18px 50px;
    border-radius: 30px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 25px rgba(78, 205, 196, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-corregir:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(78, 205, 196, 0.5);
}

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

.btn-siguiente {
    background: linear-gradient(135deg, var(--primary), #5a52d5);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-siguiente:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 99, 255, 0.4);
}

.resultado-box {
    text-align: center;
    padding: 30px;
    border-radius: 20px;
    margin: 20px 0;
    animation: zoomIn 0.5s ease;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.resultado-box.excelente {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 3px solid var(--success);
}

.resultado-box.bueno {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 3px solid var(--warning);
}

.resultado-box.regular {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 3px solid var(--danger);
}

.resultado-box .puntuacion {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.resultado-box .mensaje {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.resultado-box .detalles {
    font-size: 1.1rem;
    color: #636e72;
}

.btn-volver {
    background: linear-gradient(135deg, #636e72, #4a5568);
    color: white;
    padding: 15px 35px;
    border-radius: 25px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-volver:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    color: white;
}

.btn-imprimir {
    background: linear-gradient(135deg, var(--info), #3d8bff);
    color: white;
    padding: 15px 35px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-imprimir:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(77, 150, 255, 0.4);
    color: white;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.empty-state h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.stats-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.stats-number {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-label {
    color: #636e72;
    font-size: 1.1rem;
    margin-top: 5px;
}

.progreso-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.progreso-item .fecha {
    background: var(--primary);
    color: white;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: bold;
}

.progreso-item .info {
    flex: 1;
}

.progreso-item .porcentaje {
    font-size: 1.5rem;
    font-weight: bold;
}

.porcentaje-alto { color: var(--success); }
.porcentaje-medio { color: var(--warning); }
.porcentaje-bajo { color: var(--danger); }

@media (max-width: 768px) {
    .header-main h1 { font-size: 2.5rem; }
    .card-curso { padding: 20px; }
    .ficha-container { padding: 25px; }
    .intro-game { flex-direction: column; text-align: center; }
}

@media print {
    body { background: white !important; }
    .btn, .nav-breadcrumb, .bg-pattern { display: none !important; }
    .ficha-container { box-shadow: none; padding: 10px; }
}
