/* =========================================
   AnimeEXT — Ups overlay
   ========================================= */

.error-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 16, 0.88);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
    animation: errorFadeIn 0.3s ease-out;
}

.error-overlay.hidden {
    display: none !important;
}

@keyframes errorFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.error-container {
    position: relative;
    background: var(--bg-1, #161b22);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl, 20px);
    width: 100%;
    max-width: 480px;
    padding: 32px 24px 28px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.error-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted, #8b949e);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.error-close-btn:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.08);
}

.error-image-wrapper {
    margin: 0 auto 18px;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.error-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary, #ffffff);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.error-message {
    font-size: 0.92rem;
    color: var(--text-secondary, #c9d1d9);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Acordeón de detalles */
.error-details-wrapper {
    margin-bottom: 24px;
    text-align: left;
}

.error-details-toggle {
    background: transparent;
    border: none;
    color: var(--accent, #00d9c0);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    margin-left: 85px;
    transition: opacity 0.2s;
}

.error-details-toggle:hover {
    opacity: 0.85;
}

.error-details-content {
    background: var(--bg-0, #0d1117);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md, 8px);
    padding: 12px;
    max-height: 140px;
    overflow-y: auto;
}

.error-details-content.hidden {
    display: none !important;
}

.error-details-content pre {
    margin: 0;
    font-family: monospace;
    font-size: 0.78rem;
    color: #ff7b72;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Acciones */
.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-error-primary {
    background: var(--accent, #00d9c0);
    color: #000;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 10px 20px;
    border-radius: var(--radius-md, 8px);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-error-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 192, 0.3);
    color: #000;
}

.btn-error-secondary {
    background: var(--bg-2, #21262d);
    color: var(--text-primary, #ffffff);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 20px;
    border-radius: var(--radius-md, 8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s;
}

.btn-error-secondary:hover {
    background: var(--bg-3, #30363d);
    color: #fff;
}

/* Adaptación a Tema Claro */
body.light-theme .error-overlay {
    background: rgba(245, 245, 245, 0.88);
}

body.light-theme .error-container {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

body.light-theme .error-title {
    color: #111111;
}

body.light-theme .error-message {
    color: #555555;
}

body.light-theme .error-details-content {
    background: #f6f8fa;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .btn-error-secondary {
    background: #f0f3f6;
    color: #333;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .btn-error-secondary:hover {
    background: #e4e8ec;
}