/**
 * Constanta One - Single Topic Page CSS
 * Dual Theme (dark/light) - CSS variables from shared.css
 */

html {
    overflow-x: hidden;
}
body {
    min-height: 100%;
    background: var(--bg-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* ===== READING PROGRESS INDICATOR ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    background: transparent;
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--cat-accent, var(--accent));
    transition: width 50ms linear;
    will-change: width;
    border-radius: 0 2px 2px 0;
}

/* Hero Parallax */
.topic-hero-bg {
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .reading-progress-bar {
        transition: none;
    }
    .topic-hero-bg {
        will-change: auto;
    }
}

/* Slide-in from right animation */
/* Keyframe moved to animations.css */

/* Ensure page is visible by default, animation enhances it */
.topic-page {
    opacity: 1;
    transform: none;
}

.topic-page.slide-in-right {
    animation: slideInFromRight var(--duration-normal) var(--ease-out) forwards;
}

/* Slide-out to right animation (swipe back) */
/* Keyframe moved to animations.css */

.topic-page.slide-out-right {
    animation: slideOutToRight var(--duration-normal) var(--ease-default) forwards;
}

/* ===== DESKTOP SIDEBAR ===== */
.desktop-sidebar {
    display: none;
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--nav-border);
    border-radius: 28px;
    z-index: 1001;
    flex-direction: column;
    padding: 14px;
    box-shadow: var(--shadow-medium);
}
@media (min-width: 1024px) {
    .desktop-sidebar { display: flex; }
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
}
.nav-item-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--nav-btn-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--duration-fast) var(--ease-default), transform var(--duration-fast) var(--ease-default);
}
.nav-item:hover .nav-item-btn { background: var(--nav-btn-hover); transform: scale(1.1); }
.nav-item.active .nav-item-btn { background: var(--nav-btn-hover); }
.nav-item svg { width: 22px; height: 22px; fill: currentColor; }
.nav-item span { color: var(--text-muted); }

