﻿/* استایل پیشرفته برای Alertهای Bootstrap */

/* Alert اصلی */
.alert {
    position: relative;
    z-index: 1050;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
    padding: 1rem 1.5rem;
}

    /* جلوگیری از تداخل با فرم‌ها */
    .alert ~ .form-control,
    .alert ~ .form-select,
    .alert ~ .btn {
        position: relative;
        z-index: 1;
    }

/* انواع Alert */
.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 5px solid #10b981;
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 5px solid #ef4444;
    color: #7f1d1d;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 5px solid #f59e0b;
    color: #78350f;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 5px solid #3b82f6;
    color: #1e3a8a;
}

/* دکمه بستن */
.alert-dismissible .btn-close {
    position: absolute;
    left: 1rem;
    top: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s;
}

    .alert-dismissible .btn-close:hover {
        background: rgba(255, 255, 255, 0.5);
        transform: scale(1.1);
    }

/* Alert با محتوای خاص */
.alert .d-flex {
    align-items: flex-start;
}

.alert strong {
    font-weight: 600;
}

.alert small {
    opacity: 0.9;
}

/* انیمیشن‌ها */
@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Alert در حال بسته شدن */
.alert.fade.show {
    animation: slideDown 0.3s ease-out;
}

.alert.fade:not(.show) {
    animation: fadeOut 0.3s ease-out;
}

/* تنظیمات برای نمایش درست روی فرم‌ها */
.modal .alert {
    z-index: 99999;
}

/* Alert‌های ثابت (Fixed) برای مواقع خاص */
.alert-fixed-top {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 600px;
    animation: slideDownFixed 0.3s ease-out;
}

@keyframes slideDownFixed {
    from {
        transform: translateX(-50%) translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .alert {
        margin: 1rem;
        border-radius: 8px;
    }

    .alert-fixed-top {
        width: 95%;
        top: 70px;
    }
}

/* جلوگیری از overlap با dropdown */
.dropdown-menu {
    z-index: 1000 !important;
}

.alert {
    z-index: 999 !important;
}
