/* ============================================
   BURSUKOV.COM - Compact Modern Design
   Inspired by servbg.com - Dense, Rounded, Clean
   100% Local - No External Dependencies
   ============================================ */

/* CSS Variables */
:root {
    /* System Font Stack */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    
    /* Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #dbeafe;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --link: #2563eb;
    --tag-negative: #ef4444;
    --tag-positive: #10b981;
    --tag-neutral: #64748b;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-strong: #475569;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.15);
    --link: #60a5fa;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base - Full viewport layout */
html {
    font-size: 14px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    padding-bottom: 140px; /* Space for sticky footer */
}

/* Footer always at bottom */

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* Typography - Smaller & Rounded */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.35rem;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }

/* Layout - Fluid for large screens */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header - Compact */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-strong);
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.logo {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.logo:hover {
    color: var(--accent);
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-strong);
    white-space: nowrap;
    display: inline;
}

@media (max-width: 768px) {
    .tagline { display: none; }
}

.nav {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: nowrap;
}

.nav a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: background-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.nav a:hover, .nav a.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Theme Toggle - Icon button */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.45rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, border-color 0.15s;
}

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

.theme-toggle svg {
    display: block;
}

/* Show sun in dark mode, moon in light mode */
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Language Selector */
.language-selector {
    position: relative;
}

.language-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.15s;
}

.language-toggle:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.language-toggle .lang-flag {
    font-size: 1rem;
    line-height: 1;
}

.language-toggle .lang-code {
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.language-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown::-webkit-scrollbar {
    width: 6px;
}

.language-dropdown::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.language-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s;
    border-bottom: 1px solid var(--border);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.language-option.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.language-option .lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

.language-option .lang-name {
    flex: 1;
}

/* Mobile language selector */
@media (max-width: 768px) {
    .language-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 60vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }
    
    .language-dropdown.open {
        transform: translateY(0);
    }
    
    .language-option {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }
}

/* Main Content - Fills available space */
.main {
    padding: 1.25rem 0;
    flex: 1 0 auto;
}

.main > .container {
    /* Removed height: 100% to prevent footer issues */
}

/* Publication Cards - Responsive Grid */
.publications-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--border-strong);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Two columns starting from 1100px */
@media (min-width: 1100px) {
    .publications-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.publication-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    transition: background-color 0.15s;
}

.publication-card:hover {
    background: var(--bg-secondary);
}

.publication-card .thumbnail {
    width: 160px;
    height: 110px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    display: block;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.publication-card .thumbnail:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow);
}

.publication-card .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.publication-card .thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-weight: 600;
}

.publication-card .content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.publication-card .meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.publication-card .meta .separator {
    color: var(--border-strong);
}

.publication-card .title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.publication-card .title a {
    color: var(--text-primary);
}

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

.publication-card .tags {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.publication-card .excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Show full short excerpts without truncation */
.publication-card .excerpt.short {
    display: block;
    -webkit-line-clamp: unset;
}

/* Tags - Rounded Pills */
.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.6rem;
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-radius: var(--radius-sm);
}

