/* ── Toast notifications (toastr) ──
   Restyles the toastr popups to match the site's glass-card design:
   dark glass by default, white card in the light theme, coloured icon
   badge + accent edge per type, full-width on phones. */

#toast-container {
    z-index: 100000;
}
#toast-container.toast-top-right {
    top: 20px;
    right: 20px;
}

#toast-container > div.toast {
    --toast-accent: #3b82f6;
    --toast-soft: rgba(59, 130, 246, 0.16);
    --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");

    position: relative;
    width: 360px;
    max-width: calc(100vw - 32px);
    margin: 0 0 12px;
    padding: 15px 46px 15px 62px;
    border-radius: 14px;
    overflow: hidden;
    opacity: 1;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #f1f5f9;
    background-image: none !important;
    background-color: rgba(15, 23, 42, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    animation: toast-slide-in 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) both;
}
#toast-container > div.toast:hover {
    opacity: 1;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

/* Accent edge */
#toast-container > div.toast::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--toast-accent);
}

/* Icon badge */
#toast-container > div.toast::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 16px;
    width: 32px;
    height: 32px;
    margin-top: -16px;
    border-radius: 10px;
    background: var(--toast-icon) center / 18px 18px no-repeat, var(--toast-soft);
}

#toast-container > div.toast-success {
    --toast-accent: #22c55e;
    --toast-soft: rgba(34, 197, 94, 0.16);
    --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
#toast-container > div.toast-error {
    --toast-accent: #ef4444;
    --toast-soft: rgba(239, 68, 68, 0.16);
    --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
}
#toast-container > div.toast-warning {
    --toast-accent: #f59e0b;
    --toast-soft: rgba(245, 158, 11, 0.16);
    --toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
}

#toast-container > div.toast .toast-title {
    font-weight: 700;
    margin-bottom: 2px;
}
#toast-container > div.toast .toast-message {
    word-wrap: break-word;
}
#toast-container > div.toast .toast-message a {
    color: inherit;
    text-decoration: underline;
}

#toast-container > div.toast .toast-close-button {
    position: absolute;
    top: 50%;
    right: 10px;
    float: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    padding: 0;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    color: rgba(226, 232, 240, 0.6);
    text-shadow: none;
    opacity: 1;
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}
#toast-container > div.toast .toast-close-button:hover,
#toast-container > div.toast .toast-close-button:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

#toast-container > div.toast .toast-progress {
    left: 0;
    bottom: 0;
    height: 3px;
    opacity: 0.8;
    background-color: var(--toast-accent);
}

/* Light theme */
body.home-light-theme #toast-container > div.toast {
    color: #0f172a;
    background-color: rgba(255, 255, 255, 0.97);
    border-color: #e2e8f0;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}
body.home-light-theme #toast-container > div.toast:hover {
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}
body.home-light-theme #toast-container > div.toast .toast-close-button {
    color: #94a3b8;
}
body.home-light-theme #toast-container > div.toast .toast-close-button:hover,
body.home-light-theme #toast-container > div.toast .toast-close-button:focus {
    color: #0f172a;
    background: #f1f5f9;
}

/* Phones: full-width toasts at the top */
@media (max-width: 575px) {
    #toast-container.toast-top-right {
        top: 12px;
        right: 12px;
        left: 12px;
    }
    #toast-container > div.toast {
        width: 100%;
        max-width: none;
        padding: 14px 44px 14px 60px;
        animation-name: toast-slide-down;
    }
}

@keyframes toast-slide-in {
    from { transform: translateX(24px) scale(0.98); }
    to   { transform: none; }
}
@keyframes toast-slide-down {
    from { transform: translateY(-16px) scale(0.98); }
    to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    #toast-container > div.toast {
        animation: none;
    }
}
