/**
 * TheCoinsPost v2 — Global Shell (Header, Market Mood Bar, Pills Bar, Saved Drawer, PWA Sheet)
 */

/* Market Mood Bar (inside .site-header, never clips .site-header) */
.tcp-market-mood-bar {
    background: var(--surface-page);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
    line-height: 1.4;
}

.tcp-market-mood-track {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 7px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    white-space: nowrap;
}

.tcp-market-mood-track::-webkit-scrollbar {
    display: none;
}

.tcp-mood-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    flex-shrink: 0;
    scroll-snap-align: start;
}

.tcp-mood-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.tcp-mood-delta.is-up { color: var(--signal-positive); font-weight: 600; }
.tcp-mood-delta.is-down { color: var(--signal-negative); font-weight: 600; }

.tcp-mood-fng {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-chip);
    font-weight: 600;
    color: var(--text-primary);
}

/* Contextual Category Pills Bar */
.tcp-pills-bar {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--color-border);
}

.tcp-pills-track {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.tcp-pills-track::-webkit-scrollbar {
    display: none;
}

.tcp-pill-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface-chip);
    border: 1px solid transparent;
    text-decoration: none;
    flex-shrink: 0;
    min-height: 0;
    height: auto;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.tcp-pill-link:hover {
    color: var(--text-primary);
    border-color: var(--color-border);
}

.tcp-pill-link.is-active {
    background: var(--text-primary);
    color: var(--surface-raised);
    font-weight: 600;
}

/* Header Subscribe CTA */
.tcp-header-subscribe {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    background: var(--brand-primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.tcp-header-subscribe:hover {
    opacity: 0.9;
    color: #ffffff;
}

@media (max-width: 1023px) {
    .tcp-header-subscribe {
        display: none;
    }
}

/* Saved Bookmarks Drawer */
.tcp-saved-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 100vw);
    max-width: 100vw;
    background: var(--surface-raised);
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-raised);
    z-index: 1004;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.tcp-saved-drawer.is-open {
    transform: translateX(0);
}

.tcp-saved-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
}

.tcp-saved-drawer__list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.tcp-saved-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.tcp-saved-item a {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.tcp-saved-item small {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}

/* PWA Install Sheet (z-index: 900) */
.tcp-pwa-install-sheet {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--bottom-nav-h) + 12px);
    max-width: 420px;
    margin: 0 auto;
    background: var(--surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-raised);
    padding: 14px 16px;
    z-index: 900;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
}

.tcp-pwa-install-sheet.is-visible {
    display: flex;
}

@media (min-width: 769px) {
    .tcp-pwa-install-sheet {
        bottom: 20px;
        left: auto;
        right: 20px;
        margin: 0;
    }
}

/* Universal Subscribe Modal */
.tcp-subscribe-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    z-index: 1006;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.tcp-subscribe-modal.is-open {
    display: flex;
}

.tcp-subscribe-modal__dialog {
    position: relative;
    width: min(440px, 100%);
    background: var(--surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-raised);
    box-sizing: border-box;
}

.tcp-subscribe-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 22px;
}
