/* ============================================================
   KavMonitor — EVA-01 Design System
   Part of the ViktorKav portal (viktorkav.com.br)
   ============================================================ */

/* ── Tokens ── */
:root {
    --bg-primary:           #09070F;
    --bg-secondary:         #0D0818;
    --bg-card:              rgba(109, 40, 217, 0.06);
    --purple-mid:           #8B3FFF;
    --purple-light:         #A78BFA;
    --purple-border:        rgba(139, 63, 255, 0.16);
    --purple-border-hover:  rgba(139, 63, 255, 0.40);
    --green:                #39FF14;
    --green-dim:            rgba(57, 255, 20, 0.06);
    --green-border:         rgba(57, 255, 20, 0.20);
    --text-primary:         #F4F7FB;
    --text-muted:           rgba(232, 234, 240, 0.82);
    --text-dim:             rgba(232, 234, 240, 0.50);
    --radius-card:          12px;
    --radius-btn:           7px;
    --bg-header:            rgba(9, 7, 15, 0.82);
    --bg-card-hover:        rgba(109, 40, 217, 0.10);
    --bg-card-subtle:       rgba(139, 63, 255, 0.05);
    --purple-border-open:   rgba(139, 63, 255, 0.35);
    --purple-border-thread: rgba(139, 63, 255, 0.08);
    --purple-hover-subtle:  rgba(139, 63, 255, 0.04);
    --purple-scroll:        rgba(139, 63, 255, 0.20);
    --purple-scroll-hover:  rgba(139, 63, 255, 0.35);
    --bg-thread-body:       rgba(9, 7, 15, 0.50);
    --purple-thread-dash:   rgba(139, 63, 255, 0.10);
    --green-dim-hover:      rgba(57, 255, 20, 0.12);
    --radius-item:          8px;
}

/* ── Light mode overrides ── */
html[data-theme="light"] {
    --bg-primary:          #F7F5FF;
    --bg-secondary:        #EFECFF;
    --bg-card:             #FFFFFF;
    --bg-card-hover:       #F3F0FF;
    --bg-header:           #EFECFF;
    --purple-mid:          #6D28D9;
    --purple-light:        #5B21B6;
    --purple-border:       rgba(109, 40, 217, 0.15);
    --purple-border-hover: rgba(109, 40, 217, 0.35);
    --text-primary:        #1A1228;
    --text-muted:          #3D3452;
    --text-dim:            rgba(61, 52, 82, 0.55);
    --green:               #5B21B6;
    --green-dim:           rgba(91, 33, 182, 0.08);
    --green-border:        rgba(91, 33, 182, 0.25);
    --green-dim-hover:     rgba(91, 33, 182, 0.14);
    --bg-thread-body:      rgba(239, 236, 255, 0.6);
    --bg-card-subtle:        rgba(109, 40, 217, 0.04);
    --purple-border-open:    rgba(109, 40, 217, 0.25);
    --purple-scroll:         rgba(109, 40, 217, 0.25);
    --purple-scroll-hover:   rgba(109, 40, 217, 0.45);
    --purple-thread-dash:    rgba(109, 40, 217, 0.20);
    --purple-border-thread:  rgba(109, 40, 217, 0.15);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--purple-scroll); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-scroll-hover); }

/* ── Header ── */
.site-header {
    background: var(--bg-header);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--purple-border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.brand {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.brand-prompt { color: var(--purple-mid); margin-right: 0.15em; }

.brand-cursor {
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: var(--purple-mid);
    margin-left: 2px;
    vertical-align: middle;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

.breadcrumb .back { color: rgba(139, 63, 255, 0.75); font-weight: 500; }
.breadcrumb .back:hover { color: var(--purple-light); }
.breadcrumb .sep { color: rgba(255, 255, 255, 0.2); }
.breadcrumb .current { color: var(--text-muted); font-weight: 700; }

.report-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--purple-border);
}

.meta-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    margin-right: 4px;
}

/* ── Main Layout ── */
.main-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* ── Section Headers ── */
.section { margin-bottom: 3rem; }

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
}

