/*
 * prosto24.com - Main Stylesheet
 * Optimized for DLE 20.0 (IT News, Articles, Reviews)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   1. Design Tokens & CSS Variables
   ========================================================================== */
:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Light Theme (Default) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --accent-color: #0284c7; /* Ocean blue */
    --accent-hover: #0369a1;
    --accent-light: #e0f2fe;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    --card-glow: rgba(2, 132, 199, 0.03);

    /* Review Elements Colors */
    --color-pro: #10b981;
    --color-pro-bg: #ecfdf5;
    --color-con: #ef4444;
    --color-con-bg: #fef2f2;
    --color-rating: #f59e0b;
    --color-rating-bg: #fffbeb;

    /* Layout Spacing */
    --container-max-width: 1280px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;
    
    /* Fluid Typography Variables */
    --fs-base: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
    --fs-h1: clamp(2rem, 1.5rem + 2vw, 3rem);
    --fs-h2: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
    --fs-h3: clamp(1.25rem, 1.1rem + 1vw, 1.75rem);
    --fs-h4: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
    --fs-sm: clamp(0.8rem, 0.75rem + 0.2vw, 0.875rem);
    
    --transition-speed: 0.3s;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
    --bg-primary: #0b0f19;
    --bg-secondary: #121826;
    --bg-tertiary: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border-color: #1e293b;
    --border-hover: #334155;
    
    --accent-color: #38bdf8; /* Light blue accent */
    --accent-hover: #7dd3fc;
    --accent-light: rgba(56, 189, 248, 0.15);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    
    --card-glow: rgba(56, 189, 248, 0.02);

    --color-pro-bg: rgba(16, 185, 129, 0.1);
    --color-con-bg: rgba(239, 68, 68, 0.1);
    --color-rating-bg: rgba(245, 158, 11, 0.1);
}

/* ==========================================================================
   2. Reset & Core Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.5em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius-sm);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Helper Utilities */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   3. Main Site Layout Structure
   ========================================================================== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Navigation */
.main-header {
    background-color: rgba(var(--bg-secondary), 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
}

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

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-speed);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
}

.theme-toggle-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.theme-toggle-btn .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
    display: block;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Body Content Area */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    padding: 32px 0;
    flex-grow: 1;
}

/* Sidebar Widgets */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.widget {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
}

.widget-title {
    font-size: 1.15rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent-color);
}

/* Footer */
.main-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 48px 0 24px;
    margin-top: auto;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}

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

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--accent-color);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   4. Chronological Feed (shortstory.tpl)
   ========================================================================== */
.feed-header {
    margin-bottom: 24px;
}

.feed-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.news-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: transparent;
    transition: background-color var(--transition-speed);
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
    background-color: var(--card-glow);
}

.news-card:hover::before {
    background-color: var(--accent-color);
}

.news-card-image {
    position: relative;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    aspect-ratio: 16/10;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.category-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--accent-color);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.news-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.news-card-meta svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.news-card-title {
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 12px;
}

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

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

.news-card-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.read-more-link {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.read-more-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.read-more-link:hover svg {
    transform: translateX(4px);
}

/* ==========================================================================
   5. Single Story Details (fullstory.tpl)
   ========================================================================== */
.article-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.article-header {
    margin-bottom: 24px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta a {
    color: var(--text-secondary);
}

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

.article-title {
    font-size: var(--fs-h1);
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.2;
}

.article-main-image {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 32px;
}

.article-main-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

/* Article Body Content Typography & Styling */
.article-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.article-body p {
    margin-bottom: 20px;
}

.article-body h2, .article-body h3, .article-body h4 {
    margin-top: 36px;
    margin-bottom: 16px;
}

.article-body ul, .article-body ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body blockquote {
    border-left: 4px solid var(--accent-color);
    padding: 16px 24px;
    background-color: var(--bg-tertiary);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    font-style: italic;
    font-size: 1.1rem;
    margin: 28px 0;
    color: var(--text-primary);
}

/* Related articles */
.related-news {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.related-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-card-image {
    aspect-ratio: 16/10;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

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

/* Author Box */
.author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: var(--bg-tertiary);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-top: 40px;
}

.author-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--bg-secondary);
}

.author-info h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.author-bio {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==========================================================================
   6. Review Features (Ratings, Pros/Cons, Specs)
   ========================================================================== */
.review-widget {
    margin: 32px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.review-header {
    background-color: var(--bg-tertiary);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.review-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0;
    font-family: var(--font-heading);
}

.review-badge {
    background-color: var(--accent-light);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.review-content {
    padding: 24px;
}

/* Layout of Review Content: Rating and Pros/Cons */
.review-summary-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 32px;
    margin-bottom: 24px;
}

/* Circular Rating Box */
.review-rating-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--color-rating-bg);
    border: 4px solid var(--color-rating);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-rating);
    font-family: var(--font-heading);
    box-shadow: var(--shadow-sm);
}

.rating-number {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
}

