/* =====================================================================
   GEO Shape - Toast messages + Confirmation dialog
   Used by assets/js/geo-ui.js
   ===================================================================== */

/* ---------- Toast ---------- */
.geo-toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 360px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.geo-toast {
    --toast-accent: #32BDEA;
    --toast-tint: #e3f6fc;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 40px 16px 14px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06);
    border-left: 4px solid var(--toast-accent);
    overflow: hidden;
    pointer-events: auto;
    font-family: "Lato", sans-serif;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity .25s ease, transform .25s ease;
}

.geo-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.geo-toast.hide {
    opacity: 0;
    transform: translateX(24px);
}

/* Blue theme for every toast. Only the error icon is red, so errors still stand out. */
.geo-toast--success,
.geo-toast--error,
.geo-toast--warning,
.geo-toast--info    { --toast-accent: #32BDEA; --toast-tint: #e3f6fc; }
.geo-toast--error .geo-toast__icon { background: #fdecea; color: #d0402f; }

.geo-toast__icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--toast-tint);
    color: var(--toast-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.geo-toast__body {
    flex: 1;
    min-width: 0;
}

.geo-toast__title {
    font-size: 14px;
    font-weight: 700;
    color: #0f4c61;
    margin: 0 0 2px;
    line-height: 1.3;
}

.geo-toast__message {
    font-size: 13px;
    color: #4b5563;
    margin: 0;
    line-height: 1.45;
    word-wrap: break-word;
}

.geo-toast__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    line-height: 24px;
    padding: 0;
    cursor: pointer;
}

.geo-toast__close:hover { background: #f3f4f6; color: #374151; }

.geo-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--toast-accent);
    opacity: .35;
    transform-origin: left center;
}

/* ---------- Confirmation dialog ---------- */
.geo-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(17, 24, 39, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .2s ease;
}

.geo-confirm-backdrop.show { opacity: 1; }

/* All dialogs use the app's blue theme (primary #32BDEA). The icon still shows the kind of action. */
.geo-confirm {
    --confirm-accent: #1c9fcb;
    --confirm-accent-2: #32BDEA;
    --confirm-tint: #e3f6fc;
    --confirm-title: #0f4c61;
    width: 400px;
    max-width: 100%;
    background: #ffffff;
    border-radius: 20px;
    padding: 22px 22px 20px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    font-family: "Lato", sans-serif;
    transform: translateY(12px) scale(.97);
    transition: transform .2s ease;
}

.geo-confirm-backdrop.show .geo-confirm { transform: translateY(0) scale(1); }

.geo-confirm--primary,
.geo-confirm--warning {
    /* same blue theme - kept as classes so pages can still pass type: 'primary' / 'warning' */
}

.geo-confirm__head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.geo-confirm__icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--confirm-tint);
    color: var(--confirm-accent-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.geo-confirm__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--confirm-title);
    line-height: 1.3;
    word-break: break-word;
}

.geo-confirm__message {
    margin: 14px 0 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.geo-confirm__actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.geo-confirm__btn {
    flex: 1;
    height: 48px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s ease, box-shadow .15s ease, transform .05s ease;
    font-family: inherit;
}

.geo-confirm__btn:active { transform: translateY(1px); }

.geo-confirm__btn--cancel {
    background: #f1f8fc;
    border: 1px solid #d3e9f4;
    color: #2f4b5a;
}

.geo-confirm__btn--cancel:hover { filter: brightness(.97); }

.geo-confirm__btn--ok {
    background: linear-gradient(135deg, var(--confirm-accent-2), var(--confirm-accent));
    border: 1px solid var(--confirm-accent);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.geo-confirm__btn--ok:hover { filter: brightness(1.06); }

.geo-confirm__btn:focus-visible {
    outline: 3px solid rgba(50, 189, 234, 0.45);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .geo-toast-stack { top: 12px; right: 12px; left: 12px; width: auto; }
    .geo-confirm__actions { flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
    .geo-toast, .geo-confirm-backdrop, .geo-confirm { transition: none; }
}

/* Page loader: light CSS spinner instead of the 330 KB loader.gif; never blocks the page longer than 4 s */
#loading { animation: geoLoaderAutoHide 0s linear 4s forwards; }
#loading-center { background: none !important; }
#loading-center::after { content: ""; position: absolute; top: 50%; left: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border: 4px solid #d6f2fb; border-top-color: #32BDEA; border-radius: 50%; animation: geoLoaderSpin .7s linear infinite; }
@keyframes geoLoaderSpin { to { transform: rotate(360deg); } }
@keyframes geoLoaderAutoHide { to { visibility: hidden; opacity: 0; } }
