/* =========================================
   ERROR ALERT COMPONENT STYLES
   ========================================= */

.error-alert {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.error-alert-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.error-alert-icon {
    flex-shrink: 0;
    font-size: 1.5rem;
}

.error-alert-body {
    flex: 1;
    position: relative;
}

.error-alert-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.error-alert-message {
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.error-alert-details {
    margin-top: 0.75rem;
}

.error-alert-details-content {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    overflow-x: auto;
}

.error-alert-details-content code {
    white-space: pre-wrap;
    word-break: break-word;
}

.error-alert-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.error-alert-close {
    position: absolute;
    top: 0;
    right: 0;
}

/* Error Type Variants */
.error-alert.alert-error,
.error-alert:not([class*="alert-"]) {
    background-color: #fff5f5;
    border-color: #fc8181;
    color: #742a2a;
}

.error-alert.alert-error .error-alert-icon,
.error-alert:not([class*="alert-"]) .error-alert-icon {
    color: #e53e3e;
}

.error-alert.alert-warning {
    background-color: #fffbf0;
    border-color: #fbd38d;
    color: #744210;
}

.error-alert.alert-warning .error-alert-icon {
    color: #ed8936;
}

.error-alert.alert-info {
    background-color: #f0f9ff;
    border-color: #90cdf4;
    color: #2c5282;
}

.error-alert.alert-info .error-alert-icon {
    color: #3182ce;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .error-alert {
        padding: 0.875rem;
    }

    .error-alert-content {
        gap: 0.75rem;
    }

    .error-alert-icon {
        font-size: 1.25rem;
    }

    .error-alert-title {
        font-size: 1rem;
    }

    .error-alert-message {
        font-size: 0.875rem;
    }

    .error-alert-actions {
        flex-direction: column;
    }

    .error-alert-actions .btn {
        width: 100%;
    }
}

/* Loading state for retry button */
.error-alert-actions .btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* Animation for expanded details */
.error-alert-details-content {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* Accessibility */
.error-alert:focus-within {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Dark mode support - Updated to match theme system */
html[data-theme="dark"] .error-alert.alert-error,
html[data-theme="dark"] .error-alert:not([class*="alert-"]) {
    background-color: #7f1d1d;
    border-color: #991b1b;
    color: #fecaca !important;
}

html[data-theme="dark"] .error-alert.alert-error .error-alert-icon,
html[data-theme="dark"] .error-alert:not([class*="alert-"]) .error-alert-icon {
    color: #fca5a5;
}

html[data-theme="dark"] .error-alert.alert-warning {
    background-color: #78350f;
    border-color: #92400e;
    color: #fef3c7 !important;
}

html[data-theme="dark"] .error-alert.alert-warning .error-alert-icon {
    color: #fbbf24;
}

html[data-theme="dark"] .error-alert.alert-info {
    background-color: #1e40af;
    border-color: #1e3a8a;
    color: #dbeafe !important;
}

html[data-theme="dark"] .error-alert.alert-info .error-alert-icon {
    color: #93c5fd;
}

html[data-theme="dark"] .error-alert-details-content {
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
}

/* Light mode explicit styles */
html:not([data-theme="dark"]) .error-alert.alert-error,
html:not([data-theme="dark"]) .error-alert:not([class*="alert-"]) {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #7f1d1d !important;
}

html:not([data-theme="dark"]) .error-alert.alert-error .error-alert-icon,
html:not([data-theme="dark"]) .error-alert:not([class*="alert-"]) .error-alert-icon {
    color: #dc2626;
}

html:not([data-theme="dark"]) .error-alert.alert-warning {
    background-color: #fef3c7;
    border-color: #fde68a;
    color: #78350f !important;
}

html:not([data-theme="dark"]) .error-alert.alert-warning .error-alert-icon {
    color: #f59e0b;
}

html:not([data-theme="dark"]) .error-alert.alert-info {
    background-color: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af !important;
}

html:not([data-theme="dark"]) .error-alert.alert-info .error-alert-icon {
    color: #3b82f6;
}

html:not([data-theme="dark"]) .error-alert-details-content {
    background: rgba(0, 0, 0, 0.05);
    color: inherit;
}
