/*
Theme Name: Strannikoff Community
Theme URI: https://strannikoff.com
Description: Современная Reddit-style тема для Strannikoff с оптимизированной сортировкой
Version: 6.6.0
Author: Strannikoff Team
Author URI: https://strannikoff.com
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: strannikoff-community
Tags: community, social, reddit, modern, moderation, optimized
*/

/* ===== REDDIT COLOR PALETTE ===== */
:root {
    /* Primary Colors */
    --reddit-orange: #ff4500;
    --reddit-blue: #0079d3;
    --reddit-periwinkle: #7193ff;
    
    /* Grays */
    --reddit-gray: #878a8c;
    --reddit-gray-light: #b8b8b8;
    --reddit-gray-dark: #1c1c1c;
    
    /* Backgrounds (Light Theme) */
    --reddit-bg: #dae0e6;
    --reddit-bg-light: #f6f7f8;
    --reddit-white: #ffffff;
    --reddit-canvas: #fcfcfc;
    
    /* Borders */
    --reddit-border: #ccc;
    --reddit-border-light: #edeff1;
    
    /* Semantic colors */
    --text-primary: #1c1c1c;
    --text-secondary: #7c7c7c;
    --text-tertiary: #878a8c;
    
    /* Layout */
    --header-height: 48px;
    --vote-column-width: 40px;
    --feed-width: 640px;
    --sidebar-width: 312px;
    --max-width: 1248px;
    
    /* Spacing */
    --space-2: 2px;
    --space-4: 4px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    
    /* Border Radius */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.1s ease;
    --transition-normal: 0.2s ease;
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
    /* Dark Backgrounds */
    --reddit-bg: #030303;
    --reddit-bg-light: #1a1a1b;
    --reddit-white: #1a1a1b;
    --reddit-canvas: #0e0e0e;
    
    /* Dark Borders */
    --reddit-border: #343536;
    --reddit-border-light: #343536;
    
    /* Dark Text */
    --text-primary: #d7dadc;
    --text-secondary: #818384;
    --text-tertiary: #6b6e70;
}

/* ===== GLOBAL RESETS ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
    background-color: var(--reddit-bg) !important;
    margin: 0;
    font-weight: 400;
}

/* Фон на всех страницах одинаковый */
body.single,
body.page,
body.home,
body.archive,
body.category {
    background-color: var(--reddit-bg) !important;
}

main.site-main {
    padding-top: calc(var(--header-height) + 20px);
}

a {
    color: var(--reddit-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    text-decoration: underline;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== HEADER (Reddit-style) ===== */
.site-header {
    background-color: var(--reddit-white);
    border-bottom: 1px solid var(--reddit-border-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.header-container {
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-20);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-20);
}

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: var(--space-8);
}

.site-logo img {
    height: 32px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: var(--space-4);
}

.nav-link {
    padding: var(--space-8) var(--space-12);
    text-decoration: none;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    background-color: var(--reddit-bg-light);
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    padding: var(--space-4) var(--space-8);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
}

.user-btn:hover {
    border-color: var(--reddit-border);
    background-color: var(--reddit-bg-light);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--reddit-bg);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1001;
}

.user-dropdown.show {
    display: block;
}

.dropdown-link {
    display: block;
    padding: var(--space-12) var(--space-16);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-fast);
    font-size: 14px;
}

.dropdown-link:hover {
    background-color: var(--reddit-bg-light);
    text-decoration: none;
}

/* Notifications */
.notifications-wrapper {
    position: relative;
}

.notifications-btn {
    position: relative;
    background: transparent;
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-md);
    padding: var(--space-8);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 18px;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.notifications-btn:hover {
    background-color: var(--reddit-bg-light);
    border-color: var(--reddit-border);
}

.notifications-btn i {
    transition: transform 0.3s ease;
}

.notifications-btn:hover i {
    opacity: 0.9;
}

.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: var(--radius-full);
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: notificationPulse 2s infinite;
}

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

.notifications-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 380px;
    max-height: 500px;
    z-index: 1001;
    overflow: hidden;
}

.notifications-dropdown:not(.hidden) {
    display: block;
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--reddit-border-light);
    background: var(--reddit-bg-light);
}

.notifications-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.mark-all-read {
    background: transparent;
    border: none;
    color: var(--reddit-blue);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 14px;
}

.mark-all-read:hover {
    background: var(--reddit-bg-light);
}

.notifications-list {
    max-height: 440px;
    overflow-y: auto;
}