.section-icon  { color: var(--purple-mid); font-size: 0.85rem; font-weight: 700; }
.section-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); }
.section-line  { flex-grow: 1; height: 1px; background: var(--purple-border); }
.section-count { font-size: 0.72rem; color: var(--text-dim); }

/* ═══════════════════════════
   EDITOR'S PICKS
═══════════════════════════ */
.picks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.pick-card {
    background: var(--bg-card);
    border: 1px solid var(--purple-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.2s;
}

.pick-card:hover {
    border-color: var(--purple-border-hover);
    transform: translateY(-2px);
}

.pick-media {
    aspect-ratio: 16 / 9;
    background: var(--bg-secondary);
    overflow: hidden;
    position: relative;
}

.pick-media img,
.pick-media video,
.pick-media iframe { width: 100%; height: 100%; object-fit: cover; }

.pick-media.no-media {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.pick-media.no-media::after {
    content: "⟩_";
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    color: var(--text-dim);
    opacity: 0.3;
}

.pick-body {
    padding: 1rem 1.1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pick-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-sub,
.badge-tech   { background: rgba(139, 63, 255, 0.08); color: var(--purple-light); border: 1px solid var(--purple-border); }
.badge-score  { background: rgba(139, 63, 255, 0.05); color: var(--text-dim);     border: 1px solid var(--purple-border); }
.badge-gaming { background: var(--green-dim); color: var(--green); border: 1px solid var(--green-border); }

.pick-headline { font-size: 1rem; font-weight: 700; line-height: 1.4; color: var(--text-primary); text-align: justify; }
.pick-headline a { color: var(--text-primary); transition: color 0.2s; }
.pick-headline a:hover { color: var(--purple-light); }

.pick-summary { font-size: 0.85rem; color: var(--text-muted); line-height: 1.70; flex-grow: 1; text-align: justify; }

.pick-tags { display: flex; gap: 5px; flex-wrap: wrap; }

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--text-dim);
    background: rgba(139, 63, 255, 0.06);
    border: 1px solid var(--purple-border);
    padding: 1px 7px;
    border-radius: 3px;
}

.tag::before { content: '#'; color: var(--purple-mid); margin-right: 2px; opacity: 0.6; }

/* ═══════════════════════════
   TRENDING
═══════════════════════════ */
.trending-list { display: flex; flex-direction: column; gap: 3px; }

.trending-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--purple-border);
    border-radius: var(--radius-item);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.trending-item:hover {
    border-color: var(--purple-border-hover);
    background: var(--bg-card-hover);
}

.trending-rank {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-dim);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.trending-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--purple-light);
    font-size: 0.82rem;
    min-width: 50px;
    text-align: right;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.trending-score .arrow { color: var(--purple-light); font-size: 0.7rem; }

.trending-content { flex-grow: 1; min-width: 0; }

.trending-title {
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trending-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--text-dim);
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

.trending-cat { flex-shrink: 0; }

/* ═══════════════════════════
   RSS GRID
═══════════════════════════ */
.rss-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.rss-item {
    background: var(--bg-card);
    border: 1px solid var(--purple-border);
    border-radius: var(--radius-item);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}

.rss-item:hover { border-color: var(--purple-border-hover); }

.rss-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.rss-item-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.rss-source {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--purple-light);
    letter-spacing: 1px;
    display: block;
}

.rss-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); line-height: 1.45; text-align: justify; }
.rss-time  { font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; color: var(--text-dim); }

/* ═══════════════════════════
   FEED ACCORDIONS
═══════════════════════════ */
.feed-list { display: flex; flex-direction: column; gap: 6px; }

details.sub-group {
    background: var(--bg-card);
    border: 1px solid var(--purple-border);
    border-radius: var(--radius-item);
    overflow: hidden;
}

details.sub-group[open] { border-color: var(--purple-border-open); }

summary.sub-header {
    padding: 12px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    transition: background 0.2s;
    user-select: none;
}

summary.sub-header::-webkit-details-marker { display: none; }
summary.sub-header:hover { background: var(--bg-card-subtle); }

.sub-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-name-text { color: var(--purple-light); }

