/**
 * Hub tastes dialog (#ttms-guest-taste-modal) — same motion as #notify-inbox.
 */

body.modal-open,
body.is-taste-opening,
body.is-taste-closing {
    overflow: hidden;
}

#ttms-guest-taste-modal.ttms-guest-taste-panel {
    --taste-accent: var(--hub-panel-accent, var(--brand-primary, #f5a618));
    --taste-ink: var(--hub-panel-ink, var(--main-text-color, #1a1a1a));
    --taste-ink-muted: var(--hub-panel-ink-muted, color-mix(in srgb, var(--taste-ink) 62%, transparent));
    --taste-from-x: 22vw;
    --taste-from-y: -38vh;
    position: fixed;
    inset: 0;
    z-index: 10040;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: var(--main-bg, #f6f3ee);
    color: var(--taste-ink);
    box-sizing: border-box;
}

#ttms-guest-taste-modal.ttms-guest-taste-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#ttms-guest-taste-modal .ttms-guest-taste-motion {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--hub-panel-bg-gradient, var(--main-bg, #f6f3ee));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#ttms-guest-taste-modal.is-taste-opening,
#ttms-guest-taste-modal.is-taste-closing,
#ttms-guest-taste-modal.ttms-guest-taste-hidden.is-taste-opening,
#ttms-guest-taste-modal.ttms-guest-taste-hidden.is-taste-closing {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    background: transparent !important;
}

#ttms-guest-taste-modal.is-taste-closing {
    pointer-events: none !important;
}

#ttms-guest-taste-modal.is-taste-opening::before,
#ttms-guest-taste-modal.is-taste-closing::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hub-panel-backdrop, color-mix(in srgb, var(--main-bg, #070b16) 88%, #000));
}

#ttms-guest-taste-modal.is-taste-opening::before {
    animation: taste-scrim-in 0.32s ease both;
}

#ttms-guest-taste-modal.is-taste-closing::before {
    animation: taste-scrim-out 0.26s ease both;
}

#ttms-guest-taste-modal.is-taste-opening .ttms-guest-taste-motion {
    animation: taste-panel-in 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#ttms-guest-taste-modal.is-taste-closing .ttms-guest-taste-motion {
    animation: taste-panel-out 0.34s cubic-bezier(0.3, 0.02, 0.2, 1) both;
}

.ttms-guest-taste-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 4.25rem;
    padding: 0.7rem 0.85rem 0.7rem 1rem;
    border-bottom: 1px solid var(--hub-panel-border, rgba(9, 10, 19, 0.1));
    background: var(--hub-panel-header-gradient, transparent);
}

.ttms-guest-taste-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.ttms-guest-taste-heading__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 50%;
    background: var(--hub-panel-icon-bg, rgba(255, 255, 255, 0.55));
    border: 1px solid var(--hub-panel-icon-border, rgba(9, 10, 19, 0.12));
    color: var(--taste-ink);
    flex-shrink: 0;
}

.ttms-guest-taste-heading__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ttms-guest-taste-heading__subtitle {
    margin: 0.1rem 0 0;
    font-size: 0.78rem;
    color: var(--taste-ink-muted);
}

.ttms-guest-taste-header-trailing {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.ttms-guest-taste-header .account-btn,
.ttms-guest-taste-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--hub-panel-icon-border, rgba(9, 10, 19, 0.12));
    background: var(--hub-panel-icon-bg, rgba(255, 255, 255, 0.55));
    color: var(--taste-ink);
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.ttms-guest-taste-header .account-btn:hover,
.ttms-guest-taste-header .account-btn:focus-visible,
.ttms-guest-taste-close:hover,
.ttms-guest-taste-close:focus-visible {
    background: var(--hub-panel-icon-hover-bg, rgba(255, 255, 255, 0.72));
    border-color: var(--hub-panel-icon-hover-border, rgba(9, 10, 19, 0.2));
    outline: none;
    transform: translateY(-1px);
}

.ttms-guest-taste-header .account-btn svg,
.ttms-guest-taste-header .account-btn svg.icon,
.ttms-guest-taste-close img,
.ttms-guest-taste-close svg {
    width: 1.15rem;
    height: 1.15rem;
    opacity: 0.88;
    color: inherit;
    fill: currentColor;
}

body.ttms-logged-in .ttms-guest-taste-header .account-btn,
.ttms-guest-taste-header .account-btn.account-btn--signed-in {
    color: var(--hub-panel-success, #1f8a4c);
    border-color: color-mix(in srgb, var(--hub-panel-success, #1f8a4c) 45%, var(--hub-panel-icon-border, rgba(9, 10, 19, 0.12)));
    background: color-mix(in srgb, var(--hub-panel-success, #1f8a4c) 12%, var(--hub-panel-icon-bg, rgba(255, 255, 255, 0.55)));
}

.ttms-guest-taste-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.95rem 0.95rem 1.4rem;
}

@keyframes taste-scrim-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes taste-scrim-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes taste-panel-in {
    0% {
        transform: translate(var(--taste-from-x), var(--taste-from-y)) scale(0.1);
        opacity: 0.85;
        border-radius: 50%;
    }
    100% {
        transform: none;
        opacity: 1;
        border-radius: 0;
    }
}

@keyframes taste-panel-out {
    0% {
        transform: none;
        opacity: 1;
        border-radius: 0;
    }
    100% {
        transform: translate(var(--taste-from-x), var(--taste-from-y)) scale(0.08);
        opacity: 0;
        border-radius: 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    #ttms-guest-taste-modal.is-taste-opening::before,
    #ttms-guest-taste-modal.is-taste-closing::before,
    #ttms-guest-taste-modal.is-taste-opening .ttms-guest-taste-motion,
    #ttms-guest-taste-modal.is-taste-closing .ttms-guest-taste-motion {
        animation: none;
    }
}
