/* PUREZA TÉCNICA: Variables Claro/Default */
html, [data-theme=light] {
    --al-bg-surface: #ffffff;
    --al-bg-input: #f7fafc;
    --al-bg-placeholder: #edf2f7;
    --al-border-color: #e2e8f0;
    --al-border-hover: #cbd5e0;
    --al-text-primary: #2d3748;
    --al-text-secondary: #516170;
    --al-text-muted: #718096;
    --al-text-disabled: #a0aec0;
    --al-accent: #f56565;
    --al-accent-hover: #e53e3e;
    --al-score: #ecc94b;
    --al-shadow-base: rgba(0, 0, 0, 0.1);
    --al-shadow-hover: rgba(0, 0, 0, 0.15);
    --al-shadow-glow: rgba(245, 101, 101, 0.3);
    --al-badge-bg: rgba(26, 32, 44, 0.9);
}

/* PUREZA TÉCNICA: Variables Auto (SO Oscuro - Anulable por data-theme=light gracias a especificidad) */
@media (prefers-color-scheme: dark) {
    html {
        --al-bg-surface: #1a202c;
        --al-bg-input: #2d3748;
        --al-bg-placeholder: #2d3748;
        --al-border-color: #4a5568;
        --al-border-hover: #718096;
        --al-text-primary: #f7fafc;
        --al-text-secondary: #e2e8f0;
        --al-text-muted: #a0aec0;
        --al-text-disabled: #718096;
        --al-accent: #fc8181;
        --al-accent-hover: #f56565;
        --al-shadow-base: rgba(0, 0, 0, 0.5);
        --al-shadow-hover: rgba(0, 0, 0, 0.7);
        --al-shadow-glow: rgba(252, 129, 129, 0.2);
        --al-badge-bg: rgba(17, 22, 29, 0.95);
    }
}

/* PUREZA TÉCNICA: Variables Oscuro Forzado (Override manual del usuario) */
[data-theme=dark] {
    --al-bg-surface: #1a202c;
    --al-bg-input: #2d3748;
    --al-bg-placeholder: #2d3748;
    --al-border-color: #4a5568;
    --al-border-hover: #718096;
    --al-text-primary: #f7fafc;
    --al-text-secondary: #e2e8f0;
    --al-text-muted: #a0aec0;
    --al-text-disabled: #718096;
    --al-accent: #fc8181;
    --al-accent-hover: #f56565;
    --al-shadow-base: rgba(0, 0, 0, 0.5);
    --al-shadow-hover: rgba(0, 0, 0, 0.7);
    --al-shadow-glow: rgba(252, 129, 129, 0.2);
    --al-badge-bg: rgba(17, 22, 29, 0.95);
}

/* ==========================================================
   ESTRUCTURA DASHBOARD (SEASONAL)
========================================================== */
.seasonal-container { max-width: 1440px; margin: 25px auto; padding: 0 20px; }

