/*
 * WHRO Live 6.2 - Studio Polish
 * Shared confirmation dialog and toast presentation.
 */

.whro-confirm-lock {
    overflow: hidden;
}

.whro-confirm-backdrop {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 8, 16, 0.78);
    backdrop-filter: blur(5px);
}

.whro-confirm-backdrop[hidden] {
    display: none;
}

.whro-confirm-dialog {
    width: min(500px, 100%);
    overflow: hidden;
    border: 1px solid #334860;
    border-radius: 16px;
    background: #101c2b;
    color: #f4f7fb;
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.03);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.whro-confirm-accent {
    height: 5px;
    background: #5db9ff;
}

.whro-confirm-dialog.is-danger .whro-confirm-accent {
    background: #ff5d68;
}

.whro-confirm-dialog.is-success .whro-confirm-accent {
    background: #4bd37b;
}

.whro-confirm-dialog.is-warning .whro-confirm-accent {
    background: #ffc857;
}

.whro-confirm-content {
    padding: 26px 27px 20px;
}

.whro-confirm-eyebrow {
    margin: 0 0 8px;
    color: #8da2b8;
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.whro-confirm-title {
    margin: 0;
    color: #ffffff;
    font-size: 1.45rem;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.whro-confirm-message {
    margin: 13px 0 0;
    color: #bdc9d6;
    font-size: 0.98rem;
    line-height: 1.6;
    white-space: pre-line;
}

.whro-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 11px;
    padding: 18px 27px 24px;
    border-top: 1px solid #26394f;
}

.whro-confirm-button {
    min-height: 43px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 850;
    cursor: pointer;
}

.whro-confirm-cancel {
    border-color: #3a4d63;
    background: transparent;
    color: #e4ebf3;
}

.whro-confirm-cancel:hover,
.whro-confirm-cancel:focus-visible {
    background: #19283a;
}

.whro-confirm-accept {
    background: #5db9ff;
    color: #06111c;
}

.whro-confirm-dialog.is-danger .whro-confirm-accept {
    background: #ff5d68;
    color: #21070a;
}

.whro-confirm-dialog.is-success .whro-confirm-accept {
    background: #4bd37b;
    color: #07150d;
}

.whro-confirm-dialog.is-warning .whro-confirm-accept {
    background: #ffc857;
    color: #241a02;
}

.whro-confirm-button:focus-visible {
    outline: 3px solid rgba(93, 185, 255, 0.46);
    outline-offset: 3px;
}

/* Existing Django message stack, upgraded for 6.2. */

.toast-stack {
    position: fixed;
    z-index: 9000;
    top: 82px;
    right: 20px;
    left: auto;
    display: grid;
    width: min(430px, calc(100% - 32px));
    gap: 10px;
    transform: none;
    pointer-events: none;
}

.toast {
    position: relative;
    overflow: hidden;
    padding: 15px 44px 15px 17px;
    border: 1px solid #35516d;
    border-radius: 12px;
    background: #112235;
    color: #f3f7fb;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.32);
    line-height: 1.45;
    pointer-events: auto;
    animation: whro-toast-in 180ms ease-out;
}

.toast::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: #5db9ff;
    content: "";
}

.toast-success::before {
    background: #4bd37b;
}

.toast-warning::before {
    background: #ffc857;
}

.toast-error::before {
    background: #ff5d68;
}

.toast-dismiss {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #aebdca;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.toast-dismiss:hover,
.toast-dismiss:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

@keyframes whro-toast-in {
    from {
        opacity: 0;
        transform: translateY(-9px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 620px) {
    .whro-confirm-backdrop {
        align-items: end;
        padding: 12px;
    }

    .whro-confirm-dialog {
        border-radius: 15px;
    }

    .whro-confirm-actions {
        flex-direction: column-reverse;
    }

    .whro-confirm-button {
        width: 100%;
    }

    .toast-stack {
        top: 72px;
        right: 16px;
    }
}

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