.notifications-loading {
    padding: 32px;
    text-align: center;
    color: var(--text-tertiary);
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--reddit-border-light);
    transition: var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.notification-item:hover {
    background-color: var(--reddit-bg-light);
}

.notification-item.unread {
    background-color: rgba(33, 150, 243, 0.05);
}

.notification-item.unread:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    object-fit: cover;
}

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

.notification-message {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-post-title {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.notification-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.notifications-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-tertiary);
}

.notifications-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.notifications-empty p {
    margin: 0;
    font-size: 14px;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-md);
    padding: var(--space-8);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 20px;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--reddit-bg-light);
}

.search-bar {
    display: flex;
    align-items: center;
    max-width: 400px;
    flex: 1;
    margin: 0 var(--space-16);
}

.search-input {
    width: 100%;
    padding: var(--space-8) var(--space-16);
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-full);
    background-color: var(--reddit-bg-light);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--reddit-blue);
    background-color: var(--reddit-white);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* ===== LAYOUT ===== */
.site-content, .content-wrapper {
    max-width: var(--max-width);
    margin: var(--space-20) auto;
    padding: 0 var(--space-24);
    display: flex;
    gap: var(--space-24);
    align-items: flex-start;
}

.main-feed {
    flex: 1;
    max-width: var(--feed-width);
    min-width: 0;
}

.sidebar {
    width: var(--sidebar-width);
}

/* ===== POST CARD (Modern Reddit-style) ===== */
.feed-posts, .posts-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.post-card:hover {
    background-color: var(--reddit-bg-light);
}

[data-theme="dark"] .post-card:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Vote Column - Modern (Moved to bottom like new Reddit) */
.post-vote-column {
    background-color: transparent;
    padding: var(--space-8) var(--space-12);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-8);
    border-top: 1px solid var(--reddit-border-light);
    order: 3;
}

.vote-arrow {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--reddit-gray);
    cursor: pointer;
    padding: var(--space-4);
    transition: all 0.2s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    position: relative;
}

.vote-arrow:hover {
    background-color: var(--reddit-bg-light);
    opacity: 0.9;
}

.vote-arrow.upvote:hover {
    color: var(--reddit-orange);
    background-color: rgba(255, 69, 0, 0.1);
}

.vote-arrow.upvote.active {
    color: var(--reddit-orange);
    background-color: rgba(255, 69, 0, 0.15);
    animation: voteUp 0.3s ease;
}

.vote-arrow.downvote:hover {
    color: var(--reddit-periwinkle);
    background-color: rgba(113, 147, 255, 0.1);
}

.vote-arrow.downvote.active {
    color: var(--reddit-periwinkle);
    background-color: rgba(113, 147, 255, 0.15);
    animation: voteDown 0.3s ease;
}

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

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

.vote-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    user-select: none;
    line-height: 1;
    min-width: 32px;
    text-align: center;
    transition: all 0.2s ease;
}

.vote-count.positive {
    color: var(--reddit-orange);
}

.vote-count.negative {
    color: var(--reddit-periwinkle);
}

.vote-count.animating {
    animation: countPulse 0.3s ease;
}

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

/* Post Body - Modern */
.post-body {
    flex: 1;
    padding: var(--space-12) var(--space-16);
    order: 1;
}

.post-header {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.post-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--reddit-bg);
    border: 2px solid var(--reddit-border-light);
    transition: transform 0.2s ease;
}

.post-author-avatar:hover {
    opacity: 0.9;
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.post-author-info h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.2s ease;
}

.post-author-info a:hover h3 {
    color: var(--reddit-blue);
}

.post-meta-separator {
    color: var(--text-tertiary);
    margin: 0 2px;
}

.post-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

.post-category {
    font-weight: 600;
    padding: 2px 8px;
    background-color: var(--reddit-bg-light);
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.post-category:hover {
    background-color: rgba(0, 121, 211, 0.1);
}

/* Post Content */
.post-content {
    margin-bottom: var(--space-8);
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 var(--space-8) 0;
    color: var(--text-primary);
    word-wrap: break-word;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: inline-block;
}

.post-title a:hover {
    color: var(--reddit-blue);
}

.post-card:hover .post-title a {
    color: var(--reddit-blue);
}

.post-title a:visited {
    opacity: 0.8;
}

.post-excerpt {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 0 0 var(--space-12) 0;
    word-wrap: break-word;
}

.post-excerpt-short {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: var(--space-4) 0 var(--space-8) 0;
    word-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Post Media - Modern */
.post-media-wrapper {
    margin: var(--space-12) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-media {
    position: relative;
    background-color: #000;
    max-height: 600px;
    overflow: hidden;
    cursor: pointer;
}

.post-media img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: cover;
}

.post-media video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: contain;
}

.post-media .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.3);
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.post-media.playing .video-overlay {
    opacity: 0;
    pointer-events: none;
}