.sub-post-count {
    font-size: 0.68rem;
    color: var(--text-dim);
    background: rgba(139, 63, 255, 0.08);
    border: 1px solid var(--purple-border);
    padding: 1px 7px;
    border-radius: 99px;
}

.chevron { color: var(--text-dim); font-size: 0.7rem; transition: transform 0.3s; }

details[open] > summary .chevron { transform: rotate(180deg); color: var(--purple-mid); }

.sub-posts { border-top: 1px solid var(--purple-border); }

details.thread { border-bottom: 1px solid var(--purple-border-thread); }
details.thread:last-child { border-bottom: none; }

summary.thread-header {
    padding: 9px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    list-style: none;
    transition: background 0.2s;
}

summary.thread-header::-webkit-details-marker { display: none; }
summary.thread-header:hover { background: var(--purple-hover-subtle); }

.thread-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--purple-light);
    font-size: 0.78rem;
    min-width: 50px;
    text-align: right;
    flex-shrink: 0;
}

.thread-title { flex-grow: 1; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); min-width: 0; }

.thread-comments {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
    flex-shrink: 0;
}

.thread-expand { color: var(--text-dim); font-size: 0.65rem; transition: transform 0.3s; flex-shrink: 0; }

details.thread[open] > summary .thread-expand { transform: rotate(180deg); color: var(--purple-mid); }

.thread-body {
    padding: 16px 18px;
    background: var(--bg-thread-body);
    border-top: 1px dashed var(--purple-thread-dash);
}

.thread-media { margin-bottom: 14px; border-radius: var(--radius-item); overflow: hidden; }
.thread-media img,
.thread-media video { max-width: 100%; height: auto; border-radius: var(--radius-item); }

.thread-selftext { font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 14px; }
.thread-selftext a { color: var(--purple-light); }

.comment-box {
    background: rgba(139, 63, 255, 0.05);
    border-left: 3px solid var(--purple-mid);
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.comment-author {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-author .score { color: var(--purple-light); }

.comment-body { font-size: 0.85rem; color: var(--text-muted); font-style: italic; line-height: 1.6; }

.thread-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--green);
    text-decoration: none;
    border: 1px solid var(--green-border);
    border-radius: var(--radius-btn);
    padding: 6px 12px;
    background: var(--green-dim);
    transition: background 0.2s, border-color 0.2s;
    margin-top: 8px;
}

.thread-link:hover { background: var(--green-dim-hover); border-color: var(--green); }

/* External link badge */
.ext-link-badge {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.ext-icon   { font-size: 1.8rem; color: var(--text-dim); opacity: 0.3; }
.ext-domain { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--purple-light); }

/* YouTube embed */
.yt-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.yt-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.post-media { max-width: 100%; height: auto; }

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--purple-border);
    padding: 1.5rem 2rem;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 3rem;
}

.footer-links { display: flex; justify-content: center; gap: 14px; margin-bottom: 6px; }
.footer-links a { color: var(--text-dim); text-decoration: none; transition: color 0.18s; }
.footer-links a:hover { color: var(--green); }

/* ── Responsive ── */
@media (max-width: 900px) {
    .picks-grid     { grid-template-columns: 1fr; }
    .rss-grid       { grid-template-columns: 1fr; }
    .report-meta    { display: none; }
    .main-container { padding: 1.5rem 1rem; }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .rss-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Jump bar ── */
.jump-bar {
    background: var(--bg-header);
    border-bottom: 1px solid var(--purple-border);
    padding: 0 2rem;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 4px;
    position: sticky;
    top: 64px;
    z-index: 99;
}

.jump-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    border: 1px solid transparent;
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.jump-pill.active {
    background: rgba(139, 63, 255, 0.12);
    border-color: var(--purple-border-hover);
    color: var(--purple-light);
}

@media (max-width: 900px) {
    .jump-bar {
        padding: 0 1rem;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .jump-bar::-webkit-scrollbar { display: none; }
}

/* ── Theme toggle button ── */
.theme-toggle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 99px;
    border: 1px solid var(--purple-border);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: border-color 0.15s, color 0.15s;
    margin-left: auto;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--purple-border-hover);
    color: var(--purple-light);
}