/* ============================================================
   Seedates – Shared System Messages UI
   Notification cards + toasts.
   BUTTONS: reuse the ready keycap theme (button-theme.css /
   button-theme.js). Buttons are plain <button> elements with
   NO inline styles — no custom button visuals are defined here.
   ============================================================ */

/* ── Notification card (top-right, e.g. "See Dates search complete") ── */
.sd-msg {
    position: fixed;
    top: 16px;
    inset-inline-end: 16px;
    z-index: 10000;
    max-width: 360px;
    width: calc(100vw - 32px);
    box-sizing: border-box;
    background: #f4f4f5;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10), 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 16px 18px 14px;
    font-family: var(--font-body);
    animation: sdMsgIn 0.28s ease;
}
@keyframes sdMsgIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sd-msg-title {
    margin: 0 0 6px;
    font-size: var(--text-md);
    font-weight: 700;
    color: #1b4332;
}

.sd-msg-body {
    margin: 0 0 14px;
    font-size: var(--text-body);
    line-height: 1.45;
    color: #4a5568;
}

.sd-msg-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Primary action keycap — sizing comes from the keycap theme (40px).
   margin-inline-end:auto pushes the close keycap to the far end
   (logical → flips correctly in RTL). */
.sd-msg-btn-primary {
    margin-inline-end: auto;
}

/* Compact square close keycap (overrides the theme's uniform sizing).
   The keycap visuals themselves still come from button-theme.css;
   button-theme.js re-measures height → --kc ≈ 0.4 and scales the
   recipe down automatically. */
.sd-msg-btn-close {
    height: 32px !important;
    width: 32px !important;
    padding: 0 !important;
    flex: 0 0 32px;
    border-radius: 6px !important;
}

/* ── Toast (bottom-center pill, e.g. "Saved") ─────────────── */
.sd-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2500;
    box-sizing: border-box;
    background: #f4f4f5;
    border-radius: 30px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    padding: 0.65rem 1.3rem;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    color: #1b4332;
    white-space: nowrap;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
    animation: sdToastIn 0.25s ease;
}

/* ── Error toast variant (replaces native alert()) ────────── */
.sd-toast-error {
    background: #fdf2f2;
    border: 1px solid #f3c9c9;
    color: #8a1f1f;
    white-space: normal;              /* error text can be long */
    text-align: center;
    max-width: min(520px, calc(100vw - 32px));
}
@keyframes sdToastIn {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Inline action toast (bottom-right, e.g. quick-tips) ──── */
.sd-msg-toast {
    position: fixed;
    bottom: 16px;
    inset-inline-end: 16px;
    z-index: 1500;
    box-sizing: border-box;
    background: #f4f4f5;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10), 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    color: #1b4332;
}

/* ── Centered confirmation dialog ─────────────────────────── */
.sd-msg-confirm {
    top: 18vh;
    inset-inline-start: 50%;
    inset-inline-end: auto;
    transform: translateX(-50%);
    width: min(360px, calc(100vw - 32px));
    max-width: 360px;
    text-align: center;
    animation: sdMsgConfirmIn 0.28s ease;
}
@keyframes sdMsgConfirmIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.sd-msg-confirm-actions {
    justify-content: center;
}

/* Cancel (gray keycap via .btn-secondary) + confirm keycaps keep
   their sizing from the ready keycap theme; .btn-danger renders
   the red danger keycap for destructive confirms. */
.sd-msg-btn-cancel,
.sd-msg-btn-confirm {
    margin: 0;
}