.video-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.95);
    border-radius: 50%;
    font-size: 28px;
    color: var(--text-primary);
}

/* YouTube Embed */
.youtube-embed {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-medium);
}

.youtube-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-medium);
}

/* TikTok Embed */
.tiktok-embed-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 400px;
    max-height: none !important; /* Убираем ограничение высоты */
    overflow: visible !important; /* Разрешаем видимость контента */
    border-radius: var(--radius-medium);
    background: transparent;
}

.tiktok-embed-wrapper .tiktok-embed {
    margin: 0 auto;
    border-radius: var(--radius-medium);
    max-height: none !important;
    overflow: visible !important;
}

/* Post Actions */
.post-actions {
    padding: var(--space-8) var(--space-12);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    border-top: 1px solid var(--reddit-border-light);
    order: 2;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-12);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.action-btn:hover {
    background-color: var(--reddit-bg-light);
    color: var(--text-primary);
}

.action-btn .icon {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.action-btn:hover .icon {
    opacity: 0.9;
}

.action-btn.reacting {
    animation: reactPulse 0.4s ease;
}

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

/* Post Reactions - Modern */
.post-reactions-display {
    padding: var(--space-8);
    display: flex;
    gap: var(--space-8);
    flex-wrap: wrap;
    background-color: var(--reddit-bg-light);
    border-radius: var(--radius-md);
    margin-top: var(--space-12);
}

.reaction-item {
    font-size: 13px;
    color: var(--text-secondary);
    padding: var(--space-4) var(--space-8);
    background-color: var(--reddit-white);
    border-radius: var(--radius-full);
    font-weight: 600;
    transition: transform 0.2s ease;
}

.reaction-item:hover {
    opacity: 0.9;
}

/* ===== SIDEBAR ===== */

.sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: var(--header-height);
    align-self: flex-start;
}

.sidebar-widget, .widget-create-post {
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-16);
    margin-bottom: var(--space-16);
    transition: all 0.2s ease;
}

.sidebar-widget:hover {
    border-color: var(--reddit-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sidebar-widget h3, .widget-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: var(--space-12);
    padding-bottom: var(--space-12);
    color: var(--text-primary);
    border-bottom: 2px solid var(--reddit-border-light);
}

.widget-title i,
.panel-header i {
    margin-right: 6px;
    opacity: 0.8;
}

/* Анимация для списков в сайдбаре */
.category-list li,
.archive-list li {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.category-list li:nth-child(1) { animation-delay: 0.05s; }
.category-list li:nth-child(2) { animation-delay: 0.1s; }
.category-list li:nth-child(3) { animation-delay: 0.15s; }
.category-list li:nth-child(4) { animation-delay: 0.2s; }
.category-list li:nth-child(5) { animation-delay: 0.25s; }
.category-list li:nth-child(6) { animation-delay: 0.3s; }
.category-list li:nth-child(7) { animation-delay: 0.35s; }
.category-list li:nth-child(8) { animation-delay: 0.4s; }
.category-list li:nth-child(9) { animation-delay: 0.45s; }
.category-list li:nth-child(10) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Стили для облака тегов */
.tag-cloud {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.widget-content, .widget-about {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.widget-about p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.widget-stats {
    display: flex;
    justify-content: space-around;
    gap: var(--space-16);
    margin-top: var(--space-12);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

.stat-value, .stat-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: var(--space-4);
}

/* Sort Bar - Modern */
.sort-bar {
    display: flex;
    gap: var(--space-8);
    padding: var(--space-12);
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sort-btn {
    padding: var(--space-8) var(--space-16);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.sort-btn i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.sort-btn:hover {
    background-color: var(--reddit-bg-light);
    color: var(--text-primary);
}

.sort-btn:hover i {
    opacity: 0.9;
}

.sort-btn.active {
    color: var(--reddit-white);
    background-color: var(--reddit-blue);
    box-shadow: 0 2px 8px rgba(0, 121, 211, 0.3);
}

.sort-btn.active i {
    animation: iconPulse 0.5s ease;
}

.sort-btn.active:hover {
    background-color: #0066b8;
}

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

/* ===== BUTTONS ===== */
.btn-primary, .button {
    background-color: var(--reddit-blue);
    color: white;
    border: none;
    padding: var(--space-8) var(--space-16);
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 14px;
    text-transform: none;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover, .button:hover {
    background-color: #0066b8;
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--reddit-blue);
    border: 1px solid var(--reddit-blue);
    padding: var(--space-8) var(--space-16);
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 14px;
    text-transform: none;
}

.btn-secondary:hover {
    background-color: rgba(0, 121, 211, 0.1);
}

.btn-create-post, .btn-add-post {
    padding: var(--space-8) var(--space-16);
    background-color: transparent;
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
}

.btn-create-post:hover, .btn-add-post:hover {
    background-color: var(--reddit-bg-light);
    border-color: var(--reddit-blue);
    text-decoration: none;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--space-20);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.show, .modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--reddit-white);
    border-radius: var(--radius-lg);
    max-width: 740px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes slideUp {
    from { 
        opacity: 0;
    }
    to { 
        opacity: 1;
    }
}

/* Login Modal - для неавторизованных */
.login-required-modal .modal-content {
    max-width: 480px;
}

.login-modal-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.login-modal-body {
    padding: var(--space-24);
    text-align: center;
}

.login-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-12);
    color: var(--text-primary);
}

.login-modal-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: var(--space-24);
    line-height: 1.5;
}

.login-modal-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
}

.login-modal-actions .button {
    width: 100%;
    padding: var(--space-12) var(--space-16);
    font-size: 15px;
    font-weight: 700;
}

.modal-header {
    padding: var(--space-16) var(--space-20);
    border-bottom: 1px solid var(--reddit-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.modal-close:hover {
    background-color: var(--reddit-bg-light);
}

.modal-body {
    padding: var(--space-20);
}

.form-group {
    margin-bottom: var(--space-16);
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-12);
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--reddit-bg-light);
    transition: var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--reddit-blue);
    background-color: var(--reddit-white);
}

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

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: var(--space-8);
    justify-content: center;
    margin-top: var(--space-24);
}

