/* ========================================
   css/error-pages.css - Styles pour les pages d'erreur
======================================== */

/* Container principal pour les erreurs */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--navbar-height) - 200px);
    text-align: center;
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
}

/* Fond animé pour les pages d'erreur */
.error-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 212, 255, 0.05) 0%,
        transparent 50%
    );
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

/* Code d'erreur */
.error-code {
    font-size: clamp(6rem, 15vw, 10rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1;
    position: relative;
    z-index: 2;
    animation: glitch 2s ease-in-out infinite;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

/* Titre d'erreur */
.error-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: var(--space-4) 0;
    color: var(--text-primary);
    position: relative;
    z-index: 2;
}

/* Description d'erreur */
.error-description {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin: 0 0 var(--space-8);
    max-width: 600px;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* Actions d'erreur */
.error-actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* Détails techniques (pour débug) */
.error-details {
    margin-top: var(--space-8);
    max-width: 800px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.error-details summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    padding: var(--space-2);
    transition: color 0.3s ease;
}

.error-details summary:hover {
    color: var(--text-secondary);
}

.error-details-content {
    margin-top: var(--space-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: left;
}

.error-stack {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-tertiary);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-top: var(--space-3);
}

/* Erreurs spécifiques */

/* 404 */
.error-404 .error-graphic {
    margin: var(--space-8) 0;
    position: relative;
    z-index: 2;
}

.error-404 .error-graphic svg {
    width: 300px;
    height: 200px;
    max-width: 100%;
}

/* 403 */
.error-403 .error-icon {
    font-size: 6rem;
    color: var(--warning-color);
    margin: var(--space-6) 0;
    animation: bounce 2s ease-in-out infinite;
}

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

/* 500 */
.error-500 {
    background: var(--bg-tertiary);
}

.error-500 .error-code {
    color: var(--error-color);
    -webkit-text-fill-color: var(--error-color);
}

.error-500 .error-icon {
    font-size: 6rem;
    color: var(--error-color);
    margin: var(--space-6) 0;
    animation: shake 0.5s ease-in-out infinite;
}

/* Maintenance */
.error-maintenance {
    max-width: 600px;
    margin: 0 auto;
}

.maintenance-icon {
    font-size: 6rem;
    color: var(--warning-color);
    margin: var(--space-6) 0;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.maintenance-progress {
    margin: var(--space-6) 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.maintenance-progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-3);
}

.maintenance-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 65%;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 65%; }
}

/* Erreur offline */
.error-offline {
    background: var(--bg-secondary);
}

.offline-icon {
    font-size: 6rem;
    color: var(--text-muted);
    margin: var(--space-6) 0;
    position: relative;
}

.offline-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 100%;
    height: 4px;
    background: var(--error-color);
}

/* Suggestions d'erreur */
.error-suggestions {
    margin-top: var(--space-8);
    padding: var(--space-6);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: left;
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.error-suggestions h3 {
    margin: 0 0 var(--space-4);
    font-size: var(--font-size-lg);
    color: var(--text-primary);
}

.error-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-suggestions li {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.error-suggestions li:last-child {
    border-bottom: none;
}

.error-suggestions li i {
    color: var(--primary-color);
    flex-shrink: 0;
}

/* Mini animation pour les icônes */
.error-icon-animated {
    display: inline-block;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive */
@media (max-width: 768px) {
    .error-page {
        padding: var(--space-6);
        min-height: calc(100vh - var(--navbar-height) - 150px);
    }
    
    .error-code {
        font-size: 5rem;
    }
    
    .error-title {
        font-size: 1.75rem;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .error-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .error-suggestions {
        padding: var(--space-4);
    }
}

@media (max-width: 480px) {
    .error-code {
        font-size: 4rem;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
    
    .error-description {
        font-size: var(--font-size-base);
    }
    
    .error-404 .error-graphic svg {
        width: 200px;
        height: 150px;
    }
}

/* Mode sombre optimisé */
@media (prefers-color-scheme: dark) {
    .error-details-content {
        background: rgba(0, 0, 0, 0.4);
    }
    
    .error-stack {
        background: rgba(0, 0, 0, 0.6);
    }
}