/* /modules/addons/advanced_notifications/assets/css/client.css */

/* Base container for all toast notifications */
.an-toast-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Prevent clicks from passing through the container */
    pointer-events: none;
}

/* Positions */
.an-toast-container.top-right {
    top: 20px;
    right: 20px;
    align-items: flex-end;
}

.an-toast-container.top-left {
    top: 20px;
    left: 20px;
    align-items: flex-start;
}

.an-toast-container.top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.an-toast-container.bottom-right {
    bottom: 20px;
    right: 20px;
    align-items: flex-end;
}

.an-toast-container.bottom-left {
    bottom: 20px;
    left: 20px;
    align-items: flex-start;
}

.an-toast-container.bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

/* Toast Style - REVISED */
.an-toast {
    /* Allow clicks on individual toasts */
    pointer-events: auto;
    /* New sizing rules */
    min-width: 320px;
    /* حداقل عرض برای جلوگیری از کوچک شدن زیاد */
    max-width: 450px;
    /* حداکثر عرض بیشتر برای محتوای طولانی */
    width: auto;
    /* عرض خودکار بر اساس محتوا */

    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;

    /* Ensure long words or links break and don't overflow */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.an-toast-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.an-toast-body {
    flex-grow: 1;
}

/* REVISED: Allow controls to wrap if they are too long */
.an-toast-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    flex-wrap: wrap;
    /* اجازه می‌دهد دکمه‌ها در صورت کمبود جا به خط بعدی بروند */
}

.an-toast-dismiss,
.an-toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 2px 5px;
    /* Add some padding for easier clicking */
}

.an-toast-dismiss:hover,
.an-toast-close:hover {
    opacity: 1;
}

.an-toast-button {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: inherit;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    /* Prevent button text from wrapping */
}

/* Popup (Modal) Style - REVISED */
.an-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.an-popup-content {
    max-width: 600px;
    /* حداکثر عرض بیشتر برای پاپ‌آپ */
    width: 90%;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    text-align: center;

    /* Ensure long words break */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.an-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

/* Dark Mode Compatibility */
@media (prefers-color-scheme: dark) {
    .an-toast {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.an-anim-fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.an-anim-slideInUp {
    animation: slideInUp 0.5s ease-in-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.an-anim-slideInRight {
    animation: slideInRight 0.5s ease-in-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.an-anim-zoomIn {
    animation: zoomIn 0.4s ease-in-out;
}