.page-numbers {
    padding: var(--space-8) var(--space-12);
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.page-numbers:hover {
    border-color: var(--reddit-blue);
    background-color: rgba(0, 121, 211, 0.05);
}

.page-numbers.current {
    background-color: var(--reddit-blue);
    color: white;
    border-color: var(--reddit-blue);
}

/* ===== SINGLE POST ===== */
.single-post {
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-20);
}

.single-post-header {
    margin-bottom: var(--space-16);
}

.single-post-title {
    font-size: 28px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: var(--space-12);
    color: var(--text-primary);
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    font-size: 12px;
    color: var(--text-secondary);
}

.single-post-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: var(--space-24);
}

.single-post-media {
    margin: var(--space-20) 0;
    text-align: center;
}

.single-post-media img,
.single-post-media video {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* Comments - Modern Style */
.comments-section {
    margin-top: var(--space-16);
}

.comments-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: var(--space-16);
    color: var(--text-primary);
}

.comment-form {
    margin-bottom: var(--space-24);
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-16);
}

.comment-form label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    display: block;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: var(--space-12);
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    background-color: var(--reddit-bg-light);
    color: var(--text-primary);
    resize: vertical;
    transition: all 0.2s ease;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--reddit-blue);
    background-color: var(--reddit-white);
}

.comment-form .form-submit {
    margin-top: var(--space-12);
}

