/* ============================================
   Snowbird Weekly — WrightForge Lab
   Mobile-first dashboard stylesheet
   ============================================ */

:root {
    --bg-primary: #050508;
    --bg-secondary: #0a0a0f;
    --bg-card: #0c0c12;
    --accent-green: #00ff88;
    --accent-amber: #ffb800;
    --accent-cyan: #00d4ff;
    --accent-red: #ff4444;
    --accent-coral: #ff8c66;
    --text-primary: #e0e0e0;
    --text-secondary: #888888;
    --text-muted: #555555;
    --text-bright: #ffffff;
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(0, 255, 136, 0.3);
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --glow-green: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* ---- Reset & Base ---- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    padding-top: 56px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-mono);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overscroll-behavior: none;
}

a {
    -webkit-tap-highlight-color: transparent;
}

button {
    -webkit-tap-highlight-color: transparent;
}

/* ---- Fixed Header ---- */

.dashboard-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(5, 5, 8, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.back-link {
    color: var(--accent-green);
    text-decoration: none;
    font-size: 13px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.back-link:hover {
    text-shadow: var(--glow-green);
}

.header-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 15px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.header-date {
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* ---- Chip Scroll Containers ---- */

.chip-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
    scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar {
    display: none;
}

/* Week chips (JS-generated) — base styles for .week-chip class */
.week-chip,
.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.week-chip:hover,
.filter-chip:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Active week chip — green accent */
.week-chip.active {
    border-color: var(--accent-green);
    background: rgba(0, 255, 136, 0.08);
    color: var(--accent-green);
}

/* Week chip item count */
.week-chip-count {
    color: var(--text-muted);
    font-size: 10px;
    margin-left: 2px;
}

.week-chip.active .week-chip-count {
    color: rgba(0, 255, 136, 0.6);
}

/* Active region chip — cyan accent */
.filter-chip.active {
    border-color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-cyan);
}

/* ---- Exchange Rates Bar ---- */

.rates-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-secondary);
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-family: var(--font-mono);
    scrollbar-width: none;
}

.rates-bar::-webkit-scrollbar {
    display: none;
}

.rates-label {
    color: var(--text-muted);
    white-space: nowrap;
}

.rate-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.rate-item + .rate-item {
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.rate-code {
    color: var(--accent-amber);
}

.rate-value {
    color: var(--text-primary);
}

/* ---- Category Sections ---- */

.category-section {
    padding: 0;
}

.section-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.section-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.section-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.section-icon {
    flex-shrink: 0;
}

/* Category-specific icon colors */
[data-category="travel"] .section-icon {
    color: var(--accent-green);
}

[data-category="destinations"] .section-icon {
    color: var(--accent-cyan);
}

[data-category="costs"] .section-icon {
    color: var(--accent-amber);
}

[data-category="lifestyle"] .section-icon {
    color: var(--accent-coral);
}

/* Left accent border on expanded sections */
.category-section:not(.collapsed) .section-header {
    border-left: 2px solid currentColor;
}

[data-category="travel"]:not(.collapsed) .section-header { border-left-color: var(--accent-green); }
[data-category="destinations"]:not(.collapsed) .section-header { border-left-color: var(--accent-cyan); }
[data-category="costs"]:not(.collapsed) .section-header { border-left-color: var(--accent-amber); }
[data-category="lifestyle"]:not(.collapsed) .section-header { border-left-color: var(--accent-coral); }

.section-title h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
    font-family: var(--font-mono);
}

/* Item count badges — category-specific colors */
.item-count {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: var(--font-mono);
}

[data-category="travel"] .item-count {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-green);
}

[data-category="destinations"] .item-count {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
}

[data-category="costs"] .item-count {
    background: rgba(255, 184, 0, 0.15);
    color: var(--accent-amber);
}

[data-category="lifestyle"] .item-count {
    background: rgba(255, 140, 102, 0.15);
    color: var(--accent-coral);
}

/* Collapse arrow */
.collapse-arrow {
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.category-section.collapsed .collapse-arrow {
    transform: rotate(-90deg);
}

.category-section.collapsed .section-content {
    max-height: 0;
    opacity: 0;
}

/* ---- Content Cards ---- */

.section-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 1;
}

.content-card {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    animation: fadeInUp 0.3s ease forwards;
}

.content-card:hover {
    background: rgba(255, 255, 255, 0.02);
}

.content-card:nth-child(2) { animation-delay: 0.05s; }
.content-card:nth-child(3) { animation-delay: 0.1s; }
.content-card:nth-child(4) { animation-delay: 0.15s; }
.content-card:nth-child(5) { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card:last-child {
    border-bottom: none;
}

.card-title {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.card-title:hover {
    color: var(--accent-green);
}

.card-summary {
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 10px 0;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Source & region tags */
.tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: var(--font-mono);
    border: 1px solid;
    white-space: nowrap;
}

.source-news {
    border-color: rgba(0, 255, 136, 0.4);
    color: var(--accent-green);
}

.source-reddit {
    border-color: rgba(255, 102, 51, 0.4);
    color: #ff6633;
}

.source-blog {
    border-color: rgba(0, 212, 255, 0.4);
    color: var(--accent-cyan);
}

.source-api {
    border-color: rgba(255, 184, 0, 0.4);
    color: var(--accent-amber);
}

.region-tag {
    border-color: var(--border);
    color: var(--text-muted);
}

.card-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* ---- Loading Skeleton ---- */

.loading-state {
    padding: 16px;
}

.skeleton-card {
    height: 80px;
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.04) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Highlights Section ---- */

.highlights-section {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.03) 0%, transparent 100%);
}

.highlights-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.highlights-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-green);
    font-weight: 500;
    margin: 0;
    font-family: var(--font-mono);
}

.highlights-icon {
    color: var(--accent-green);
    display: flex;
    align-items: center;
}

.highlights-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.highlight-item {
    display: block;
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.5;
    padding: 8px 12px;
    border-left: 2px solid var(--accent-green);
    background: rgba(0, 255, 136, 0.02);
    transition: background 0.15s ease, border-color 0.15s ease;
}

a.highlight-item:hover {
    background: rgba(0, 255, 136, 0.06);
    border-left-color: var(--text-primary);
}

/* ---- External Link Icon ---- */

.external-icon {
    opacity: 0.3;
    margin-left: 4px;
    vertical-align: middle;
    transition: opacity 0.15s;
}

.card-title:hover .external-icon {
    opacity: 0.7;
}

/* ---- Empty State ---- */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.empty-state .empty-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

/* ---- Footer ---- */

.dashboard-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 20px 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.footer-prompt {
    color: var(--accent-green);
}

.footer-sep {
    color: var(--text-muted);
}

.dashboard-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.dashboard-footer a:hover {
    color: var(--accent-green);
}

/* ============================================
   Responsive — Tablet
   ============================================ */

@media (max-width: 768px) {
    .section-header {
        padding: 12px 16px;
    }

    .content-card {
        padding: 14px 16px;
    }

    .section-title h2 {
        font-size: 11px;
    }
}

/* ============================================
   Responsive — Small Phone
   ============================================ */

@media (max-width: 480px) {
    .header-date {
        display: none;
    }

    .week-chip,
    .filter-chip {
        padding: 6px 12px;
        font-size: 11px;
    }

    .card-title {
        font-size: 14px;
    }

    .dashboard-footer {
        font-size: 11px;
    }

    .highlights-section {
        padding: 12px;
    }

    .highlight-item {
        font-size: 12px;
        padding: 6px 10px;
    }
}
