/* =============================================
   Global Notification System
   Custom toast notifications & confirm dialogs
   Replaces all native alert() and confirm() calls
   ============================================= */

/* ---- Notification Container ---- */
.ase-notify-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
    width: calc(100% - 40px);
    pointer-events: none;
}

/* ---- Toast Notification ---- */
.ase-toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 4px;
    background: #222222;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.ase-toast.show {
    transform: translateX(0);
    opacity: 1;
}
.ase-toast.removing {
    transform: translateX(120%);
    opacity: 0;
}

/* Progress bar */
.ase-toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255,255,255,0.3);
    animation: aseToastProgress var(--ase-toast-duration, 4s) linear forwards;
}
@keyframes aseToastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Icon */
.ase-toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin-top: 1px;
}

/* Type variants */
.ase-toast.success {
    border-left: 4px solid #029e76;
}
.ase-toast.success .ase-toast-icon {
    background: rgba(2, 158, 118, 0.2);
    color: #029e76;
}

.ase-toast.error {
    border-left: 4px solid #FF421D;
}
.ase-toast.error .ase-toast-icon {
    background: rgba(255, 66, 29, 0.2);
    color: #FF421D;
}

.ase-toast.warning {
    border-left: 4px solid #ff8853;
}
.ase-toast.warning .ase-toast-icon {
    background: rgba(255, 136, 83, 0.2);
    color: #ff8853;
}

.ase-toast.info {
    border-left: 4px solid #4facfe;
}
.ase-toast.info .ase-toast-icon {
    background: rgba(79, 172, 254, 0.2);
    color: #4facfe;
}

/* Content */
.ase-toast-content {
    flex: 1;
    min-width: 0;
}
.ase-toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}
.ase-toast-message {
    font-size: 13px;
    opacity: 0.85;
    word-wrap: break-word;
}

/* Close button */
.ase-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin-top: -2px;
    transition: color 0.2s;
}
.ase-toast-close:hover {
    color: #fff;
}

/* ---- Confirm Dialog Overlay ---- */
.ase-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.ase-confirm-overlay.show {
    opacity: 1;
}

/* Confirm Dialog Box */
.ase-confirm-box {
    background: #fff;
    border-radius: 4px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    font-family: 'Poppins', sans-serif;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.ase-confirm-overlay.show .ase-confirm-box {
    transform: scale(1) translateY(0);
}

.ase-confirm-header {
    background: #222222;
    color: #fff;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ase-confirm-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 136, 83, 0.2);
    color: #ff8853;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.ase-confirm-header-title {
    font-weight: 700;
    font-size: 16px;
}
.ase-confirm-header.danger .ase-confirm-header-icon {
    background: rgba(255, 66, 29, 0.2);
    color: #FF421D;
}

.ase-confirm-body {
    padding: 25px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.ase-confirm-footer {
    padding: 15px 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #f0f0f0;
}
.ase-confirm-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}
.ase-confirm-btn.cancel {
    background: #f0f0f0;
    color: #555;
}
.ase-confirm-btn.cancel:hover {
    background: #e0e0e0;
}
.ase-confirm-btn.confirm {
    background: #FF421D;
    color: #fff;
}
.ase-confirm-btn.confirm:hover {
    background: #e92600;
}
.ase-confirm-btn.confirm.danger {
    background: #c0392b;
}
.ase-confirm-btn.confirm.danger:hover {
    background: #a5281b;
}

/* ---- Responsive ---- */
@media only screen and (max-width: 575px) {
    .ase-notify-container {
        top: 10px;
        right: 10px;
        width: calc(100% - 20px);
    }
    .ase-toast {
        padding: 14px 16px;
        font-size: 13px;
    }
    .ase-confirm-box {
        max-width: 100%;
    }
}