.comment-form input[type="submit"] {
    background-color: var(--reddit-blue);
    color: white;
    border: none;
    padding: var(--space-8) var(--space-16);
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.comment-form input[type="submit"]:hover {
    background-color: #0066b8;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    padding: var(--space-16);
    margin-bottom: var(--space-12);
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.comment:hover {
    border-color: var(--reddit-border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.comment-author {
    font-weight: 700;
    font-size: 13px;
    color: var(--reddit-blue);
    margin-bottom: var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.comment-metadata {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-left: var(--space-8);
    font-weight: 400;
}

.comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.comment-content p {
    margin-bottom: var(--space-12);
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.reply {
    margin-left: var(--space-24);
    margin-top: var(--space-12);
}

.comment-reply-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-block;
    margin-top: var(--space-8);
}

.comment-reply-link:hover {
    background-color: var(--reddit-bg-light);
    color: var(--reddit-blue);
}

.children {
    list-style: none;
    padding-left: var(--space-24);
    margin-top: var(--space-12);
}

/* Nested comments styling */
.comment .children .comment {
    border-left: 2px solid var(--reddit-border-light);
    padding-left: var(--space-16);
}

/* Лайки и реакции комментариев */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.comment-like-btn {
    background: transparent;
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-full);
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-like-btn:hover:not(:disabled) {
    background: var(--reddit-bg-light);
    border-color: var(--reddit-blue);
    color: var(--reddit-blue);
}

.comment-like-btn.liked {
    background: #fee;
    border-color: #e91e63;
    color: #e91e63;
}

.comment-like-btn.liked i {
    animation: heartBeat 0.3s ease;
}

.comment-like-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-likes-count {
    font-weight: 600;
}

/* Реакции комментариев */
.comment-reactions {
    position: relative;
    display: inline-block;
}

.comment-reaction-trigger {
    background: transparent;
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-full);
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-reaction-trigger:hover:not(:disabled) {
    background: var(--reddit-bg-light);
    border-color: var(--reddit-orange);
    color: var(--reddit-orange);
}

.comment-reaction-trigger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-reaction-picker {
    position: absolute;
    bottom: calc(100% - 4px);
    left: 0;
    background: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 12px 8px 20px 8px;
    display: none;
    gap: 4px;
    z-index: 100;
    white-space: nowrap;
    pointer-events: none;
}

.comment-reaction-picker.show {
    display: flex;
    pointer-events: auto;
}

.comment-reaction-picker .reaction-btn {
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

.comment-reaction-picker .reaction-btn:hover {
    background: var(--reddit-bg-light);
    opacity: 0.9;
}

.comment-reaction-picker .reaction-btn.active {
    border-color: var(--reddit-blue);
    background: var(--reddit-bg-light);
}

.comment-reaction-picker .reaction-btn span {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.comment-reaction-picker .reaction-btn.active span {
    color: var(--reddit-blue);
}

/* Цвета реакций */
.comment-reaction-picker .reaction-btn[data-reaction="heart"] {
    color: #e91e63;
}

.comment-reaction-picker .reaction-btn[data-reaction="laugh"] {
    color: #ffc107;
}

.comment-reaction-picker .reaction-btn[data-reaction="wow"] {
    color: #2196f3;
}

.comment-reaction-picker .reaction-btn[data-reaction="sad"] {
    color: #9e9e9e;
}

.comment-reaction-picker .reaction-btn[data-reaction="angry"] {
    color: #f44336;
}

.total-reactions {
    font-weight: 600;
}

/* Анимация реакции */
@keyframes heartBeat {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.9;
    }
}

.comment-reply-link {
    color: var(--reddit-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.comment-reply-link:hover {
    background: var(--reddit-bg-light);
    color: var(--reddit-blue);
}

/* Редактирование и удаление комментариев и постов */
.comment-edit-btn,
.comment-delete-btn,
.post-delete-btn {
    background: transparent;
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-full);
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.comment-edit-btn:hover {
    background: var(--reddit-bg-light);
    border-color: var(--reddit-blue);
    color: var(--reddit-blue);
}

.comment-delete-btn:hover,
.post-delete-btn:hover {
    background: #fee;
    border-color: #f44336;
    color: #f44336;
}

/* Форма редактирования комментария */
.comment-edit-form {
    margin-top: 12px;
    padding: 12px;
    background: var(--reddit-bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--reddit-border);
}

.comment-edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    background: var(--reddit-white);
    color: var(--text-primary);
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.comment-edit-textarea:focus {
    outline: none;
    border-color: var(--reddit-blue);
    box-shadow: 0 0 0 3px rgba(0, 121, 211, 0.1);
}

.comment-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.comment-save-btn,
.comment-cancel-edit-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.comment-save-btn {
    background: var(--reddit-blue);
    color: white;
}

.comment-save-btn:hover {
    background: #0066b8;
    box-shadow: 0 2px 8px rgba(0, 121, 211, 0.3);
}

.comment-cancel-edit-btn {
    background: var(--reddit-bg-light);
    color: var(--text-secondary);
}

.comment-cancel-edit-btn:hover {
    background: #e0e0e0;
}

[data-theme="dark"] .comment-edit-textarea {
    background: var(--reddit-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .comment-cancel-edit-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== RESPONSIVE - MODERN ===== */
@media (max-width: 960px) {
    .sidebar {
        display: none;
    }
    
    .main-feed {
        max-width: 100%;
    }
    
    .site-content {
        padding: 0 var(--space-12);
    }
}

@media (max-width: 960px) {
    .sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }
    
    body {
        font-size: 13px;
    }
    
    .site-content {
        padding: 0;
        margin: var(--space-12) 0;
    }
    
    .header-container {
        padding: 0 var(--space-12);
    }
    
    .search-bar {
        display: none;
    }
    
    .main-nav {
        display: none;
    }
    
    .sidebar {
        display: none;
    }
    
    .header-left {
        gap: var(--space-12);
    }
    
    .site-logo img {
        height: 28px;
    }
    
    .btn-add-post span:last-child {
        display: none;
    }
    
    .post-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        margin: 0 !important;
    }
    
    .post-card:first-child {
        border-top: 1px solid var(--reddit-border-light);
    }
    
    .posts-feed {
        gap: 0 !important;
    }
    
    .post-vote-column {
        min-width: 40px;
        padding: var(--space-8) var(--space-4);
    }
    
    .vote-arrow {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .post-body {
        padding: var(--space-12);
    }
    
    .post-title {
        font-size: 16px;
    }
    
    .post-author-avatar {
        width: 24px;
        height: 24px;
    }
    
    .post-media {
        max-height: 400px;
    }
    
    .sort-bar {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 0;
    }
    
    .action-btn {
        padding: var(--space-4) var(--space-8);
        font-size: 11px;
    }
    
    .action-btn .icon {
        font-size: 16px;
    }
    
    .modal {
        padding: 0;
    }
    
    .modal-content {
        border-radius: 0;
        max-height: 100vh;
        width: 100%;
    }
    
    .login-modal-image {
        height: 150px;
    }
    
    /* Адаптивность контента на планшетах */
    .single-post-content .post-text {
        max-width: 100%;
    }
    
    .post-text {
        font-size: 16px;
    }
    
    .post-text h1 { font-size: 28px; }
    .post-text h2 { font-size: 24px; }
    .post-text h3 { font-size: 20px; }
    .post-text h4 { font-size: 18px; }
    
    .post-text ul,
    .post-text ol {
        padding-left: 1.5em;
    }
    
    .post-text table {
        font-size: 14px;
    }
    
    .post-text pre {
        padding: 1em;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .post-excerpt-short,
    .post-excerpt {
        font-size: 13px;
    }
    
    .post-actions {
        gap: 0;
    }
    
    .action-btn span:not(.icon) {
        display: none;
    }
    
    .sort-btn {
        padding: var(--space-6) var(--space-12);
        font-size: 12px;
    }
}

/* ===== AJAX PAGINATION ===== */
.ajax-pagination {
    margin-top: var(--space-16);
}

.ajax-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: var(--reddit-white);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--reddit-border-light);
    transition: all 0.2s ease;
}

.ajax-pagination a:hover {
    background: var(--reddit-blue);
    color: white;
    border-color: var(--reddit-blue);
    box-shadow: 0 2px 8px rgba(0, 121, 211, 0.2);
}

.ajax-pagination .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: var(--reddit-blue);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid var(--reddit-blue);
}

.ajax-pagination .dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--text-tertiary);
}

/* ===== NO POSTS MESSAGE ===== */
.no-posts {
    background-color: var(--reddit-white);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-24);
    text-align: center;
}

.no-posts h2 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: var(--space-12);
    color: var(--text-primary);
}

.no-posts p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-16);
}

/* ===== СТИЛИ ДЛЯ КОНТЕНТА БОЛЬШИХ ПОСТОВ ===== */

.single-post-content .post-text {
    max-width: 720px;
    margin-left: 0;
    margin-right: auto;
}

/* Параграфы */
.post-text p {
    margin-bottom: 1.5em;
    line-height: 1.8;
    font-size: 17px;
    color: var(--text-primary);
}

.post-text p:last-child {
    margin-bottom: 0;
}

/* Заголовки внутри контента */
.post-text h1, 
.post-text h2, 
.post-text h3, 
.post-text h4, 
.post-text h5, 
.post-text h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: var(--text-primary);
}

