/* ========================================
   🎨 ESTILOS PRINCIPALES - SELECTOR DE TEMAS
   ======================================== */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    --warning-gradient: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    --danger-gradient: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    
    --background-color: #0a0a1a;
    --surface-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: rgba(255, 255, 255, 0.2);
    
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 15px 35px rgba(0, 0, 0, 0.3);
    
    --border-radius: 15px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 50, 200, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(50, 150, 200, 0.3) 0%, transparent 50%),
        var(--background-color);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   🏠 HEADER PRINCIPAL
   ======================================== */

.main-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
}

.main-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ========================================
   📊 ESTADÍSTICAS
   ======================================== */

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: rgba(102, 126, 234, 0.5);
}

.stat-number {
    display: block;
    font-size: 2.5em;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* ========================================
   🔍 BÚSQUEDA Y FILTROS
   ======================================== */

.search-container {
    margin-bottom: 20px !important;
}

.search-input {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.1em;
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: var(--transition);
    margin-bottom: 20px;
}

.search-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 10px;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-light);
    transform: translateY(-2px);
    padding: 10px 10px;
}

/* ========================================
   🎯 GRID DE TEMAS
   ======================================== */

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.theme-card {
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-light);
}

.theme-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(255, 255, 255, 0.3);
}

.theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--card-gradient, var(--primary-gradient));
}

.theme-header {
    padding: 25px;
    text-align: center;
    position: relative;
}

.theme-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.theme-title {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.theme-description {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 20px;
}

.theme-stats {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 25px;
    font-size: 0.9em;
}

.theme-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.theme-stat-number {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--text-primary);
}

.theme-stat-label {
    color: var(--text-secondary);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--card-gradient, var(--primary-gradient));
    transition: var(--transition);
    width: var(--progress, 0%);
}

.difficulty-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-basico {
    background: var(--success-gradient);
    color: white;
}

.difficulty-intermedio {
    background: var(--warning-gradient);
    color: white;
}

.difficulty-avanzado {
    background: var(--danger-gradient);
    color: white;
}

/* Estados especiales de las cards */
.theme-card.completed .theme-header::after {
    content: '✅';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.5em;
}

.theme-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.theme-card.locked:hover {
    transform: none;
    box-shadow: var(--shadow-light);
}

/* ========================================
   🦶 FOOTER
   ======================================== */

.main-footer {
    margin-top: auto;
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
}

.main-footer p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid transparent;
}

.footer-links a:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   📱 MODAL
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--surface-color);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    margin: 3% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-heavy);
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.5em;
}

.close {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
    border-radius: 50%;
}

.close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 25px;
    line-height: 1.6;
}

.modal-body h3 {
    color: var(--text-primary);
    margin: 20px 0 10px 0;
    font-size: 1.2em;
}

.modal-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ========================================
   🎬 ANIMACIONES
   ======================================== */

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

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-up {
    animation: slideIn 0.6s ease-out;
}

/* ========================================
   📱 RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-header {
        padding: 30px 15px;
        margin-bottom: 30px;
    }
    
    .themes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .theme-card {
        margin: 0 5px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .filter-buttons {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 10px 10px;
        font-size: 0.9em;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        max-height: 80vh;
    }
    
    .modal-body,
    .modal-header {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .themes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .theme-header {
        padding: 20px 15px;
    }
    
    .theme-stats {
        padding: 12px 15px;
        font-size: 0.85em;
    }
}