/* ===================================
   RESET Y CONFIGURACIÓN BASE
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* PALETA DE COLORES OSCURA CON ACENTOS NEÓN */
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --accent-cyan: #00d4ff;
    --accent-magenta: #ff00ff;
    --accent-orange: #ff6b00;
    --accent-green: #00ff88;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d4;
    --text-muted: #6b6b8f;
    
    /* SOMBRAS Y EFECTOS */
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 12px 48px rgba(0, 212, 255, 0.4);
    
    /* TRANSICIONES */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===================================
   ENCABEZADO PRINCIPAL
   =================================== */
.main-header {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    padding: 3rem 2rem;
    text-align: center;
    border-bottom: 2px solid var(--accent-cyan);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header-content {
    position: relative;
    z-index: 1;
}

.glow-text {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 0 10px var(--accent-cyan),
                 0 0 20px var(--accent-cyan),
                 0 0 30px rgba(0, 212, 255, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
}

/* ===================================
   CONTENEDOR PRINCIPAL
   =================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* ===================================
   CUADRÍCULA DE CRIATURAS
   =================================== */
.creatures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.6s ease-in;
}

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

/* ===================================
   TARJETAS DE CRIATURAS
   =================================== */
.creature-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 212, 255, 0.1);
    position: relative;
}

.creature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(255, 0, 255, 0.05) 100%);
    opacity: 0;
    transition: var(--transition-smooth);
    pointer-events: none;
}

/* EFECTO HOVER EN CARTA */
.creature-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent-cyan);
}

.creature-card:hover::before {
    opacity: 1;
}

/* IMAGEN DE LA CARTA */
.card-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.creature-card:hover .card-image img {
    transform: scale(1.1);
}

/* INSIGNIA DE CATEGORÍA */
.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-badge.mitologico {
    background: rgba(0, 212, 255, 0.9);
    color: var(--bg-primary);
}

.card-badge.moderno {
    background: rgba(255, 0, 255, 0.9);
    color: var(--text-primary);
}

.card-badge.creepypasta {
    background: rgba(0, 255, 136, 0.9);
    color: var(--bg-primary);
}

/* CONTENIDO DE LA CARTA */
.card-content {
    padding: 1.5rem;
}

.creature-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.creature-preview {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ESTADÍSTICAS DE LA CARTA */
.card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.stat-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ENLACE DE LA CARTA */
.card-link {
    display: inline-block;
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-smooth);
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
    border-radius: 8px;
    border: 1px solid var(--accent-cyan);
}

.card-link:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    transform: translateX(5px);
}

.card-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===================================
   PIE DE PÁGINA
   =================================== */
.main-footer {
    background: var(--bg-secondary);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    color: var(--text-muted);
}

/* ===================================
   ESTILOS PARA PÁGINAS DE CRIATURAS
   =================================== */
.creature-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    padding: 2rem;
    border-bottom: 2px solid var(--accent-cyan);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: var(--transition-smooth);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.1);
}

.back-link:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    transform: translateX(-5px);
}

.creature-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    margin: 0;
}

/* CONTENIDO DETALLADO */
.creature-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.main-image-container {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 2rem;
}

.main-creature-image {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.3);
    border: 2px solid var(--accent-cyan);
}

/* SECCIONES DE INFORMACIÓN */
.info-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.section-title {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-section p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section li {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.info-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: bold;
}

/* FICHA TÉCNICA */
.tech-sheet {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(255, 0, 255, 0.1) 100%);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--accent-cyan);
    grid-column: 1 / -1;
}

.tech-sheet .section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tech-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tech-label {
    font-weight: 700;
    color: var(--accent-cyan);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.tech-value {
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 1024px) {
    .creatures-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .glow-text {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .creatures-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .container {
        padding: 2rem 1rem;
    }
    
    .creature-title {
        font-size: 2rem;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 2rem 1rem;
    }
    
    .glow-text {
        font-size: 1.5rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .creature-name {
        font-size: 1.4rem;
    }
}

/* ============================================
   SISTEMA DE PESTAÑAS/FILTROS
   ============================================ */

.filter-tabs {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
}

.filter-title {
    text-align: center;
    font-size: 1.8rem;
    color: #00d4ff;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.tabs-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.tab-btn {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    color: #fff;
    border: 2px solid rgba(0, 212, 255, 0.3);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tab-btn:hover {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border-color: #00d4ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.tab-btn.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0084ff 100%);
    border-color: #00d4ff;
    color: #1a1a2e;
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.6);
    transform: scale(1.05);
}

.creature-card.hidden {
    display: none;
}

/* Responsivo para pestañas */
@media (max-width: 768px) {
    .filter-title {
        font-size: 1.4rem;
    }
    
    .tabs-container {
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}


/* ═══════════════════════════════════════════════════════════════
   MEJORAS IMPLEMENTADAS - NUEVOS ESTILOS
   ═══════════════════════════════════════════════════════════════ */

/* 1. BARRA DE BÚSQUEDA */
.search-container {
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    font-size: 1rem;
    background: #16213e;
    border: 2px solid #0f3460;
    border-radius: 50px;
    color: #ffffff;
    transition: all 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: #a8a8b8;
    pointer-events: none;
}

.clear-search {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a8a8b8;
    cursor: pointer;
    display: none;
    padding: 0.5rem;
    transition: all 0.3s;
}

.clear-search:hover {
    color: #e94560;
    transform: translateY(-50%) scale(1.2);
}

.result-counter {
    text-align: center;
    margin: 1rem 0;
    color: #a8a8b8;
    font-size: 0.9rem;
}

/* 5. CONTROLES DE TEMA E IDIOMA */
.theme-language-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 1rem;
    z-index: 1000;
}

.theme-toggle,
.language-toggle {
    background: #16213e;
    border: 2px solid #0f3460;
    border-radius: 50px;
    padding: 0.8rem 1.2rem;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover,
.language-toggle:hover {
    background: #0f3460;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
}

/* MODO CLARO */
[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1e;
    --text-secondary: #4a4a5a;
    --border-color: #e0e0e0;
}

[data-theme="light"] body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="light"] .main-header,
[data-theme="light"] .creature-header {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
}

[data-theme="light"] .creature-card {
    background: #ffffff;
    border-color: #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 10. SISTEMA DE FAVORITOS */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #0f3460;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.favorite-btn:hover {
    background: rgba(233, 69, 96, 0.8);
    border-color: #e94560;
    transform: scale(1.1);
}

.favorite-btn.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-color: #ffd700;
    color: #1a1a2e;
}

.favorites-counter {
    background: #e94560;
    color: #ffffff;
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 0.5rem;
    display: inline-block;
}

/* Notificaciones */
.notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #16213e;
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 10px;
    border: 2px solid #0f3460;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
    z-index: 10000;
}

.notification.show {
    bottom: 30px;
}

.notification-success {
    border-color: #4caf50;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.notification-info {
    border-color: #2196f3;
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.hidden {
    display: none !important;
}
