/**
 * Error Messages Styles
 * أنماط رسائل الخطأ
 */

/* Error Message Container */
.error-message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    max-width: 500px;
    width: 90%;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.error-message-container.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Error Message Content */
.error-message-content {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-right: 4px solid #ef4444;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

/* Error Icon */
.error-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 1.25rem;
}

/* Error Text */
.error-text {
    flex: 1;
}

.error-text h4 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
}

.error-text p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Error Buttons */
.error-retry-btn,
.error-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.error-retry-btn {
    color: #3b82f6;
    margin-right: auto;
}

.error-retry-btn:hover {
    background: #eff6ff;
    color: #2563eb;
}

.error-close-btn {
    color: #6b7280;
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-close-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Dark Mode */
.dark-mode .error-message-content {
    background: #1e293b;
    border-right-color: #ef4444;
}

.dark-mode .error-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.dark-mode .error-text h4 {
    color: #f1f5f9;
}

.dark-mode .error-text p {
    color: #cbd5e1;
}

.dark-mode .error-retry-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.dark-mode .error-close-btn {
    color: #94a3b8;
}

.dark-mode .error-close-btn:hover {
    background: #334155;
    color: #f1f5f9;
}

/* Responsive */
@media (max-width: 768px) {
    .error-message-container {
        top: 10px;
        width: 95%;
    }

    .error-message-content {
        padding: 1rem;
        flex-direction: column;
    }

    .error-close-btn {
        position: absolute;
        top: 0.5rem;
        left: 0.5rem;
    }

    .error-retry-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}