/* ============================================================================
   "What's new" — left-nav footer trigger + release-notes modal.

   Paired with app/Views/layout/_whats_new_modal.php, the footer trigger in
   app/Views/layout/app.php, and public/assets/js/whats-new.js. Fully tokenised
   (:root vars → automatic dark mode); the base .modal__dialog already has a
   dark override (style.css), so only our custom surfaces need explicit dark
   rules below. The dialog chrome + full-screen mobile come from `.modal--sheet`.
   ========================================================================== */

/* --- Sidebar footer trigger — a quiet text line (replaces the version line) --- */
.sb-whatsnew {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 0;
    background: none;
    color: var(--ink-4);
    font: inherit;
    font-size: 0.74rem;
    line-height: 1.2;
    cursor: pointer;
    text-align: left;
    transition: color 0.15s ease;
}

.sb-whatsnew:hover,
.sb-whatsnew:focus-visible {
    color: var(--ink-2);
    outline: none;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sb-whatsnew__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* --- Modal dialog --- */
.whats-new-modal__dialog {
    width: min(540px, calc(100vw - 32px));
    max-height: min(90vh, 760px);
}

.whats-new-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
}

.whats-new-modal__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Release tabs (own classes, :root tokens — no --ipi-* dependency) --- */
.whats-new-modal__tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 4px;
    background: var(--surface-inset);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
}

.whats-new-modal__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--ink-3);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.whats-new-modal__tab:hover {
    color: var(--ink);
}

.whats-new-modal__tab.is-active {
    background: var(--surface-card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.whats-new-modal__tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.whats-new-modal__tab-flag {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

/* --- Release panel --- */
.whats-new-modal__release-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.whats-new-modal__release-title {
    margin: 0;
    font-family: var(--font-display, "Space Grotesk", "Inter", sans-serif);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.whats-new-modal__release-date {
    font-size: 11.5px;
    color: var(--ink-4);
    white-space: nowrap;
}

.whats-new-modal__release-summary {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-3);
}

/* --- Hero — the release headline --- */
.whats-new-modal__hero {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 4px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    border: 1px solid rgba(196, 149, 16, 0.28);
}

.whats-new-modal__hero-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
}

.whats-new-modal__hero-icon .shell-icon {
    width: 19px;
    height: 19px;
}

.whats-new-modal__hero-copy {
    min-width: 0;
}

.whats-new-modal__hero-title {
    display: block;
    font-family: var(--font-display, "Space Grotesk", "Inter", sans-serif);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.whats-new-modal__hero-body {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-2);
}

/* --- Grouped sections --- */
.whats-new-modal__group {
    margin-top: 18px;
}

.whats-new-modal__group-label {
    margin: 0 0 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
}

/* --- Feature rows — icon tile + copy --- */
.whats-new-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.whats-new-modal__item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    transition: background-color 0.12s ease;
}

.whats-new-modal__item:hover {
    background: var(--surface-subtle);
}

.whats-new-modal__item-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-top: 1px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.whats-new-modal__item-icon .shell-icon {
    width: 16px;
    height: 16px;
}

.whats-new-modal__item-copy {
    min-width: 0;
}

.whats-new-modal__item-title {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.whats-new-modal__item-body {
    margin: 2px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--ink-3);
}

/* --- Dark mode (base dialog already darkens; token surfaces auto-adapt; only
       the tab inset/active surfaces need explicit dark values) --- */
html[data-theme="dark"] .whats-new-modal__tabs {
    background: rgba(2, 6, 23, 0.42);
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .whats-new-modal__tab.is-active {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .whats-new-modal__hero {
    background: rgba(196, 149, 16, 0.12);
    border-color: rgba(196, 149, 16, 0.30);
}

html[data-theme="dark"] .whats-new-modal__hero-body {
    color: rgba(241, 245, 249, 0.86);
}

html[data-theme="dark"] .whats-new-modal__item-icon {
    background: rgba(196, 149, 16, 0.16);
    color: #e3b008;
}
