/**
 * "What's New" announcement popup
 * File Purpose: Larger, non-blocking release announcement that slides in from the
 * LEFT after the visitor has accepted consent (Product update prompts category).
 * Shown once per release via localStorage. Separate from the corner promo banner.
 */

.whats-new-popup {
    position: fixed;
    left: 20px;
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    z-index: 960;
    width: min(480px, calc(100vw - 40px));
    box-sizing: border-box;
    padding: 24px 24px 20px;
    color: var(--text-color, #e2e8f0);
    background: rgba(13, 18, 38, 0.92);
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 20px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    /* Hidden off-screen to the left, then slides in */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-115%);
    transition:
        opacity 0.32s ease,
        visibility 0.32s ease,
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.whats-new-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

[data-theme="light"] .whats-new-popup {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(2, 132, 199, 0.18);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.whats-new-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.6);
    color: rgba(226, 232, 240, 0.85);
    cursor: pointer;
    font: inherit;
    font-size: 1.2rem;
    line-height: 1;
    transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.whats-new-close:hover {
    border-color: rgba(125, 211, 252, 0.6);
    color: #ffffff;
    background: rgba(15, 23, 42, 0.85);
}

[data-theme="light"] .whats-new-close {
    background: rgba(241, 245, 249, 0.9);
    color: #334155;
}

.whats-new-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin-bottom: 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(125, 211, 252, 0.24);
}

.whats-new-title {
    margin: 0 36px 8px 0;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.25;
}

.whats-new-copy {
    margin: 0 0 16px 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-secondary, rgba(226, 232, 240, 0.75));
}

[data-theme="light"] .whats-new-copy {
    color: #475569;
}

.whats-new-list {
    list-style: none;
    margin: 0 0 18px 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.whats-new-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.whats-new-item-icon {
    flex: 0 0 auto;
    font-size: 1.05rem;
    line-height: 1.3;
}

.whats-new-item strong {
    font-weight: 700;
}

.whats-new-item span {
    color: var(--text-secondary, rgba(226, 232, 240, 0.7));
}

[data-theme="light"] .whats-new-item span {
    color: #64748b;
}

.whats-new-speed {
    margin: 0 0 16px 0;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    border-radius: 12px;
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(125, 211, 252, 0.2);
}

[data-theme="light"] .whats-new-speed {
    color: #0369a1;
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(2, 132, 199, 0.18);
}

.whats-new-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.whats-new-btn-primary {
    flex: 1 1 auto;
    min-width: 140px;
    padding: 11px 18px;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    color: #061018;
    cursor: pointer;
    background: linear-gradient(135deg, #7dd3fc, #818cf8);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.whats-new-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(129, 140, 248, 0.4);
}

.whats-new-btn-secondary {
    padding: 11px 16px;
    border-radius: 12px;
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-color, #e2e8f0);
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: transparent;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.whats-new-btn-secondary:hover {
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(125, 211, 252, 0.08);
}

[data-theme="light"] .whats-new-btn-secondary {
    color: #0f172a;
    border-color: rgba(2, 132, 199, 0.25);
}

/* Respect reduced-motion: no slide, just fade */
@media (prefers-reduced-motion: reduce) {
    .whats-new-popup {
        transform: none;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    .whats-new-popup.show {
        transform: none;
    }
}

/* Mobile: span the width near the bottom */
@media (max-width: 560px) {
    .whats-new-popup {
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom, 12px));
        width: auto;
        padding: 20px 18px 16px;
    }
}
