/* File: static/css/custom_alert.css */
/* Custom alert/popup widget — replaces browser alert() and confirm() */
/* Version: 1.0.0 */
/* Last Modified: 2026-02-07 */
/* Change: Initial creation — styled modal alert component - Fixes #51 */

/* Overlay */
.custom-alert-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: customAlertFadeIn 0.2s ease;
}
.custom-alert-overlay.active {
    display: flex;
}
.custom-alert-overlay.closing {
    animation: customAlertFadeOut 0.2s ease forwards;
}

/* Card */
.custom-alert-card {
    background: white;
    border-radius: 16px;
    padding: 28px 24px 20px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    animation: customAlertScaleIn 0.2s ease;
}
.custom-alert-overlay.closing .custom-alert-card {
    animation: customAlertScaleOut 0.2s ease forwards;
}

/* Icon */
.custom-alert-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.custom-alert-icon.success { background: #d4edda; color: #28a745; }
.custom-alert-icon.error   { background: #f8d7da; color: #dc3545; }
.custom-alert-icon.warning { background: #fff3cd; color: #e67e22; }
.custom-alert-icon.info    { background: #d1ecf1; color: #0c5460; }
.custom-alert-icon.confirm { background: #fff3cd; color: #e67e22; }

/* Title */
.custom-alert-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* Message */
.custom-alert-message {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Buttons */
.custom-alert-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.custom-alert-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s ease;
}
.custom-alert-btn:hover {
    opacity: 0.85;
}
.custom-alert-btn.cancel {
    background: #f5f5f5;
    color: #555;
    border: 1.5px solid #e0e0e0;
}
.custom-alert-btn.confirm-btn {
    background: #1a5f3c;
    color: white;
}
.custom-alert-btn.confirm-btn.error {
    background: #dc3545;
}

/* Animations */
@keyframes customAlertFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes customAlertFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes customAlertScaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
@keyframes customAlertScaleOut {
    from { transform: scale(1); opacity: 1; }
    to   { transform: scale(0.9); opacity: 0; }
}

/* RTL Support */
[dir="rtl"] .custom-alert-buttons {
    flex-direction: row-reverse;
}