/* ===== MOBILE BOTTOM BAR ===== */
.mobile-bottombar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--nav-border);
    z-index: 1100;
    padding: 12px 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    transform: translateZ(0);
}
@media (max-width: 1023px) {
    .mobile-bottombar {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}
.bottombar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0 12px;
    color: var(--text-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}
.bottombar-item.active { color: var(--text-primary); }
.bottombar-item svg { width: 24px; height: 24px; fill: currentColor; }
.bottombar-item span { font-size: 0.6rem; font-weight: 500; }

.topic-page {
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 12px;
    padding-top: calc(12px + var(--safe-top));
    padding-bottom: calc(12px + var(--safe-bottom));
    overflow: hidden;
}

@media (min-width: 480px) {
    .topic-page { padding: 20px; padding-top: calc(20px + var(--safe-top)); }
}

/* Padding pentru bara de jos pe mobil */
@media (max-width: 1023px) {
    .topic-page { padding-bottom: calc(100px + var(--safe-bottom)); }
}
@media (min-width: 1024px) {
    .topic-page { padding-bottom: calc(20px + var(--safe-bottom)); }
}

.comment-form-wrapper, .comments-section, .topic-sources, .topic-stats {
    width: 100%;
    max-width: 100%;
}

/* Branding - centrat pe toate device-urile */
.topic-branding {
    position: fixed;
    top: calc(12px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.brand-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

@media (min-width: 1024px) {
    .topic-branding { top: 20px; }
    .brand-link { font-size: 1.2rem; }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 16px;
    margin-top: 36px;
    transition: color 0.2s;
}
.back-link:hover { color: var(--text-primary); }
.back-link svg { width: 18px; height: 18px; fill: currentColor; }
.back-link.discover { color: var(--accent); animation: backPulse 2s ease-in-out 3; }
@keyframes backPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

@media (min-width: 1024px) {
    .back-link { margin-top: 0; }
}

/* ===== INACTIVE TOPIC BANNER ===== */
.topic-inactive-banner {
    background: var(--bg-secondary);
    border-left: 3px solid var(--text-muted);
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Hero card cu imagine blurata si text overlay */
.topic-hero {
    position: relative;
    width: 100%;
    min-height: 240px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    margin-top: 20px; /* Spatiu pentru logo pe mobile */
    background: var(--bg-secondary);
}

@media (min-width: 480px) {
    .topic-hero { aspect-ratio: 16/9; min-height: auto; }
}

@media (min-width: 1024px) {
    .topic-hero { margin-top: 50px; } /* Spatiu pentru logo pe desktop */
}

/* ===== NO IMAGE - SVG PATTERNS ===== */
/* Light theme patterns */
[data-theme="light"] .topic-hero.no-image { --pat-bg: #f0f4f8; }
[data-theme="light"] .topic-hero.no-image.score-level-1 { --pat-bg: #f0f4f8; }
[data-theme="light"] .topic-hero.no-image.score-level-2 { --pat-bg: #e8f5f5; }
[data-theme="light"] .topic-hero.no-image.score-level-3 { --pat-bg: #e8f0ff; }
[data-theme="light"] .topic-hero.no-image.score-level-4 { --pat-bg: #f0e8ff; }
[data-theme="light"] .topic-hero.no-image.score-level-5 { --pat-bg: #fff8e8; }
[data-theme="light"] .topic-hero.no-image.score-level-6 { --pat-bg: #ffe8e8; }

/* Dark theme patterns */
[data-theme="dark"] .topic-hero.no-image { --pat-bg: #1a1a1a; }
[data-theme="dark"] .topic-hero.no-image.score-level-1 { --pat-bg: #1a1a1a; }
[data-theme="dark"] .topic-hero.no-image.score-level-2 { --pat-bg: #1a2a2a; }
[data-theme="dark"] .topic-hero.no-image.score-level-3 { --pat-bg: #1a2030; }
[data-theme="dark"] .topic-hero.no-image.score-level-4 { --pat-bg: #251a30; }
[data-theme="dark"] .topic-hero.no-image.score-level-5 { --pat-bg: #2a2510; }
[data-theme="dark"] .topic-hero.no-image.score-level-6 { --pat-bg: #2a1515; }

/* Light theme category patterns */
[data-theme="light"] .topic-hero.no-image.cat-politica-interna { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0zM20 20h20v20H20z' fill='rgba(0,0,0,0.04)'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-politica-externa { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='56' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0-32l28-16M28 34V0M0 16l28 18M56 16L28 34' fill='none' stroke='rgba(0,0,0,0.04)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-externe { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 6h40' stroke='rgba(0,0,0,0.04)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-economie { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='32' height='32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 32V20h8v12zM12 32V12h8v20zM24 32V4h8v28z' fill='rgba(0,0,0,0.04)'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-justitie { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='36' height='36' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 2L2 34h32L18 2z' fill='none' stroke='rgba(0,0,0,0.04)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-sanatate { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='32' height='32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 0h8v12h12v8H20v12h-8V20H0v-8h12z' fill='rgba(0,0,0,0.04)'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-educatie { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10h40M0 0h40' stroke='rgba(0,0,0,0.04)' stroke-width='1'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-sport { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40L40 0' stroke='rgba(0,0,0,0.04)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-meteo { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='60' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='20' cy='20' r='12' fill='rgba(0,0,0,0.03)'/%3E%3Ccircle cx='35' cy='18' r='8' fill='rgba(0,0,0,0.03)'/%3E%3Ccircle cx='45' cy='22' r='10' fill='rgba(0,0,0,0.03)'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-accidente { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10l10-10 10 10 10-10 10 10' fill='none' stroke='rgba(0,0,0,0.04)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-societate { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='48' height='48' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='24' cy='24' r='8' fill='none' stroke='rgba(0,0,0,0.04)' stroke-width='2'/%3E%3Ccircle cx='24' cy='24' r='16' fill='none' stroke='rgba(0,0,0,0.03)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-tehnologie { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0v12M20 28v12M0 20h12M28 20h12' stroke='rgba(0,0,0,0.04)' stroke-width='2'/%3E%3Ccircle cx='20' cy='20' r='4' fill='rgba(0,0,0,0.04)'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-cultura { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10c10-10 30 10 40 0' fill='none' stroke='rgba(0,0,0,0.04)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-divertisment { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 2l4 12h12l-10 8 4 12-10-8-10 8 4-12-10-8h12z' fill='rgba(0,0,0,0.04)'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-moda { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='32' height='32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 0l16 16-16 16L0 16z' fill='none' stroke='rgba(0,0,0,0.04)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="light"] .topic-hero.no-image.cat-default { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='2' fill='rgba(0,0,0,0.04)'/%3E%3C/svg%3E"); }

/* Dark theme category patterns */
[data-theme="dark"] .topic-hero.no-image.cat-politica-interna { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0zM20 20h20v20H20z' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-politica-externa { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='56' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0-32l28-16M28 34V0M0 16l28 18M56 16L28 34' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-externe { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 6h40' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-economie { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='32' height='32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 32V20h8v12zM12 32V12h8v20zM24 32V4h8v28z' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-justitie { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='36' height='36' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 2L2 34h32L18 2z' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-sanatate { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='32' height='32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 0h8v12h12v8H20v12h-8V20H0v-8h12z' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-educatie { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10h40M0 0h40' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-sport { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40L40 0' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-meteo { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='60' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='20' cy='20' r='12' fill='rgba(255,255,255,0.04)'/%3E%3Ccircle cx='35' cy='18' r='8' fill='rgba(255,255,255,0.04)'/%3E%3Ccircle cx='45' cy='22' r='10' fill='rgba(255,255,255,0.04)'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-accidente { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10l10-10 10 10 10-10 10 10' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-societate { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='48' height='48' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='24' cy='24' r='8' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3Ccircle cx='24' cy='24' r='16' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-tehnologie { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0v12M20 28v12M0 20h12M28 20h12' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3Ccircle cx='20' cy='20' r='4' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-cultura { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10c10-10 30 10 40 0' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-divertisment { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 2l4 12h12l-10 8 4 12-10-8-10 8 4-12-10-8h12z' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-moda { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='32' height='32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 0l16 16-16 16L0 16z' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='2'/%3E%3C/svg%3E"); }
[data-theme="dark"] .topic-hero.no-image.cat-default { background: var(--pat-bg) url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='2' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E"); }

.topic-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topic-hero-overlay {
    position: relative;
    min-height: 240px;
    background: rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 16px 16px;
}

@media (min-width: 480px) {
    .topic-hero-overlay {
        position: absolute;
        inset: 0;
        min-height: auto;
        padding: 28px;
    }
}

.topic-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.topic-meta .meta-badge {
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin: 0 5px;
    flex-shrink: 0;
}

@media (min-width: 480px) {
    .topic-meta .meta-badge { padding: 6px 12px; font-size: 0.75rem; margin: 0 6px; }
}

/* Download button in meta (mobile) */
.meta-download-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}
.meta-download-count {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.meta-download-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color var(--duration-fast) var(--ease-default), transform var(--duration-fast) var(--ease-default), opacity var(--duration-fast) var(--ease-default);
}
[data-theme="dark"] .meta-download-btn { background: rgba(255,255,255,0.15); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
[data-theme="light"] .meta-download-btn { background: rgba(255,255,255,0.95); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.meta-download-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--text-muted); }
.meta-download-btn svg circle:last-child { fill: var(--text-muted); stroke: none; }
.meta-download-btn:active { transform: scale(0.95); }
.meta-download-btn.loading { opacity: 0.6; pointer-events: none; }
.meta-download-btn.downloaded svg,
.meta-download-btn.downloaded svg rect,
.meta-download-btn.downloaded svg circle { stroke: #e53935; }
.meta-download-btn.downloaded svg circle:last-child { fill: #e53935; stroke: none; }

@media (min-width: 1024px) {
    /* Pe desktop ascundem butonul din meta, avem sidebar */
    .meta-download-wrapper { display: none; }
}

/* Score-based colors - pentru TEXT, nu fundal */
.score-2 { --score-color: var(--text-muted); }
.score-3 { --score-color: var(--text-secondary); }
.score-4 { --score-color: var(--accent); }
.score-5 { --score-color: #dc2626; }

/* Badges pe hero - category accent system */
.tt-cat-badge {
    font-weight: 700;
    background: var(--cat-accent, var(--accent));
    color: #fff;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.scope-badge {
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
[data-theme="dark"] .scope-badge { background: rgba(255,255,255,0.15); color: #e0e0e0; border: 1px solid rgba(255,255,255,0.1); }
[data-theme="light"] .scope-badge { background: rgba(255,255,255,0.95); color: #333; border: 1px solid rgba(0,0,0,0.1); }

.score-badge {
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
[data-theme="dark"] .score-badge { background: rgba(255,255,255,0.15); color: #e0e0e0; border: 1px solid rgba(255,255,255,0.1); }
[data-theme="light"] .score-badge { background: rgba(255,255,255,0.95); color: #333; border: 1px solid rgba(0,0,0,0.1); }

.topic-title {
    font-size: clamp(1rem, 5vw, 1.6rem);
    font-weight: 700;
    line-height: 1.45;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
    letter-spacing: -0.01em;
}

@media (min-width: 1024px) {
    .topic-title { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
}

.topic-stats {
    display: flex;
    justify-content: space-evenly;
    gap: 4px;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

@media (min-width: 1024px) {
    .topic-stats { display: none; }
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 4px 0;
    min-width: 48px;
    border-radius: 12px;
    background: none;
    cursor: pointer;
    transition: background-color var(--duration-fast) var(--ease-default), color var(--duration-fast) var(--ease-default);
}
.stat-item svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.stat-item strong { color: var(--text-muted); font-weight: 600; font-size: 0.7rem; }
.stat-item:hover { background: var(--bg-tertiary); }

.stat-item.liked { color: var(--accent); }
.stat-item.liked svg { fill: var(--accent); }
.stat-item.liked strong { color: var(--accent) !important; }

.stat-item.saved svg { fill: #f59e0b !important; }

a.stat-item { text-decoration: none; color: var(--text-muted); }

/* Snap/download button in stats bar */
.stat-item.download-btn svg { fill: none; stroke: currentColor; }
.stat-item.download-btn svg circle:last-child { fill: currentColor; stroke: none; }
.stat-item.download-btn.downloaded svg,
.stat-item.download-btn.downloaded svg rect,
.stat-item.download-btn.downloaded svg circle { stroke: #e53935; }
.stat-item.download-btn.downloaded svg circle:last-child { fill: #e53935; stroke: none; }
.stat-item.download-btn.loading { opacity: 0.6; pointer-events: none; }

/* Pulse attention on snap button — stops when downloaded */
.stat-item.download-btn:not(.downloaded):not(.loading) {
    animation: snapPulse 2.5s ease-in-out infinite;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0);
}

.stat-item.download-btn:not(.downloaded):not(.loading) svg {
    animation: snapIconPop 2.5s ease-in-out infinite;
}

@keyframes snapPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
    50% { box-shadow: 0 0 10px rgba(34, 197, 94, 0.3); }
}

@keyframes snapIconPop {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .stat-item.download-btn:not(.downloaded):not(.loading),
    .stat-item.download-btn:not(.downloaded):not(.loading) svg { animation: none; }
}

/* Modal Surse */
.sources-modal {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.sources-modal.open { display: flex; }

.sources-modal-content {
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    background: var(--card-bg);
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: bottomSheetIn var(--duration-normal) var(--ease-spring);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
}

/* Keyframe moved to animations.css */

.sources-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-category {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.modal-scope {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.sources-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sources-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 20px;
}

.sources-modal-footer {
    display: flex;
    justify-content: space-around;
    padding: 16px 20px;
    padding-bottom: calc(16px + 60px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.modal-stat {
    text-align: center;
}

.modal-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
}

.article-item {
    padding: 14px 12px;
    margin: 0 -12px;
    border-radius: 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}
.article-item:hover { background: var(--bg-secondary); }
.article-item:last-child { border-bottom: none; }

.article-source {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-engagement {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.7rem;
}

.article-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== ACTION SIDEBAR (desktop only) ===== */
.action-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .action-sidebar {
        display: flex;
        position: fixed;
        top: 50%;
        right: 20px;
        transform: translateY(-50%);
        flex-direction: column;
        gap: 8px;
        padding: 14px;
        border-radius: 28px;
        border: 1px solid var(--nav-border);
        background: var(--nav-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1000;
        box-shadow: var(--shadow-medium);
    }
}

@media (min-width: 1200px) {
    .action-sidebar { right: calc((100vw - 680px) / 2 - 90px); }
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.action-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--nav-btn-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--duration-fast) var(--ease-default), transform var(--duration-fast) var(--ease-default);
}

.action-btn svg { width: 22px; height: 22px; fill: var(--text-muted); transition: fill 0.2s; }
.action-btn:hover { background: var(--nav-btn-hover); transform: scale(1.1); }
.action-btn:active { transform: scale(0.95); }
.action-btn.liked svg { fill: var(--accent); }
.action-btn.saved svg,
.save-btn.saved svg,
#saveBtn.saved svg,
#sidebarSaveBtn.saved svg { fill: #f59e0b !important; }

/* Download button - camera icon with stroke */
.action-btn.download-btn svg { fill: none; stroke: var(--text-muted); }
.action-btn.download-btn svg circle:last-child { fill: var(--text-muted); stroke: none; }
.action-btn.download-btn.downloaded svg,
.action-btn.download-btn.downloaded svg rect,
.action-btn.download-btn.downloaded svg circle { stroke: #e53935; }
.action-btn.download-btn.downloaded svg circle:last-child { fill: #e53935; stroke: none; }
.action-btn.loading { opacity: 0.6; pointer-events: none; }

.action-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== TOPIC TABS (Comentarii / Surse) ===== */
.topic-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
}

.topic-tab {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.topic-tab:hover {
    color: var(--text-secondary);
}

.topic-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content.tab-hidden {
    display: none;
}

/* ===== SOURCES INLINE (tab layout, similar to profile history) ===== */
.tab-sources-list {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.tab-source-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.tab-source-item:last-child {
    border-bottom: none;
}

[data-theme="dark"] .tab-source-item:hover {
    background: rgba(255, 255, 255, 0.02);
    margin: 0 -12px;
    padding: 14px 12px;
}
[data-theme="light"] .tab-source-item:hover {
    background: rgba(0, 0, 0, 0.02);
    margin: 0 -12px;
    padding: 14px 12px;
}

.tab-source-thumb {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.tab-source-thumb-favicon {
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .tab-source-thumb-favicon { background: rgba(255, 255, 255, 0.08); }
[data-theme="light"] .tab-source-thumb-favicon { background: rgba(0, 0, 0, 0.06); }

.tab-source-favicon {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: contain;
    padding: 6px;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .tab-source-thumb {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }
}

.tab-source-info {
    flex: 1;
    min-width: 0;
}

.tab-source-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tab-source-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.tab-source-name {
    color: var(--accent);
    font-weight: 500;
}

.tab-source-name::after {
    content: "\2022";
    margin-left: 8px;
    color: var(--text-muted);
}

.tab-source-local {
    color: var(--accent);
    font-weight: 600;
}

.tab-sources-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tab-sources-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--text-muted);
}

.tab-sources-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Comments Section */
.comments-section {
    margin-top: 16px;
}

.comments-header {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.comment-form-wrapper {
    margin-bottom: 24px;
}

.comment-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--input-bg);
    border-radius: 22px;
    padding: 4px 4px 4px 12px;
    width: 100%;
    box-sizing: border-box;
}

.comment-input-wrapper input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    padding: 10px 0;
}
.comment-input-wrapper input:focus { outline: none; }
.comment-input-wrapper input::placeholder { color: var(--input-placeholder); }

.comment-submit {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.comment-submit svg { width: 20px; height: 20px; fill: var(--text-muted); transition: fill 0.2s; }
.comment-submit:not(:disabled) svg { fill: var(--accent); }
.comment-submit:disabled { cursor: default; }

.comment-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 8px;
    padding-left: 16px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

/* Initials avatar */
.comment-avatar-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}

.comment-avatar-initials.small {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.comment-body { flex: 1; }
.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.comment-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
    margin-left: 8px;
}
.comment-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.no-comments {
    color: var(--text-muted);
    text-align: center;
    padding: 40px 0;
}

/* ===== AUTHENTICATED COMMENT FORM ===== */
.comment-form-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.comment-form-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
}

.comment-form-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Login prompt for guests */
.comment-login-prompt {
    background: var(--bg-secondary);
    border: none;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.comment-login-prompt p {
    color: var(--text-muted);
    margin: 0 0 16px 0;
    font-size: 0.95rem;
}

.comment-login-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 24px;
    border: none;
    background: var(--accent, #fe2c55);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.comment-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.3);
}

/* Reply context indicator */
.reply-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--info-bg);
    border-left: 3px solid var(--accent);
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.reply-context strong {
    color: var(--text-primary);
}

.cancel-reply {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.cancel-reply:hover {
    color: var(--accent);
}

/* Reply button on comments */
.comment-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
}

.comment-reply-btn:hover {
    color: var(--accent);
}

.comment-reply-btn svg {
    fill: currentColor;
}

/* ===== COMMENT REACTIONS ===== */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.comment-reactions {
    display: flex;
    gap: 8px;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s, background 0.2s;
    -webkit-user-select: none;
    user-select: none;
}

.reaction-btn .reaction-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 0;
}

.reaction-btn .reaction-count:empty {
    display: none;
}

.reaction-btn:hover {
    border-color: var(--text-muted);
    background: var(--bg-secondary);
}

.reaction-btn.active {
    border-color: var(--accent);
    background: rgba(254, 44, 85, 0.1);
}

.reaction-btn.active .reaction-count {
    color: var(--accent);
    font-weight: 600;
}

.reaction-btn.reaction-pop {
    animation: reactionPop 0.3s var(--ease-out);
}

@keyframes reactionPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .reaction-btn.reaction-pop {
        animation: none;
    }
}

/* ===== COMMENT THREADING ===== */
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-replies {
    margin-top: 12px;
    margin-left: 20px;
    padding-left: 16px;
    border-left: 2px solid var(--border-color);
}

.comment-item.reply {
    padding: 12px 0;
}

.comment-item.reply:first-child {
    padding-top: 0;
}

.comment-item.reply .comment-avatar {
    width: 32px;
    height: 32px;
}

.comment-item.reply .comment-author {
    font-size: 0.85rem;
}

.comment-item.reply .comment-text {
    font-size: 0.9rem;
}

/* ===== BRANDING (above hero) ===== */
.desktop-branding {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
}

@media (min-width: 1024px) {
    .desktop-branding { display: block; }
}

.desktop-branding a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
}

.desktop-branding .desktop-logo {
    height: 50px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

/* Mobile header (above hero) */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(60px + var(--safe-top));
    padding-top: calc(10px + var(--safe-top));
    z-index: 200;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
}
[data-theme="dark"] .mobile-header { background: linear-gradient(180deg, rgba(10,10,10,0.9) 0%, transparent 100%); }
[data-theme="light"] .mobile-header { background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, transparent 100%); }

@media (max-width: 1023px) {
    .mobile-header { display: flex; }
}

.mobile-header img,
.mobile-header .mobile-logo {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.mobile-header a {
    display: flex;
    align-items: center;
    text-decoration: none;
    pointer-events: auto;
}

.mobile-site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}