.post-text h1:first-child,
.post-text h2:first-child,
.post-text h3:first-child {
    margin-top: 0;
}

.post-text h1 { font-size: 32px; }
.post-text h2 { font-size: 28px; }
.post-text h3 { font-size: 24px; }
.post-text h4 { font-size: 20px; }
.post-text h5 { font-size: 18px; }
.post-text h6 { font-size: 16px; }

/* Списки */
.post-text ul,
.post-text ol {
    margin: 1.5em 0;
    padding-left: 2em;
    line-height: 1.8;
}

.post-text ul {
    list-style-type: disc;
}

.post-text ol {
    list-style-type: decimal;
}

.post-text li {
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

.post-text li:last-child {
    margin-bottom: 0;
}

.post-text li > ul,
.post-text li > ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Цитаты */
.post-text blockquote {
    margin: 2em 0;
    padding: 1.25em 1.5em;
    border-left: 4px solid var(--reddit-blue);
    background: var(--reddit-bg-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-text blockquote p {
    margin-bottom: 0.75em;
}

.post-text blockquote p:last-child {
    margin-bottom: 0;
}

.post-text blockquote cite {
    display: block;
    margin-top: 1em;
    font-size: 0.9em;
    font-style: normal;
    color: var(--text-tertiary);
}

/* Ссылки */
.post-text a {
    color: var(--reddit-blue);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.post-text a:hover {
    color: #0066b8;
    text-decoration-thickness: 2px;
}

/* Изображения в тексте */
.post-text img {
    max-width: 100%;
    width: 100%; /* Растягиваем на всю ширину */
    height: auto;
    display: block;
    margin: 2em auto;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-text a img {
    cursor: pointer;
}

.post-text figure {
    margin: 2em 0;
}

.post-text figure img {
    margin-bottom: 0.5em;
}

.post-text figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--text-tertiary);
    font-style: italic;
    margin-top: 0.5em;
}

/* Код */
.post-text code {
    background: var(--reddit-bg-light);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
    color: #e74c3c;
}

.post-text pre {
    background: var(--reddit-bg-light);
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-md);
    padding: 1.25em;
    margin: 2em 0;
    overflow-x: auto;
    line-height: 1.6;
}

.post-text pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 14px;
}

/* Таблицы */
.post-text table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
    font-size: 15px;
}