.rating-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-verdict {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.verdict-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.verdict-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Pros and Cons Split */
.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.pros-box, .cons-box {
    padding: 20px;
    border-radius: var(--border-radius-sm);
}

.pros-box {
    background-color: var(--color-pro-bg);
    border-left: 4px solid var(--color-pro);
}

.cons-box {
    background-color: var(--color-con-bg);
    border-left: 4px solid var(--color-con);
}

.pc-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
}

.pros-box .pc-title { color: var(--color-pro); }
.cons-box .pc-title { color: var(--color-con); }

.pc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pc-list li {
    font-size: 0.9rem;
    position: relative;
    padding-left: 20px;
    color: var(--text-secondary);
}

.pc-list li::before {
    position: absolute;
    left: 0;
    top: 2px;
    font-weight: 700;
}

.pros-box .pc-list li::before {
    content: '✓';
    color: var(--color-pro);
}

.cons-box .pc-list li::before {
    content: '✕';
    color: var(--color-con);
}

/* Specifications Table */
.specs-box {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.specs-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    font-family: var(--font-heading);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.9rem;
}

.spec-label {
    font-weight: 500;
    color: var(--text-muted);
}

.spec-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   7. Google AdSense Blocks Styling
   ========================================================================== */
.adsense-box {
    margin: 24px 0;
    padding: 12px;
    background-color: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 120px;
    overflow: hidden;
}

.adsense-box::before {
    content: 'РЕКЛАМА (GOOGLE ADSENSE)';
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.adsense-box.sidebar-ad {
    min-height: 280px; /* Для 300x250 или 300x600 */
    margin: 0;
}

.adsense-box.header-ad {
    max-width: 728px;
    min-height: 90px;
    margin: 0 auto 24px;
}

.adsense-box.in-article-ad {
    margin: 32px 0;
    clear: both;
}

/* ==========================================================================
   8. Breadcrumbs & Pagination & Misc
   ========================================================================== */
/* Speedbar / Breadcrumbs */
.speedbar-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 20px;
    font-size: 0.85rem;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.speedbar-container a {
    color: var(--text-secondary);
}

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

.speedbar-separator {
    color: var(--text-muted);
}

/* Pagination */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    background-color: var(--bg-secondary);
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
}

.pagination li a, .pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
}

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

.pagination li.active span {
    background-color: var(--accent-color);
    color: #ffffff;
}

.pagination li.nav-arrow a {
    font-weight: 700;
}

/* Info Messages Widget (e.g. DLE Alerts) */
.dle-info-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    border-radius: var(--border-radius-sm);
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.dle-info-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* ==========================================================================
   9. Comments & Chat Dialogs
   ========================================================================== */
.comments-section {
    margin-top: 48px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.comments-title {
    font-size: 1.35rem;
    margin-bottom: 24px;
    font-family: var(--font-heading);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.comment-card {
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.comment-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img, .comment-avatar a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.comment-main {
    flex-grow: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.comment-actions {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.85rem;
}

.comment-action-btn {
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
}

.comment-action-btn:hover {
    color: var(--accent-color);
}

/* Comments Add Form */
.add-comment-form {
    margin-top: 40px;
    background-color: var(--bg-tertiary);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 16px;
}

.form-control, select {
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    transition: all var(--transition-speed);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
    padding-right: 40px !important;
    cursor: pointer;
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml;utf8,<svg fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><polyline points='6 9 12 15 18 9'></polyline></svg>");
}

.user-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

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

/* Chat-like PM dialogs styling */
.pm-chat-container {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    height: 600px;
    box-shadow: var(--shadow-sm);
}

.pm-chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-family: var(--font-heading);
}

.pm-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pm-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    line-height: 1.4;
}

.pm-bubble.incoming {
    align-self: flex-start;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.pm-bubble.outgoing {
    align-self: flex-end;
    background-color: var(--accent-color);
    color: #ffffff;
}

.pm-chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   10. Responsive Media Queries (Mobile-First overrides)
   ========================================================================== */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .sidebar {
        margin-top: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .nav-menu {
        display: none; /* Will be activated by JS toggle classes */
    }
    
    .menu-toggle {
        display: block;
    }

    /* Mobile Menu Activated state */
    .nav-menu.active {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--bg-secondary);
        padding: 32px 24px;
        gap: 20px;
        z-index: 99;
        overflow-y: auto;
    }

    .nav-link {
        font-size: 1.1rem;
        width: 100%;
        display: block;
    }

    .news-card {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .news-card-image {
        aspect-ratio: 16/9;
    }

    .article-container {
        padding: 20px;
    }

    .review-summary-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        justify-items: center;
        text-align: center;
    }

    .pros-cons-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

    .related-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ==========================================================================
   11. Popular Sidebar Obzory (topnews.tpl)
   ========================================================================== */
.topnews-card {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: transform var(--transition-speed);
}

.topnews-card:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.topnews-card:hover {
    transform: translateX(4px);
}

.topnews-img {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.topnews-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topnews-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topnews-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topnews-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

