/* ---------------------------------------------------------
 * EcoVitamin Toast Notifications (clean consolidated)
 * - Uses project CSS variables with safe fallbacks
 * - Single definitions, no duplicates
 * - Message wrapping enabled
 * Date: 2026-05-25
 * ------------------------------------------------------------------------------ */

:root {
    --toast-danger: var(--danger, #e10000);
    --toast-success: var(--success2, #54B24C);
    --toast-on-surface: var(--onSurface, #0f172a);
    --toast-secondary: var(--secondary, #6b7280);
    --toast-surface-overlay: var(--surface-overlay, rgba(255, 255, 255, 0.05));
    --toast-warning: var(--primary-hover, #f59e0b);
}

.toast-styled {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 200000;
    display: flex;
    visibility: hidden;
    opacity: 0;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--toast-surface-overlay);
    width: 90%;
    max-width: 450px;
    transition: all 320ms cubic-bezier(.2, .9, .2, 1);
    pointer-events: auto;
}

.dark-theme .toast-styled {
    background: rgba(24, 25, 26, 0.85);
    border: 1px solid var(--toast-surface-overlay);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.toast-styled.active {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    width: 100%;
}

.toast-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#toastIcon,
.toast-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(15, 23, 42, 0.03);
}

/* project icon font class (font-icons) */
.icon-noti,
.icon-bell {
    font-size: 18px;
    color: var(--toast-on-surface);
}

/* bottom border per type */
.toast-styled {
    border-bottom: 4px solid transparent;
}

.toast-styled.toast-danger {
    border-bottom-color: var(--toast-danger);
}

.toast-styled.toast-success {
    border-bottom-color: var(--toast-success);
}

.toast-styled.toast-warning {
    border-bottom-color: var(--toast-warning);
}

/* message: allow wrapping */
.toast-title {
    font-size: 13px;
    color: var(--toast-on-surface);
    margin-bottom: 4px;
    font-weight: 700;
}

.toast-message {
    color: var(--toast-on-surface);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    max-width: 450px;
}

.toast-close {
    width: 32px !important;
    height: 32px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100%;
    color: var(--toast-secondary);
    background: rgba(15, 23, 42, 0.03);
    border: none;
    cursor: pointer;
}

.toast-close:hover {
    transform: scale(1.06);
}

/* type-based icon coloring (optional) */
.toast-styled.toast-danger .icon-noti {
    color: var(--toast-danger);
}

.toast-styled.toast-success .icon-noti {
    color: var(--toast-success);
}

.toast-styled.toast-warning .icon-noti {
    color: var(--toast-warning);
}

.toast-icon-success {
    color: var(--toast-success) !important;
    filter: drop-shadow(0 0 8px rgba(84, 178, 76, 0.35));
}

.toast-icon-error {
    color: var(--toast-danger) !important;
    filter: drop-shadow(0 0 8px rgba(225, 0, 0, 0.35));
}

@media (max-width:480px) {

    #commonToast,
    .toast-styled {
        max-width: 90%;
        padding: 0px 0px;
        border-radius: 12px;
    }

    .toast-message {
        font-size: 13px;
        max-width: 250px;
    }
}

/* utility */
.toast-hidden {
    visibility: hidden;
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

.toast-visible {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}