/* FILTROS */
.filter-wrapper { background: var(--al-bg-surface); padding: 25px; border-radius: 12px; margin-bottom: 40px; border: 1px solid var(--al-border-color); }
.filter-wrapper form { display: flex; gap: 20px; flex-wrap: wrap; }
.filter-box { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 160px; }
.filter-box label { font-size: 11px; font-weight: 800; color: var(--al-text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.filter-box select, .filter-box input { 
    background: var(--al-bg-input); border: 1px solid var(--al-border-color); padding: 12px; border-radius: 8px; 
    font-size: 14px; color: var(--al-text-primary); cursor: pointer; transition: 0.2s; 
}
.filter-box select:hover, .filter-box input:hover { border-color: var(--al-border-hover); background: var(--al-bg-surface); }

.action-box { flex: 0 0 auto; min-width: auto; }
.btn-clear {
    background: var(--al-accent);
    color: #fff; /* PUREZA: Texto de botones de acción primarios se mantiene blanco */
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-clear:hover { background: var(--al-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px var(--al-shadow-glow); }
.btn-clear i { font-size: 14px; }

.seasonal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 30px; align-items: start; }

/* IMAGENES CON TAMAÑO FIJO */
.card-image-wrap { 
    position: relative; 
    width: 100%; 
    padding-top: 145%; 
    border-radius: 10px; 
    overflow: hidden; 
    box-shadow: 0 10px 20px var(--al-shadow-hover);
    background: var(--al-bg-placeholder);
}
.card-img-fix { 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    object-fit: cover; 
}
.card-badge { 
    position: absolute; bottom: 10px; right: 10px; 
    background: var(--al-badge-bg); color: var(--al-score); 
    padding: 4px 10px; border-radius: 6px; font-weight: 800; font-size: 12px; 
}

/* TEXTOS Y TITULOS */
.card-body-content { padding: 12px 2px; }
.card-title-fix { 
    font-size: 14px; font-weight: 700; color: var(--al-text-primary); margin: 0 0 6px;
    line-height: 1.4; height: 40px; 
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; 
}
.card-title-fix a { color: inherit; text-decoration: none; transition: color 0.2s; }
.card-title-fix a:hover { color: var(--al-accent); }

.card-meta-footer { display: flex; justify-content: space-between; font-size: 12px; color: var(--al-text-muted); font-weight: 600; }
.card-popularity-value { color: var(--al-accent); }

.no-results-panel { grid-column: 1 / -1; text-align: center; padding: 80px; color: var(--al-text-disabled); }
.no-results-panel i { font-size: 50px; margin-bottom: 15px; display: block; }

/* ==========================================================
   WIDGETS INDEPENDIENTES (INDEX / PORTAL)
========================================================== */
.anilist-widget-section { padding: 15px; background: transparent; margin-bottom: 25px; }
.widget-header { border-bottom: 2px solid var(--al-accent); margin-bottom: 15px; padding-bottom: 5px; }
.widget-header h3 { font-size: 15px; color: var(--al-text-secondary); margin: 0; text-transform: uppercase; font-weight: 800; }
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 15px; }

.mini-cover { position: relative; padding-top: 145%; border-radius: 6px; overflow: hidden; box-shadow: 0 4px 8px var(--al-shadow-base); background: var(--al-bg-placeholder); transition: box-shadow 0.3s ease; }
.mini-cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-badge { position: absolute; bottom: 5px; right: 5px; background: var(--al-badge-bg); color: var(--al-score); font-size: 11px; padding: 3px 6px; border-radius: 4px; font-weight: 800; }
.mini-card h4 { font-size: 12px; margin-top: 8px; height: 34px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; color: var(--al-text-secondary); font-weight: 600; }
.mini-card h4 a { color: inherit; text-decoration: none; transition: color 0.2s; }
.mini-card h4 a:hover { color: var(--al-accent); }

.anilist-sync-panel { background: var(--al-bg-surface, #fff); border: 1px solid var(--al-border-color, #e2e8f0); border-radius: 8px; margin-bottom: 20px; overflow: hidden; }


/* ESTRUCTURA SIMULCAST */
.wiki-header { text-align: center; margin-bottom: 25px; }
.live-clock { font-family: monospace; font-size: 1.2em; font-weight: 800; color: var(--al-accent); }

.simulcast-container { display: flex; flex-direction: column; gap: 40px; max-width: 1400px; margin: 0 auto; }
.simulcast-day { background: var(--al-bg-surface); padding: 20px; border-radius: 12px; border: 1px solid var(--al-border-color); }
.simulcast-day.is-today { border-color: var(--al-accent); box-shadow: 0 0 15px var(--al-shadow-glow); }

.day-header { margin-top: 0; margin-bottom: 20px; font-size: 1.3em; font-weight: 800; color: var(--al-text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.simulcast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 25px; }

/* CARTAS ESTILO ANILIST */
.anime-card { background: transparent; position: relative; display: flex; flex-direction: column; }

.cover-wrapper { 
    position: relative; display: block; width: 100%; padding-top: 145%; border-radius: 10px; overflow: hidden; 
    box-shadow: 0 10px 20px var(--al-shadow-base); background: var(--al-bg-placeholder); transition: box-shadow 0.3s ease;
}

.cover-wrapper img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

.score-badge { 
    position: absolute; top: 10px; left: 10px; background: var(--al-badge-bg); color: var(--al-score); 
    padding: 4px 10px; border-radius: 6px; font-weight: 800; font-size: 12px; z-index: 2;
}

.airing-countdown { 
    position: absolute; bottom: 0; left: 0; right: 0; background: var(--al-badge-bg); color: #FFF; 
    text-align: center; padding: 8px; font-size: 12px; font-weight: 800; z-index: 2; backdrop-filter: blur(4px);
}

.anime-info { padding: 12px 2px; text-align: left; }
.anime-title { 
    font-size: 14px; font-weight: 700; color: var(--al-text-primary); text-decoration: none; 
    line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 40px; transition: color 0.2s;
}
.anime-title:hover { color: var(--al-accent); }
.no-link { color: var(--al-text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; margin-top: 4px; display: block; }

.loader { text-align: center; padding: 100px; font-size: 1.2em; color: var(--al-text-muted); font-weight: 700; }