.tag-negative {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.tag-positive {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.tag-neutral {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

[data-theme="dark"] .tag-negative {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .tag-positive {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] .tag-neutral {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

/* Single Publication Page */
.publication-full {
    max-width: 900px;
    margin: 0 auto;
}

.publication-header {
    margin-bottom: 1.5rem;
}

.publication-header .meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.publication-header .title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.publication-header .tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Social Share Buttons */
.social-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.share-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.15s ease;
    cursor: pointer;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.share-facebook:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.share-twitter:hover { background: #000; color: #fff; border-color: #000; }
.share-linkedin:hover { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.share-telegram:hover { background: #0088cc; color: #fff; border-color: #0088cc; }
.share-copy:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.share-copy.copied { background: #22c55e; color: #fff; border-color: #22c55e; }

.bookmark-btn { margin-left: 0.5rem; }
.bookmark-btn:hover { background: #fbbf24; color: #fff; border-color: #fbbf24; }
.bookmark-btn.bookmarked { background: #fbbf24; color: #fff; border-color: #fbbf24; }

/* Related Publications */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.related-card {
    display: block;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.related-thumbnail {
    height: 120px;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-card:hover .related-thumbnail img {
    transform: scale(1.05);
}

.related-thumbnail .thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.related-content {
    padding: 0.875rem;
}

.related-meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.35rem;
}

.related-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
}

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

@media (max-width: 600px) {
    .social-share {
        flex-wrap: wrap;
    }
    
    .share-label {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .related-thumbnail {
        height: 90px;
    }
}

/* Section Cards */
.section {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
}

.section-header {
    padding: 0.65rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-strong);
    font-size: 0.65rem;
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Translate button */
.translate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.15s;
}

.translate-btn:hover {
    background: #4285f4;
    border-color: #4285f4;
    color: #fff;
}

.translate-btn svg {
    flex-shrink: 0;
}

.section-content {
    padding: 1rem;
}

/* Source embed */
.source-embed {
    margin-bottom: 0.75rem;
}

.source-embed iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: var(--radius);
}

.source-embed .quote-box {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1rem;
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.9rem;
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.35rem 0;
    font-weight: 600;
}

.source-link:hover {
    color: var(--link);
}

.source-link::after {
    content: '\2197';
    font-size: 0.7rem;
}

/* Observations */
.observations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.observation-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.65rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.observation-item .timestamp {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.2rem 0.4rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    font-weight: 600;
}

.observation-item .text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.observation-item .tag {
    flex-shrink: 0;
}

/* Verifications */
.verifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.verification-item {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0.65rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.verification-item .verifier {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.verification-item .verifier-type {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.verification-item .comment {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.verification-item .link {
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

/* Attachments */
.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: background-color 0.15s;
}

.attachment-item:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* Editorial Comment */
.editorial-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.editorial-content p {
    margin-bottom: 0.85rem;
}

/* Comments Section */
.comments-section {
    max-width: 780px;
    margin: 0 auto;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.comment-item {
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}

.comment-item .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.comment-item .author {
    font-weight: 700;
    font-size: 0.8rem;
}

.comment-item .date {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.comment-item .text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Forms - Rounded */
.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* Buttons - Pill Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

/* Registration button - calm dark color */
.btn-register {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

.btn-register:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

.btn-danger:hover {
    background: var(--error);
    color: #fff;
}

/* Alerts */
.alert {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* Footer - Always visible at bottom */
/* Sticky Footer - Always visible at bottom of viewport */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-strong);
    padding: 1rem 0 0.75rem;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* Newsletter Section - Compact for sticky footer */
.newsletter-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.newsletter-content {
    flex: 1;
}

.newsletter-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary);
}

.newsletter-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
}

.newsletter-form input[type="email"] {
    padding: 0.625rem 1rem;
    min-width: 250px;
    font-size: 0.875rem;
}

.newsletter-form button {
    white-space: nowrap;
}

.newsletter-message {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.newsletter-message.success {
    color: #22c55e;
}

.newsletter-message.error {
    color: #ef4444;
}

@media (max-width: 768px) {
    .newsletter-section {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        width: 100%;
        flex-direction: column;
    }
    
    .newsletter-form input[type="email"] {
        min-width: auto;
        width: 100%;
    }
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand {
    font-weight: 700;
    color: var(--text-secondary);
}

.footer-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.stat-sep {
    color: var(--border-strong);
}

.stat-item {
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Pagination - Rounded */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.2rem;
    margin-top: 1.25rem;
}

.pagination a, .pagination span {
    padding: 0.4rem 0.7rem;
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius);
    color: var(--text-secondary);
}

.pagination a {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    transition: background-color 0.15s, border-color 0.15s;
}

.pagination a:hover, .pagination .active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pagination .dots {
    padding: 0.4rem 0.5rem;
    color: var(--text-muted);
}

/* Sidebar - Compact */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 1.5rem;
    align-items: start;
}

/* Three-column layout with left sidebar - Fill available space */
.content-grid.with-left-sidebar {
    grid-template-columns: 280px minmax(0, 1fr) 280px;
    gap: 1rem;
    min-width: 0;
    align-items: start;
}

/* Left sidebar (Telegram feeds) - Flexible width */
.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    top: 70px;
    align-self: start;
    max-height: calc(100vh - 220px); /* viewport minus header(70) and footer(140) + buffer */
    overflow-y: auto;
}

.left-sidebar::-webkit-scrollbar {
    width: 4px;
}

.left-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.left-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 2px;
}

.telegram-feeds {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.telegram-feeds .header {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border-strong);
    font-size: 0.65rem;
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.telegram-feeds .header svg {
    width: 14px;
    height: 14px;
    color: #0088cc;
}

/* New Telegram feeds container with embedded content */
.telegram-feeds-container {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Aggregated Telegram Feed Widget - Full height scrollable */
.telegram-feed-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 240px); /* Use available space */
    min-height: 400px;
}

/* Scroll navigation arrows - Compact */
.telegram-feed-nav {
    display: flex;
    justify-content: center;
    padding: 0.15rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
}

.telegram-feed-nav-top {
    border-top: none;
    border-bottom: 1px solid var(--border);
}

.telegram-scroll-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.7rem;
}

.telegram-scroll-btn::before {
    content: '▲';
}

.telegram-feed-nav:not(.telegram-feed-nav-top) .telegram-scroll-btn::before {
    content: '▼';
}

.telegram-scroll-btn:hover {
    color: var(--accent);
}

.telegram-scroll-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.telegram-scroll-btn svg {
    display: none;
}

.telegram-feed-header {
    padding: 0.65rem 0.85rem;
    font-size: 0.7rem;
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-bottom: 2px solid #0088cc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.telegram-feed-header svg {
    color: #0088cc;
}

.telegram-feed-live {
    margin-left: auto;
    font-size: 0.6rem;
    color: #22c55e;
    animation: pulse 2s infinite;
}

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

.telegram-feed-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scroll-behavior: smooth;
}

.telegram-feed-list::-webkit-scrollbar {
    width: 6px;
}

.telegram-feed-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.telegram-feed-list::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

.telegram-feed-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.telegram-feed-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.telegram-feed-notice {
    padding: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* Telegram iframe embed tabs */
.tg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0.4rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.tg-tab {
    flex: 1;
    min-width: 50px;
    padding: 0.35rem 0.3rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    white-space: nowrap;
}

.tg-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tg-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.tg-iframe-wrap {
    flex: 1;
    overflow: hidden;
    min-height: 300px;
}

.tg-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
    background: #fff;
}

[data-theme="dark"] .tg-iframe-wrap iframe {
    filter: invert(0.9) hue-rotate(180deg);
}

/* Individual feed item */
.telegram-feed-item {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 0.6rem;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    text-decoration: none;
    display: block;
}

.telegram-feed-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(2px);
}

.telegram-feed-item.active {
    border-left-color: #0088cc;
    background: var(--accent-light);
}

a.telegram-channel-link {
    color: inherit;
}

a.telegram-channel-link:hover {
    color: inherit;
}

.telegram-feed-item-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.telegram-feed-channel {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    color: #fff;
}

.telegram-feed-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
}

.telegram-feed-text {
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Show more text on larger screens */
@media (min-width: 1400px) {
    .telegram-feed-text {
        -webkit-line-clamp: 5;
        font-size: 0.78rem;
    }
}

@media (min-width: 1920px) {
    .telegram-feed-text {
        -webkit-line-clamp: 6;
    }
}

.telegram-feed-image {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-top: 0.4rem;
}

@media (min-width: 1400px) {
    .telegram-feed-image {
        height: 80px;
    }
}

/* Loading indicator for infinite scroll */
.telegram-feed-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 0.5rem;
}

.telegram-feed-loader .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.telegram-feed-end {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Main content area wrapper */
.main-content-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Telegram Post Viewer */
.telegram-post-viewer {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.telegram-post-content {
    padding: 1.25rem;
}

/* Telegram Post Card */
.tg-post-card {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.tg-post-close {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    z-index: 10;
}

.tg-post-close:hover {
    background: var(--error);
    border-color: var(--error);
    color: #fff;
}

.tg-post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tg-post-channel {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    color: #fff;
}

.tg-post-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tg-post-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    padding: 0.3rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.tg-post-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tg-post-link svg {
    color: #0088cc;
}

.tg-translate-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.tg-translate-link:hover {
    background: #4285f4;
    color: #fff;
}

.tg-translated-badge {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
}

/* Voting */
.tg-post-voting {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.tg-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.tg-vote-btn:hover {
    background: var(--bg-secondary);
}

.tg-vote-up:hover, .tg-vote-up.active {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #22c55e;
}

.tg-vote-down:hover, .tg-vote-down.active {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.tg-views {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tg-post-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
}

.tg-post-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.tg-post-text a {
    color: var(--accent);
    word-break: break-all;
}

.tg-post-text a:hover {
    text-decoration: underline;
}

.telegram-channel {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.15s;
}

.telegram-channel:last-child {
    border-bottom: none;
}

.telegram-channel:hover {
    background: var(--bg-tertiary);
}

.telegram-channel.active {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
}

.telegram-channel-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.telegram-channel-info {
    flex: 1;
    min-width: 0;
}

.telegram-channel-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.telegram-channel-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Telegram embed modal/panel */
.telegram-embed-panel {
    display: none;
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 100px);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
}

.telegram-embed-panel.active {
    display: block;
}

.telegram-embed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #0088cc 0%, #229ED9 100%);
    color: #fff;
}

.telegram-embed-title {
    font-size: 0.9rem;
    font-weight: 700;
}

.telegram-embed-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.telegram-embed-close:hover {
    background: rgba(255,255,255,0.3);
}

.telegram-embed-content {
    height: calc(100vh - 180px);
    max-height: 600px;
    overflow: hidden;
}

.telegram-embed-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.telegram-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.telegram-overlay.active {
    display: block;
}

/* Wider content area on large screens - Flexible sidebars */
@media (min-width: 1400px) {
    .content-grid {
        grid-template-columns: 1fr 280px;
        gap: 1.5rem;
    }
    
    .content-grid.with-left-sidebar {
        grid-template-columns: 280px minmax(0, 1fr) 280px;
        gap: 1.5rem;
        align-items: start;
    }
}

/* Right sidebar - Flexible width */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: sticky;
    top: 70px;
    align-self: start;
    max-height: calc(100vh - 220px); /* viewport minus header(70) and footer(140) + buffer */
    min-width: 220px;
    max-width: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Fixed sidebar sections (Categories, Partners) */
.sidebar-section.sidebar-fixed {
    flex-shrink: 0;
}

/* Scrollable widget for Trending & Most Read */
.sidebar-scrollable-widget {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 300px;
    flex: 1;
}

/* Fixed header at top of scrollable widget */
.sidebar-section-header {
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid var(--border-strong);
    font-size: 0.65rem;
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.sidebar-scroll-content .sidebar-section-header {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Inline scroll buttons */
.sidebar-scroll-nav-inline {
    display: flex;
    justify-content: center;
    padding: 0.25rem;
    background: var(--bg-secondary);
}

.sidebar-scroll-btn-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.6rem;
}

.sidebar-scroll-btn-inline:hover {
    color: var(--accent);
}

.sidebar-scroll-btn-inline:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Scroll list styling */
.sidebar-scroll-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-scroll-list li {
    border-bottom: 1px solid var(--border);
}

.sidebar-scroll-list li:last-child {
    border-bottom: none;
}

.sidebar-scroll-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background-color 0.15s, color 0.15s;
    line-height: 1.4;
}

.sidebar-scroll-list li a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-scroll-list.trending-list li a {
    white-space: normal;
    word-wrap: break-word;
}

.sidebar-scroll-nav {
    display: none;
}

.sidebar-scroll-nav-top {
    display: none;
}

.sidebar-scroll-content {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.sidebar-scroll-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.sidebar-scroll-content::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 2px;
}

/* Sections inside scrollable widget have no border-radius */
.sidebar-scrollable-widget .sidebar-section {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border-strong);
}

.sidebar-scrollable-widget .sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sidebar-section .header {
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border-strong);
    font-size: 0.65rem;
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section li {
    border-bottom: 1px solid var(--border);
}

.sidebar-section li:last-child {
    border-bottom: none;
}

.sidebar-section li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background-color 0.15s, color 0.15s;
    line-height: 1.4;
}

/* Trending items show more text */
.sidebar-section.trending li a {
    white-space: normal;
    word-wrap: break-word;
}

.sidebar-section li a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-section .count {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
}

/* Category and trending item links (used in publication page sidebar) */
.sidebar-section .category-link,
.sidebar-section .trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background-color 0.15s, color 0.15s;
    line-height: 1.4;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.sidebar-section .category-link:last-child,
.sidebar-section .trending-item:last-child {
    border-bottom: none;
}

.sidebar-section .category-link:hover,
.sidebar-section .trending-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-section .trending-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.sidebar-section .trending-item .title {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.sidebar-section .trending-item .meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.3rem;
}

/* Trending Section */
.sidebar-section.trending .header {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border-bottom: 2px solid var(--accent);
}

.sidebar-section.trending li a {
    gap: 0.5rem;
    justify-content: flex-start;
}

.trend-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.sidebar-section.trending li:nth-child(1) .trend-rank {
    background: #fbbf24;
    color: #000;
}

.sidebar-section.trending li:nth-child(2) .trend-rank {
    background: #9ca3af;
    color: #000;
}

.sidebar-section.trending li:nth-child(3) .trend-rank {
    background: #cd7f32;
    color: #fff;
}

/* Tables (Admin) */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

th, td {
    padding: 0.6rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-tertiary);
    font-family: var(--font-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

tr:hover {
    background: var(--bg-secondary);
}

/* Status badges - Rounded */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-published {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-draft {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.badge-archived {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

[data-theme="dark"] .badge-published { 
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7; 
}
[data-theme="dark"] .badge-draft { 
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d; 
}
[data-theme="dark"] .badge-archived { 
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8; 
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    transition: background-color 0.15s;
}

.mobile-menu-toggle:hover {
    background: var(--border);
}

/* Mobile Responsive */
@media (max-width: 1099px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid.with-left-sidebar {
        grid-template-columns: 1fr;
    }
    
    /* Main content comes first on mobile/tablet */
    .main-content-area {
        order: 1;
    }
    
    .left-sidebar {
        position: static;
        max-height: none;
        order: 2;
    }
    
    .sidebar {
        position: static;
        max-height: none;
        order: 3;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.75rem;
    }
    
    .telegram-feed-widget {
        height: 300px;
        min-height: 250px;
        max-height: 350px;
    }
    
    .telegram-feed-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .telegram-feed-item {
        min-width: 200px;
        flex-shrink: 0;
    }
    
    .telegram-feeds-container {
        height: 350px;
        min-height: 300px;
        max-height: 400px;
    }
    
    .left-sidebar .telegram-feeds {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .left-sidebar .telegram-feeds .header {
        grid-column: 1 / -1;
    }
    
    .telegram-channel {
        border-bottom: none;
        border-right: 1px solid var(--border);
    }
    
    .telegram-post-viewer {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        margin: 0;
        border-radius: 0;
    }
    
    .telegram-post-content {
        max-height: calc(100vh - 140px);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    body {
        padding-bottom: 180px; /* More space for stacked footer on mobile */
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 0.75rem;
        border-bottom: 1px solid var(--border-strong);
        box-shadow: var(--shadow);
        z-index: 99;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 0.6rem 0.85rem;
        border-radius: var(--radius);
    }

    .tagline {
        display: none !important;
    }

    .publication-card {
        grid-template-columns: 120px 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .publication-card .thumbnail {
        width: 120px;
        height: 85px;
    }
    
    .publication-card .title {
        font-size: 0.95rem;
    }

    .publication-card .excerpt {
        -webkit-line-clamp: 3;
    }
    
    .publication-header .title {
        font-size: 1.25rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-stats {
        order: -1;
    }

    .sidebar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .publication-card {
        grid-template-columns: 1fr;
    }
    
    .publication-card .thumbnail {
        width: 100%;
        height: 140px;
    }

    .publication-card .excerpt {
        display: block;
        -webkit-line-clamp: 2;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .content-grid {
        gap: 1rem;
    }
}

/* Admin specific */
.admin-header {
    background: var(--bg-tertiary);
}

.admin-nav {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 0.4rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background-color 0.15s, border-color 0.15s;
}

.admin-nav a:hover, .admin-nav a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
}

.stat-card .value {
    font-size: 1.75rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
}

.stat-card .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.15rem;
    font-weight: 600;
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 0.35rem; }
.mt-2 { margin-top: 0.75rem; }
.mb-1 { margin-bottom: 0.35rem; }
.mb-2 { margin-bottom: 0.75rem; }

/* Search Page */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.search-form input {
    flex: 1;
}

.search-form .btn {
    flex-shrink: 0;
}

/* Contact Page */
.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* About Page */
.about-content {
    max-width: 700px;
}

.about-content p {
    margin-bottom: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.about-content h2 {
    margin-top: 1.5rem;
    margin-bottom: 0.65rem;
}

/* ============================================
   Large Screens (1920px+) and 4K Displays
   Using fluid layout that fills available space
   ============================================ */
@media (min-width: 1440px) {
    html {
        font-size: 15px;
    }
    
    .container {
        padding: 0 2rem;
    }
    
    .publications-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .publication-card {
        grid-template-columns: 180px 1fr;
        padding: 1.25rem;
        gap: 1.25rem;
    }
    
    .publication-card .thumbnail {
        width: 180px;
        height: 120px;
    }
    
    .content-grid {
        grid-template-columns: 1fr 280px;
        gap: 1.5rem;
    }
    
    .content-grid.with-left-sidebar {
        grid-template-columns: 260px minmax(0, 1fr) 260px;
        gap: 1.5rem;
        align-items: start;
    }
    
    .left-sidebar,
    .sidebar {
        min-width: 260px;
        max-width: 260px;
    }
}

@media (min-width: 1920px) {
    html {
        font-size: 16px;
    }
    
    .container {
        padding: 0 3rem;
    }
    
    .publications-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .publication-card {
        grid-template-columns: 200px 1fr;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .publication-card .thumbnail {
        width: 200px;
        height: 140px;
    }
    
    .publication-card .title {
        font-size: 1.15rem;
    }
    
    .publication-card .excerpt {
        -webkit-line-clamp: 6;
        font-size: 0.95rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr 320px;
        gap: 2rem;
    }
    
    .content-grid.with-left-sidebar {
        grid-template-columns: 300px minmax(0, 1fr) 300px;
        gap: 2rem;
        align-items: start;
    }
    
    .left-sidebar,
    .sidebar {
        min-width: 300px;
        max-width: 300px;
    }
}

/* Ultra-wide / 4K (2560px+) */
@media (min-width: 2560px) {
    html {
        font-size: 18px;
    }
    
    .container {
        padding: 0 4rem;
    }
    
    .publications-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }
    
    .publication-card {
        grid-template-columns: 280px 1fr;
        gap: 2rem;
        padding: 2rem;
    }
    
    .publication-card .thumbnail {
        width: 280px;
        height: 180px;
    }
    
    .publication-card .title {
        font-size: 1.3rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }
    
    .publication-card .excerpt {
        -webkit-line-clamp: 8;
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .publication-card .meta {
        font-size: 0.85rem;
        margin-top: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr 380px;
        gap: 3rem;
    }
    
    .content-grid.with-left-sidebar {
        grid-template-columns: 350px minmax(0, 1fr) 350px;
        gap: 2.5rem;
        align-items: start;
    }
    
    .left-sidebar,
    .sidebar {
        min-width: 350px;
        max-width: 350px;
    }
    
    .sidebar-section li a {
        padding: 0.85rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .main {
        padding: 2.5rem 0;
    }
    
    .telegram-feed-text {
        -webkit-line-clamp: 8;
    }
    
    .telegram-feed-item {
        padding: 1rem;
    }
    
    .telegram-feed-image {
        height: 120px;
    }
    
    /* Larger sidebar headers on 4K */
    .sidebar-section .header,
    .sidebar-section-header {
        font-size: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    /* Larger tags on 4K */
    .publication-card .tag {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

/* True 4K (3840px+) */
@media (min-width: 3840px) {
    html {
        font-size: 20px;
    }
    
    .container {
        padding: 0 6rem;
        max-width: 3200px;
    }
    
    .publications-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .publication-card {
        grid-template-columns: 350px 1fr;
        gap: 2.5rem;
        padding: 2rem;
    }
    
    .publication-card .thumbnail {
        width: 350px;
        height: 220px;
    }
    
    .publication-card .title {
        font-size: 1.5rem;
    }
    
    .publication-card .excerpt {
        -webkit-line-clamp: 10;
        font-size: 1.1rem;
    }
    
    .content-grid.with-left-sidebar {
        grid-template-columns: 380px minmax(0, 1fr) 380px;
        gap: 3rem;
        align-items: start;
    }
    
    .left-sidebar,
    .sidebar {
        min-width: 380px;
        max-width: 380px;
    }
    
    .telegram-feed-item {
        padding: 1.25rem;
    }
    
    .telegram-feed-text {
        -webkit-line-clamp: 10;
        font-size: 0.9rem;
    }
    
    .telegram-feed-image {
        height: 150px;
    }
}

/* ============================================
   Auth Pages (Login/Register)
   ============================================ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.btn-full {
    width: 100%;
}

/* User Menu in Header */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu .username {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.user-menu .btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

/* ============================================
   Voting UI
   ============================================ */
.vote-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.vote-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.vote-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.vote-btn.active-up {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.vote-btn.active-down {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error);
    color: var(--error);
}

.vote-btn svg {
    width: 12px;
    height: 12px;
}

.vote-count {
    font-family: var(--font-mono);
    min-width: 1.5rem;
    text-align: center;
}

/* Observation with voting */
.observation-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.65rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

/* ============================================
   Media Gallery
   ============================================ */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.media-item {
    position: relative;
    aspect-ratio: 16/10;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.media-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

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

.media-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    pointer-events: none;
}

.media-item .play-icon svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
}

.media-item .media-count {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-content iframe {
    width: 80vw;
    height: 45vw;
    max-height: 80vh;
    border: none;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
    left: 1rem;
}

.lightbox-nav.next {
    right: 1rem;
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
}

.lightbox-caption {
    color: white;
    text-align: center;
    padding: 1rem;
    max-width: 80%;
    font-size: 0.9rem;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    margin-top: 0.5rem;
}

/* Media grid in admin */
.admin-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.admin-media-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.admin-media-item .delete-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--error);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.admin-media-item:hover .delete-btn {
    opacity: 1;
}

.admin-media-item .delete-btn svg {
    width: 14px;
    height: 14px;
}

.media-upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    transition: border-color 0.15s, background-color 0.15s;
    cursor: pointer;
}

.media-upload-zone:hover,
.media-upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.media-upload-zone input {
    display: none;
}

/* ============================================
   Cookie Consent Banner & Modal
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-strong);
    padding: 1rem;
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 280px;
}

.cookie-banner-text strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.cookie-banner-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.cookie-banner-text a {
    color: var(--link);
}

.cookie-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Cookie Modal */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-modal-overlay.visible {
    opacity: 1;
}

.cookie-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-modal-overlay.visible .cookie-modal {
    transform: scale(1);
}

.cookie-modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.cookie-modal-close:hover {
    color: var(--text-primary);
}

.cookie-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.cookie-modal-body > p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.cookie-category {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.cookie-category-header input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.cookie-category-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.cookie-badge {
    font-size: 0.65rem;
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.cookie-category-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0 1.75rem;
}

.cookie-modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ============================================
   Legal Pages (Privacy, Cookies, Terms)
   ============================================ */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
}

.legal-page h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.legal-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.legal-content section {
    margin-bottom: 2rem;
}

.legal-content h2 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.legal-content h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
}

.legal-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.legal-content ul {
    margin: 0.5rem 0 1rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.legal-content li {
    margin-bottom: 0.35rem;
}

.legal-content a {
    color: var(--link);
}

.cookie-table {
    width: 100%;
    font-size: 0.85rem;
    margin: 0.75rem 0;
    border-collapse: collapse;
}

.cookie-table th,
.cookie-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid var(--border);
}

.cookie-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.cookie-table code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

@media (max-width: 600px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-banner-actions {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-modal-footer .btn {
        width: 100%;
    }
}

/* Suggest Observation Form */
.suggest-form {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}

.suggest-form h4 {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.suggest-form .form-row {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 0.5rem;
    align-items: end;
}

.suggest-form .form-row input,
.suggest-form .form-row select,
.suggest-form .form-row textarea {
    font-size: 0.8rem;
    padding: 0.5rem;
}

.suggest-form textarea {
    min-height: 60px;
}

@media (max-width: 600px) {
    .suggest-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* Login prompt */
.login-prompt {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
}

.login-prompt a {
    font-weight: 600;
}
