﻿/* =========================================
   RAVANYAB - TOAST NOTIFICATIONS
========================================= */

.toast-container {
    position: fixed;
    top: 24px;
    left: 24px;
    width: min(380px, calc(100% - 32px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 99999;
    pointer-events: none;
}

/* Toast Item */
.toast-message {
    --toast-color: #4A6B5D;
    --toast-bg: #FFFFFF;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 16px 18px;
    background: var(--toast-bg);
    color: #2C3E35;
    border: 1px solid #E3E9E5;
    border-right: 4px solid var(--toast-color);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    direction: rtl;
    text-align: right;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease forwards;
}

/* Icon */
.toast-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--toast-color) 12%, transparent);
    color: var(--toast-color);
    font-size: 18px;
}

/* Content */
.toast-content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast-title {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
    color: inherit;
}

.toast-text {
    display: block;
    font-size: 13px;
    line-height: 2;
    color: #68766F;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

/* Close Button */
.toast-close {
    width: 26px;
    height: 26px;
    min-width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #87938C;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}

    .toast-close:hover {
        background: rgba(0, 0, 0, 0.06);
        color: #354E43;
    }

/* Types */
.toast-success {
    --toast-color: #4A9B72;
}

.toast-error {
    --toast-color: #D9534F;
}

.toast-warning {
    --toast-color: #D9A441;
}

.toast-info {
    --toast-color: #5489B8;
}

/* Exit Animation */
.toast-message.toast-hide {
    animation: toastSlideOut 0.25s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* Dark Mode */
html[data-theme="dark"] .toast-message {
    --toast-bg: #223129;
    background: var(--toast-bg);
    color: #E5ECE7;
    border-color: #35463C;
    border-right-color: var(--toast-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .toast-text {
    color: #A4B2AA;
}

html[data-theme="dark"] .toast-close {
    color: #A4B2AA;
}

    html[data-theme="dark"] .toast-close:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #FFFFFF;
    }

/* Mobile */
@media (max-width: 576px) {
    .toast-container {
        top: 12px;
        left: 12px;
        right: 12px;
        width: auto;
    }

    .toast-message {
        padding: 13px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .toast-message,
    .toast-message.toast-hide {
        animation: none;
    }
}
