/**
 * POCHTECH modern toast — force top-center for ALL notifications (toastr + PHPFlasher)
 */

/* Force every toast container to top-center regardless of library defaults */
#toast-container {
    top: 1.25rem !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
    width: min(92vw, 440px) !important;
    pointer-events: none;
    z-index: 2147483646 !important;
    position: fixed !important;
}

#toast-container > div {
    width: 100% !important;
    max-width: 440px;
    pointer-events: auto;
    padding: 0;
    margin: 0 0 0.75rem;
    opacity: 1 !important;
    box-shadow: none;
}

#toast-container > div.toast,
#toast-container > div.poch-toast,
#toast-container .toast {
    position: relative;
    display: block;
    width: 100% !important;
    padding: 1rem 2.75rem 1.05rem 3.65rem;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 20px 40px -12px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    font-family: "Manrope", system-ui, -apple-system, sans-serif;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    animation: pochToastIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#toast-container .toast.poch-toast::before,
#toast-container .toast::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
}

#toast-container .toast.poch-toast::after,
#toast-container .toast::after {
    content: "";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.1rem;
}

#toast-container .toast.toast-success::before,
#toast-container .toast-success::before { background: #059669; }
#toast-container .toast.toast-success::after,
#toast-container .toast-success::after {
    background-color: #ecfdf5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23059669' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}

#toast-container .toast.toast-error::before,
#toast-container .toast-error::before { background: #dc2626; }
#toast-container .toast.toast-error::after,
#toast-container .toast-error::after {
    background-color: #fef2f2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23dc2626' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E");
}

#toast-container .toast.toast-warning::before,
#toast-container .toast-warning::before { background: #d97706; }
#toast-container .toast.toast-warning::after,
#toast-container .toast-warning::after {
    background-color: #fffbeb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d97706' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3C/svg%3E");
}

#toast-container .toast.toast-info::before,
#toast-container .toast-info::before { background: #0B4F8A; }
#toast-container .toast.toast-info::after,
#toast-container .toast-info::after {
    background-color: #eff6ff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230B4F8A' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

#toast-container .toast .toast-message {
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
    color: #334155 !important;
    word-break: break-word;
}

#toast-container .toast .toast-title {
    display: block !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 0.2rem !important;
    padding: 0 !important;
    color: #64748b !important;
}

#toast-container .toast.toast-success .toast-title,
#toast-container .toast-success .toast-title { color: #059669 !important; }
#toast-container .toast.toast-error .toast-title,
#toast-container .toast-error .toast-title { color: #dc2626 !important; }
#toast-container .toast.toast-warning .toast-title,
#toast-container .toast-warning .toast-title { color: #d97706 !important; }
#toast-container .toast.toast-info .toast-title,
#toast-container .toast-info .toast-title { color: #0B4F8A !important; }

#toast-container .toast button.toast-close-button {
    position: absolute !important;
    top: 0.65rem !important;
    right: 0.65rem !important;
    float: none !important;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 8px !important;
    background: #f1f5f9 !important;
    color: #64748b !important;
    font-size: 1.1rem !important;
    font-weight: 400 !important;
    line-height: 1.75rem !important;
    text-align: center;
    opacity: 1 !important;
    text-shadow: none !important;
}

#toast-container .toast button.toast-close-button:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

#toast-container .toast .toast-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    opacity: 0.85;
}

#toast-container .toast.toast-success .toast-progress,
#toast-container .toast-success .toast-progress { background: #059669 !important; }
#toast-container .toast.toast-error .toast-progress,
#toast-container .toast-error .toast-progress { background: #dc2626 !important; }
#toast-container .toast.toast-warning .toast-progress,
#toast-container .toast-warning .toast-progress { background: #d97706 !important; }
#toast-container .toast.toast-info .toast-progress,
#toast-container .toast-info .toast-progress { background: #0B4F8A !important; }

/* Override Flasher injected styles */
.fl-no-cache,
#toast-container.fl-no-cache {
    top: 1.25rem !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
}

@keyframes pochToastIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    #toast-container {
        top: 0.75rem !important;
        width: calc(100vw - 1.5rem) !important;
    }
    #toast-container .toast {
        padding: 0.9rem 2.5rem 0.9rem 3.25rem;
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #toast-container .toast { animation: none; }
}
