/* gooey-toast — Morphing dynamic toast notifications for SynapseMed */
@keyframes gooey-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes gooey-enter {
    0% {
        opacity: 0;
        transform: translateY(-24px) scale(0.85);
    }
    60% {
        transform: translateY(4px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gooey-exit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-16px) scale(0.9);
    }
}

.gooey-toaster {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    width: 100%;
    max-width: 440px;
    padding: 0 16px;
    box-sizing: border-box;
}

.gooey-wrapper {
    pointer-events: auto;
    cursor: pointer;
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    width: fit-content;
    max-width: 100%;
    animation: gooey-enter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.gooey-wrapper.gooey-removing {
    animation: gooey-exit 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

/* Morphing Background Shell with organic shadow & border */
.gooey-background {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 25px -5px rgba(33, 56, 116, 0.12), 0 8px 10px -6px rgba(33, 56, 116, 0.08);
    transition: all 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
    z-index: 0;
}

.gooey-wrapper:hover .gooey-background {
    box-shadow: 0 14px 28px -4px rgba(33, 56, 116, 0.18), 0 10px 12px -5px rgba(33, 56, 116, 0.1);
    border-color: rgba(26, 106, 195, 0.4);
}

.gooey-expanded .gooey-background {
    border-radius: 20px;
}

/* Status Accents on background */
.gooey-success .gooey-background {
    border-color: rgba(34, 197, 94, 0.35);
}
.gooey-error .gooey-background {
    border-color: rgba(239, 68, 68, 0.35);
}
.gooey-warning .gooey-background {
    border-color: rgba(245, 158, 11, 0.35);
}
.gooey-info .gooey-background {
    border-color: rgba(26, 106, 195, 0.35);
}

/* Toast Content Container */
.gooey-content {
    position: relative;
    z-index: 1;
    transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.gooey-contentCompact {
    padding: 8px 16px;
}

.gooey-contentExpanded {
    padding: 14px 18px 16px;
    min-width: 320px;
    max-width: 420px;
}

/* Header & Typography */
.gooey-header {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    width: 100%;
}

.gooey-iconWrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    line-height: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gooey-wrapper:hover .gooey-iconWrapper {
    transform: scale(1.15) rotate(5deg);
}

.gooey-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: #213874;
}

.gooey-titleSuccess { color: #15803d; }
.gooey-titleError { color: #b91c1c; }
.gooey-titleWarning { color: #b45309; }
.gooey-titleInfo { color: #1a6ac3; }

.gooey-timestamp {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    line-height: 1;
    margin-left: auto;
    font-family: "JetBrains Mono", monospace;
}

.gooey-closeBtn {
    opacity: 0;
    margin-left: 6px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gooey-wrapper:hover .gooey-closeBtn {
    opacity: 1;
}

.gooey-closeBtn:hover {
    color: #213874;
    transform: scale(1.2);
}

/* Description Text */
.gooey-description {
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    line-height: 1.5;
    margin-top: 8px;
    overflow: hidden;
    word-break: break-word;
}

/* Action Button */
.gooey-actionWrapper {
    margin-top: 10px;
    overflow: hidden;
}

.gooey-actionButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: all 0.15s ease;
    background: #f1f5f9;
    color: #213874;
}

.gooey-actionButton:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.gooey-actionButton:active {
    transform: translateY(0);
}

/* Progress countdown line */
.gooey-progressWrapper {
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.6);
}

.gooey-progressBar {
    height: 100%;
    width: 100%;
    background: #1a6ac3;
    border-radius: 999px;
    transform-origin: left;
    transition: transform linear;
}

.gooey-success .gooey-progressBar { background: #22c55e; }
.gooey-error .gooey-progressBar { background: #ef4444; }
.gooey-warning .gooey-progressBar { background: #f59e0b; }
.gooey-info .gooey-progressBar { background: #1a6ac3; }

.gooey-spinnerSpin {
    animation: gooey-spin 0.85s linear infinite;
}