.post-text table thead {
    background: var(--reddit-bg-light);
}

.post-text table th,
.post-text table td {
    padding: 0.75em 1em;
    border: 1px solid var(--reddit-border);
    text-align: left;
}

.post-text table th {
    font-weight: 700;
    color: var(--text-primary);
}

.post-text table td {
    color: var(--text-secondary);
}

.post-text table tr:hover {
    background: var(--reddit-bg-light);
}

/* Горизонтальная линия */
.post-text hr {
    border: none;
    border-top: 2px solid var(--reddit-border-light);
    margin: 3em 0;
}

/* Выделение текста */
.post-text mark {
    background: #fff3cd;
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

.post-text strong,
.post-text b {
    font-weight: 700;
    color: var(--text-primary);
}

.post-text em,
.post-text i {
    font-style: italic;
}

/* WordPress блоки */
.post-text .wp-block-quote {
    margin: 2em 0;
    padding: 1.25em 1.5em;
    border-left: 4px solid var(--reddit-blue);
    background: var(--reddit-bg-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.post-text .wp-block-image {
    margin: 2em 0;
    width: 100%;
}

.post-text .wp-block-image img {
    width: 100% !important; /* Растягиваем на всю ширину */
    height: auto !important;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.post-text .wp-block-embed {
    margin: 2em 0;
}

.post-text .wp-block-video {
    margin: 2em 0;
}

.post-text .wp-block-video video {
    border-radius: var(--radius-md);
    width: 100%;
}

/* Галереи */
.post-text .wp-block-gallery {
    margin: 2em 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-12);
}

.post-text .wp-block-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* Тёмная тема для контента */
[data-theme="dark"] .post-text blockquote {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--reddit-blue);
}

[data-theme="dark"] .post-text code {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

[data-theme="dark"] .post-text pre {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .post-text mark {
    background: #4a4a00;
    color: #ffeb3b;
}

[data-theme="dark"] .post-text table thead {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .post-text table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ===== USER BLOCK BUTTON ===== */
.user-block-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--reddit-border);
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-block-btn:hover {
    background: #ff4444;
    border-color: #ff4444;
    color: white;
    opacity: 0.9;
}

.user-block-btn.blocked {
    background: var(--reddit-border-light);
    border-color: var(--reddit-border);
    color: var(--text-secondary);
}

.user-block-btn.blocked:hover {
    background: var(--reddit-blue);
    border-color: var(--reddit-blue);
    color: white;
}

.user-block-btn.blocking {
    opacity: 0.5;
    cursor: wait;
}

/* Большая кнопка блокировки на странице профиля */
.user-block-btn-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-block-btn-profile:hover {
    background: rgba(255, 68, 68, 0.9);
    border-color: white;
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

.user-block-btn-profile.blocked {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

.user-block-btn-profile.blocked:hover {
    background: rgba(76, 175, 80, 0.9);
    border-color: white;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.user-block-btn-profile.blocking {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

.user-block-btn-profile i {
    font-size: 16px;
}

[data-theme="dark"] .user-block-btn {
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .user-block-btn.blocked {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* HIDDEN UTILITY ===== */
.hidden {
    display: none !important;
}

/* ===== LOADING SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg, var(--reddit-bg-light) 25%, var(--reddit-border-light) 50%, var(--reddit-bg-light) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

.skeleton-post {
    height: 200px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
}

/* ===== SELECTION COLOR ===== */
::selection {
    background-color: var(--reddit-blue);
    color: white;
}

::-moz-selection {
    background-color: var(--reddit-blue);
    color: white;
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-4) !important; }
.mb-2 { margin-bottom: var(--space-8) !important; }
.mb-3 { margin-bottom: var(--space-12) !important; }
.mb-4 { margin-bottom: var(--space-16) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--space-4) !important; }
.mt-2 { margin-top: var(--space-8) !important; }
.mt-3 { margin-top: var(--space-12) !important; }
.mt-4 { margin-top: var(--space-16) !important; }

/* ===== COMMENT VOTING (LIKE/DISLIKE) ===== */

.comment-vote-buttons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
    background: var(--reddit-bg-light);
    border: 1px solid var(--reddit-border-light);
    border-radius: 20px;
    padding: 4px 8px;
}

.comment-vote-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: var(--text-tertiary);
    font-size: 14px;
    line-height: 1;
}

.comment-vote-btn:hover:not(:disabled) {
    background: rgba(0, 121, 211, 0.1);
    color: var(--reddit-blue);
}

.comment-vote-btn.upvote.active {
    color: #ff4500;
}

.comment-vote-btn.downvote.active {
    color: #7193ff;
}

.comment-vote-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.comment-score {
    font-weight: 600;
    font-size: 13px;
    min-width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.comment-score.positive {
    color: #ff4500;
}

.comment-score.negative {
    color: #7193ff;
}

/* Low score comments (downvoted) - Make them semi-transparent */
.comment.comment-low-score {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.comment.comment-low-score:hover {
    opacity: 0.8;
}

.comment.comment-low-score .comment-content {
    color: var(--text-tertiary);
}

/* Dark theme for comment voting */
[data-theme="dark"] .comment-vote-buttons {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .comment-vote-btn {
    color: #999;
}

[data-theme="dark"] .comment-vote-btn:hover:not(:disabled) {
    background: rgba(0, 121, 211, 0.2);
    color: var(--reddit-blue);
}

[data-theme="dark"] .comment-score {
    color: #b8b8b8;
}

[data-theme="dark"] .comment.comment-low-score {
    opacity: 0.4;
}

[data-theme="dark"] .comment.comment-low-score:hover {
    opacity: 0.7;
}

/* ===== COPY COMMENT LINK BUTTON ===== */

.comment-link-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.comment-link-btn:hover {
    background: rgba(0, 121, 211, 0.1);
    color: var(--reddit-blue);
}

.comment-link-btn.copied {
    color: #48bb78;
    background: rgba(72, 187, 120, 0.1);
}

.comment-link-btn i {
    font-size: 12px;
}

/* Dark theme */
[data-theme="dark"] .comment-link-btn {
    color: #999;
}

[data-theme="dark"] .comment-link-btn:hover {
    background: rgba(0, 121, 211, 0.2);
    color: var(--reddit-blue);
}

[data-theme="dark"] .comment-link-btn.copied {
    color: #48bb78;
    background: rgba(72, 187, 120, 0.15);
}

/* ===== ПАГИНАЦИЯ ===== */

.pagination {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

.pagination ul.page-numbers {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: var(--reddit-white);
    color: var(--text-primary);
    border: 1px solid var(--reddit-border-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination .page-numbers:hover {
    background: var(--reddit-bg-light);
    border-color: var(--reddit-blue);
    color: var(--reddit-blue);
}

.pagination .page-numbers.current {
    background: var(--reddit-blue);
    color: white;
    border-color: var(--reddit-blue);
    cursor: default;
}

.pagination .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    min-width: 40px;
}

.pagination .page-numbers i {
    font-size: 12px;
}

/* Dark theme */
[data-theme="dark"] .pagination .page-numbers {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

[data-theme="dark"] .pagination .page-numbers:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--reddit-blue);
}

[data-theme="dark"] .pagination .page-numbers.current {
    background: var(--reddit-blue);
    border-color: var(--reddit-blue);
}
