/*
 * FreeChan - Anonymous Social Media
 * Main Stylesheet
 * Combined CSS file with all styles
 */

/* ===== TABLE OF CONTENTS =====
 * 1. RESET AND BASE STYLES
 * 2. LAYOUT SYSTEM
 * 3. NAVBAR STYLES
 * 4. SIDEBAR STYLES
 * 5. CONTENT AREA STYLES
 * 6. POST STYLES
 * 7. COMMENT STYLES
 * 8. MODAL STYLES
 * 9. FORM STYLES
 * 10. BUTTON STYLES
 * 11. UTILITY CLASSES
 * 12. DARK MODE STYLES
 * 13. MOBILE SIDEBAR STYLES
 * 14. TRENDING CHANNELS STYLES
 * 15. BLOCKQUOTE STYLES
 */

/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: #333;
    background-color: #f0f2f5;
    padding-top: 45px; /* Adjusted to match navbar height */
    padding-bottom: 20px; /* Added bottom padding */
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    min-width: 1000px; /* Fixed minimum width */
}

/* Theme transition class for smooth animations */
body.theme-transition {
    transition: background-color 0.5s ease, color 0.5s ease;
}

body.theme-transition * {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

a {
    text-decoration: none;
    color: #4a76a8;
}

ul {
    list-style: none;
}

/* Custom horizontal rule */
hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(74, 118, 168, 0.5), rgba(0, 0, 0, 0));
    margin: 15px 0;
}

.hidden {
    display: none !important;
}

/* ===== LAYOUT SYSTEM ===== */
/* App container */
.app-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    margin-top: 10px; /* Smart margin-top */
    padding-top: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Security Alert Styles */
.security-alert {
    background-color: #f44336; /* Red background */
    color: white;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.security-alert i {
    font-size: 18px;
    margin-right: 10px;
    color: #ffeb3b; /* Yellow icon */
}

.security-alert .alert-content {
    flex: 1;
}

.security-alert h3 {
    margin: 0 0 2px 0;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.security-alert p {
    margin: 0;
    font-size: 12px;
}

/* Adjust margin-top based on screen size */
@media (min-width: 1001px) {
    .app-container {
        margin-top: 15px; /* Slightly larger on bigger screens */
    }
}

@media (max-width: 650px) {
    .app-container {
        margin-top: 5px; /* Smaller on mobile */
    }
}

/* Main container with perfect column alignment */
.main-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 5px auto; /* Further reduced from 10px to 5px */
    padding: 0 20px 40px 20px; /* Added bottom padding of 40px */
    box-sizing: border-box;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

/* When hamburger is visible, ensure main container uses full width */
@media (max-width: 1016px) {
    .main-container {
        max-width: 100%;
        padding: 0 10px 40px 10px;
    }
}

/* Column assignments */
.left-sidebar {
    width: 220px; /* Reduced from 250px to 220px */
    flex: 0 0 220px;
}

/* Make sidebars narrower on wider screens */
@media (min-width: 1001px) {
    .left-sidebar {
        width: 200px;
        flex: 0 0 200px;
    }
}

.content-area {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 480px); /* Increased from 540px to 480px to make it wider */
}

/* Make content area wider on wider screens */
@media (min-width: 1017px) {
    .content-area {
        max-width: calc(100% - 440px); /* Further increased to make it even wider */
    }
}

/* When hamburger is visible, content area uses full width */
@media (max-width: 1016px) {
    .content-area {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 5px;
    }
}

.right-sidebar {
    width: 220px; /* Reduced from 250px to 220px */
    flex: 0 0 220px;
}

/* Make right sidebar narrower on wider screens */
@media (min-width: 1001px) {
    .right-sidebar {
        width: 200px;
        flex: 0 0 200px;
    }
}

/* Responsive adjustments */
@media (min-width: 1201px) {
    .main-container {
        padding: 0 30px;
    }
}

@media (min-width: 801px) and (max-width: 1200px) {
    .main-container {
        padding: 0 20px;
    }
}

/* Prevent horizontal scrolling on smaller screens */
@media (max-width: 1000px) {
    body {
        min-width: auto;
        width: 100%;
        overflow-x: hidden;
    }

    .main-container {
        width: 100%;
        padding: 0 10px;
    }
}

/* Layout for screens larger than 1016px - show all three columns */
@media (min-width: 1016px) {
    .main-container {
        padding: 0 2%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }

    .left-sidebar {
        width: 200px;
        flex: 0 0 200px;
        display: block !important;
    }

    .right-sidebar {
        width: 200px;
        flex: 0 0 200px;
        display: block !important;
    }

    .content-area {
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 420px);
    }

    /* Hide hamburger menu on large screens */
    .nav-mobile-toggle {
        display: none !important;
    }
}

/* Layout for screens smaller than 1016px - hide sidebars, show hamburger */
@media (max-width: 1015px) {
    .main-container {
        display: flex;
        flex-direction: column;
        padding: 0 2% 40px 2%;
        width: 100%;
        align-items: center;
    }

    .content-area {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    /* Hide sidebars on smaller screens */
    .left-sidebar,
    .right-sidebar {
        display: none !important;
    }

    /* Show hamburger menu on smaller screens */
    .nav-mobile-toggle {
        display: block !important;
    }

    /* Ensure all content inside content-area has consistent width */
    .feed-filters,
    .section-header,
    .create-post-card,
    .filter-tabs,
    .no-posts-message,
    .empty-state {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Ensure post container has consistent width */
    #posts-container {
        width: 100%;
    }
}

/* ===== NAVBAR STYLES ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #4a76a8;
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    height: 45px; /* Increased from 35px to 45px */
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    padding: 0 10px;
}

.navbar.scrolled {
    height: 50px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
    height: 100%;
}

.nav-logo a {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.nav-logo a:hover {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Search styles */
.nav-search {
    flex: 1;
    max-width: 300px;
    margin: 0 20px;
    position: relative;
}

@media (min-width: 920px) {
    .nav-search {
        max-width: 400px;
    }
}

@media (min-width: 1200px) {
    .nav-search {
        max-width: 500px;
    }
}

@media (min-width: 1600px) {
    .nav-search {
        max-width: 600px;
    }
}

@media (max-width: 780px) {
    .nav-search {
        max-width: 250px;
        margin: 0 10px;
    }
}

@media (max-width: 700px) {
    .nav-search {
        max-width: 200px;
        margin: 0 5px;
    }
}

.nav-search form {
    display: flex;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    z-index: 10;
}

.nav-search input {
    width: 100%;
    padding: 6px 30px 6px 35px;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    background-color: rgba(0, 0, 0, 0.2) !important;
    color: white !important;
    transition: all 0.3s ease;
    box-shadow: none;
    height: 32px;
    box-sizing: border-box;
}

.nav-search input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    font-style: italic;
}

.search-clear {
    position: absolute;
    right: 10px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px;
    z-index: 10;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.search-clear:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.nav-search input:focus {
    background-color: rgba(0, 0, 0, 0.3);
    outline: none;
    box-shadow: none;
}

/* Search results dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.search-results-header {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Close search button removed */

.search-results-list {
    padding: 10px 0;
}

.search-category-header {
    padding: 5px 15px;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    background-color: #f5f5f5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.search-error, .no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

.search-error i, .no-results i {
    font-size: 24px;
    color: #999;
    margin-bottom: 10px;
}

.search-error p, .no-results p {
    margin: 0;
    font-size: 14px;
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-item-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f9f9f9;
}

.search-result-item.exact-match {
    background-color: #f0f7ff;
}

.search-result-item .channel-star {
    color: #ffc107;
    margin-right: 5px;
}

.search-result-item .channel-star.top-result {
    color: #ff9800;
    font-size: 1.1em;
}

.search-result-item.top-result {
    background-color: #fffbf0;
    border-left: 3px solid #ff9800;
    padding-left: 12px;
}

.search-result-item .search-result-link {
    font-weight: 600;
    color: #4a76a8;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.search-result-item .post-count {
    font-size: 0.8rem;
    color: #888;
    margin-top: 3px;
    display: block;
}

.no-results, .search-error {
    padding: 20px;
    text-align: center;
    color: #888;
}

.no-results i, .search-error i {
    margin-right: 5px;
    font-size: 1.1rem;
}

.search-error i {
    color: #e74c3c;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #888;
}

.search-loading i {
    margin-right: 5px;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-link {
    color: white;
    padding: 0 18px;
    position: relative;
    height: 45px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link i {
    margin-right: 5px;
}

/* Fix for theme toggle icon to prevent layout shift */
#theme-toggle {
    width: 40px;
    text-align: center;
}

#theme-toggle i {
    margin-right: 0;
    transition: transform 0.3s ease;
}

/* Notification badge removed */

.nav-mobile-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Show hamburger menu at exactly 1016px and below */
@media (max-width: 1016px) {
    .nav-mobile-toggle {
        display: block !important;
    }

    /* Hide theme toggle in navbar */
    #theme-toggle, .nav-link#theme-toggle {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #4a76a8;
        flex-direction: column;
        align-items: flex-start;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    body.dark-mode .nav-links {
        background-color: #1e1e1e;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    .nav-search {
        max-width: none;
        margin: 0 10px;
    }

    /* Hide sidebars on mobile when hamburger menu is shown */
    .left-sidebar,
    .right-sidebar {
        display: none !important;
    }

    .content-area {
        width: 100%;
        margin: 0;
    }

    /* Main container should be column layout */
    .main-container {
        flex-direction: column;
    }
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(209, 217, 230, 0.8);
    padding: 18px;
    position: sticky;
    top: 55px;
    max-height: 700px; /* Default height */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Show sidebars only on screens wider than 1016px */
@media (min-width: 1017px) {
    /* Show sidebars on larger screens (but not when hamburger is shown) */
    .left-sidebar,
    .right-sidebar {
        display: block !important;
    }
}

@media (min-width: 1017px) {
    /* Use flexbox to ensure equal height columns */
    .main-container {
        display: flex;
        min-height: 500px;
        align-items: stretch;
    }

    .sidebar {
        max-height: none; /* Remove max-height constraint */
        height: auto; /* Let content determine height */
        min-height: 500px; /* Minimum height */
        flex: 1;
    }

    /* Explicitly set sidebar widths */
    .left-sidebar, .right-sidebar {
        width: 240px !important;
        flex: 0 0 240px !important;
        max-width: 240px !important;
    }

    .content-area {
        min-height: 500px;
        flex: 1;
        display: flex;
        flex-direction: column;
        max-width: calc(100% - 520px) !important; /* Even narrower content area */
        min-width: 45% !important; /* Reduced from 50% to 45% */
    }

    /* Make view container fill the available space */
    .view-container {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* Make posts container fill the available space */
    #posts-container {
        flex: 1;
    }
}

.sidebar-section {
    margin-bottom: 25px;
    margin-top: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(238, 238, 238, 0.6);
    margin-top: 0;
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #4a76a8;
    border-radius: 2px;
}

.sidebar-header i {
    margin-right: 10px;
    color: #4a76a8;
    font-size: 1.2rem;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #555;
    background-color: #f8f9fa;
    border: 1px solid rgba(224, 224, 224, 0.6);
    font-weight: 500;
}

.sidebar-menu li a:hover, .sidebar-menu li.active a {
    background-color: #e6f2ff;
    color: #4a76a8;
    border-color: rgba(74, 118, 168, 0.5);
    font-weight: 600;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 118, 168, 0.1);
}

.sidebar-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-menu li.active a {
    font-weight: 600;
}

.trending-channels li, .user-suggestions li {
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.trending-channels li:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.trending-channels li:first-child, .user-suggestions li:first-child {
    border-top: none;
}

.user-channels li {
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    position: relative;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.user-channels li.no-channels {
    padding: 15px 0;
    justify-content: center;
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
}

.user-channels li.no-channels span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-channels li.no-channels i {
    color: #aaa;
}

.user-channels li:first-child {
    border-top: none;
}

.user-channels li a {
    display: flex;
    align-items: center;
    color: #555;
    background-color: transparent;
    border: none;
}

.user-channels li a i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
    color: #777;
    transition: transform 0.3s ease;
}

.user-channels li a:hover i {
    transform: translateX(2px);
}

#clear-history, #mobile-clear-history {
    margin: 10px auto;
    font-size: 0.9rem;
    padding: 8px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #F44336;
    background-color: rgba(244, 67, 54, 0.05);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

#clear-history:hover, #mobile-clear-history:hover {
    background-color: rgba(244, 67, 54, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(244, 67, 54, 0.1);
}

#clear-history i, #mobile-clear-history i {
    margin-right: 8px;
}

#clear-history-container, #mobile-clear-history-container {
    margin-bottom: 15px;
    text-align: center;
}

.trend-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.trend-rank {
    width: 24px;
    height: 24px;
    background-color: #f0f0f0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: #555;
    margin-right: 10px;
}

.trend-details {
    display: flex;
    flex-direction: column;
}

.trend-details a {
    font-weight: 600;
    margin-bottom: 2px;
}

.trend-stats {
    font-size: 0.75rem;
    color: #888;
}

.channel-count {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
}

.channel-count i.fa-arrow-up {
    color: #2ecc71;
}

.channel-count i.fa-arrow-down {
    color: #e74c3c;
}

.channel-count i.fa-minus {
    color: #888;
}

.see-more {
    display: block;
    text-align: center;
    padding: 8px 0;
    color: #4a76a8;
    font-size: 0.9rem;
    font-weight: 500;
}

.see-more i {
    font-size: 0.7rem;
    margin-left: 5px;
}

/* Rules section */
.rules-section {
    margin-bottom: 20px;
}

.rules-content {
    padding: 0 15px;
}

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

.rules-list li {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
    padding-left: 5px;
    border-left: 3px solid #4CAF50;
    padding-bottom: 5px;
}

.rules-list li strong {
    display: block;
    margin-bottom: 3px;
    color: #4CAF50;
}

body.dark-mode .rules-list li strong {
    color: #64b5f6;
}

body.dark-mode .rules-list li {
    border-left-color: #64b5f6;
}

/* Mobile rules list */
.mobile-rules-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.mobile-rules-list li {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
    padding-left: 5px;
    border-left: 3px solid #4CAF50;
    padding-bottom: 5px;
}

.mobile-rules-list li strong {
    display: block;
    margin-bottom: 3px;
    color: #4CAF50;
}

body.dark-mode .mobile-rules-list li strong {
    color: #64b5f6;
}

body.dark-mode .mobile-rules-list li {
    border-left-color: #64b5f6;
}

.sidebar-footer {
    margin-top: 30px;
    padding-top: 15px;
    position: relative;
}

.sidebar-footer .custom-divider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    justify-content: center;
}

.footer-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.footer-links a {
    font-size: 0.8rem;
    color: #888;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    background-color: #f0f0f0;
    color: #4a76a8;
}

body.dark-mode .footer-links a:hover {
    background-color: #333;
    color: #64b5f6;
}

body.dark-mode .footer-links a {
    color: #aaa;
}

body.dark-mode .copyright {
    color: #888;
    border-top-color: rgba(255, 255, 255, 0.1);
}

.copyright {
    font-size: 0.75rem;
    color: #999;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    text-align: center;
}

/* When hamburger icon is visible (below 1016px) */
@media (max-width: 1016px) {
    /* Hide sidebars and theme toggle whenever hamburger is visible */
    .left-sidebar,
    .right-sidebar {
        display: none !important;
    }

    #theme-toggle, .theme-toggle {
        display: none !important;
    }

    /* Make content area use full width */
    .content-area {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Show hamburger menu */
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* No longer needed - consolidated with the media query above */

/* Small screens (below 600px) */
@media (max-width: 600px) {
    .main-container {
        padding: 0 2%;
        width: 100% !important;
    }

    .content-area {
        padding: 0 !important;
    }

    .view-container,
    .sidebar,
    .post {
        border-radius: 8px;
    }
}

/* Very small screens (below 400px) */
@media (max-width: 400px) {
    body {
        font-size: 0.9rem;
    }

    .main-container {
        padding: 0 8px;
    }

    .sidebar, .content-area, .view-container {
        padding: 12px;
    }

    .post {
        padding: 12px;
    }

    .filter-tabs {
        gap: 5px;
    }

    .filter-tab {
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    .post-actions {
        gap: 10px;
    }

    /* Further adjustments for create post modal on very small screens */
    #create-post-modal .form-row {
        gap: 8px;
    }

    #create-post-modal .form-group label {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }

    #create-post-modal input[type="text"] {
        font-size: 0.85rem;
        padding: 7px 10px;
    }

    #create-post-modal .input-prefix {
        font-size: 0.85rem;
        left: 10px;
    }

    #create-post-modal .input-with-prefix input {
        padding-left: 25px !important;
    }
}

/* Center align sidebar content on smaller screens */
@media (max-width: 700px) {
    .sidebar-header {
        justify-content: center;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .sidebar-header i {
        margin-right: 0;
        margin-bottom: 5px;
        font-size: 1.2rem;
    }

    .sidebar-header h3 {
        text-align: center;
        width: 100%;
    }

    .sidebar-menu li a {
        justify-content: center;
        text-align: center;
    }

    .sidebar-menu li a i {
        margin-right: 5px;
    }

    .user-channels {
        text-align: center;
    }

    .user-channels li {
        text-align: center;
        display: block;
        margin: 8px 0;
    }

    .user-channels li a {
        justify-content: center;
        text-align: center;
        display: inline-flex;
        align-items: center;
    }

    .user-channels li a i {
        margin-right: 5px;
    }

    .trending-channels li {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 10px 0;
    }

    .trend-info {
        flex-direction: column;
        align-items: center;
        margin-bottom: 5px;
    }

    .trend-rank {
        margin-right: 0;
        margin-bottom: 5px;
    }

    .trend-details {
        align-items: center;
        text-align: center;
    }

    .sidebar-footer {
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .btn-fancy, .btn-outline, #create-channel {
        margin: 10px auto;
        display: block;
        max-width: 200px;
        text-align: center;
    }
}

/* ===== CONTENT AREA STYLES ===== */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    margin-top: 0;
}

/* Ensure content area is properly sized on larger screens */
@media (min-width: 1001px) {
    .content-area {
        max-width: calc(100% - 520px); /* Match the width from above */
    }

    /* Ensure all columns are aligned at the top */
    .main-container {
        align-items: flex-start;
    }
}

/* View container styles */
.view-container {
    width: 100%;
    box-sizing: border-box;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(209, 217, 230, 0.8);
    overflow: hidden;
    padding: 18px;
    margin-top: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    position: relative;
}

.view-container .section-header {
    margin-top: 0;
}

.section-header h2 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.section-header p {
    color: #666;
    font-size: 0.9rem;
}

/* Header controls for back button and chat icon */
.header-controls {
    display: flex;
    align-items: center;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 10 !important;
}

.header-controls .feed-chat-icon {
    margin-right: 10px !important;
    order: 1 !important; /* Ensure chat icon is first (left) */
}

.header-controls #back-to-all {
    order: 2 !important; /* Ensure back button is second (right) */
    position: static !important; /* Override the absolute positioning */
    right: auto !important;
    top: auto !important;
}

/* ===== BUTTON STYLES ===== */
.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small:hover {
    background-color: #3a5a80;
    transform: translateY(-1px);
}

.btn-small i {
    margin-right: 5px;
}

.btn-fancy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 0;
    background-color: #f0f7ff;
    color: #4a76a8;
    border: 1px solid #d0e3ff;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px auto;
}

.btn-fancy:hover {
    background-color: #e0f0ff;
    transform: translateY(-1px);
}

.btn-fancy i {
    margin-right: 8px;
}

.btn-outline {
    padding: 5px 10px;
    font-size: 0.8rem;
    background-color: transparent;
    color: #4a76a8;
    border: 1px solid #4a76a8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background-color: #f0f7ff;
}

.btn-primary {
    background-color: #4a76a8;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(74, 118, 168, 0.2);
}

.btn-primary:hover {
    background-color: #3a5a80;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(74, 118, 168, 0.3);
}

/* Back icon styling */
.back-icon,
#back-to-all {
    color: var(--theme-color, #4a76a8) !important; /* Match channel name color */
    font-size: 1.1rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    padding: 5px !important;
    z-index: 10 !important;
}

.back-icon:hover,
#back-to-all:hover {
    transform: translateY(-1px) !important;
    opacity: 0.8 !important;
}

/* Dark mode styling for back icon */
body.dark-mode .back-icon,
body.dark-mode #back-to-all {
    color: #ffffff !important; /* White color for back icons in dark mode */
}

/* ===== FEED STYLES ===== */
.create-post-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(209, 217, 230, 0.8);
    padding: 15px;
    margin-bottom: 20px;
}

.create-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
}

.create-post-input {
    flex: 1;
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 20px;
    padding: 10px 15px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.create-post-input textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: none;
    min-height: 60px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #333;
    outline: none;
    padding: 0;
}

.create-post-input:hover {
    background-color: #f0f0f0;
    border-color: #ddd;
}

.modal-card {
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 20px;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.modal-input {
    background-color: #f8f8f8;
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.modal-input textarea {
    min-height: 80px;
    font-size: 1rem;
}

.form-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.form-row {
    display: flex;
    gap: 15px;
    width: 100%;
    margin-bottom: 15px;
}

.form-row:last-child {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    /* Keep form-row as row in the create post modal */
    #create-post-modal .form-row {
        flex-direction: row;
        gap: 10px;
        align-items: flex-start;
    }

    /* Ensure form groups in the modal have appropriate widths */
    #create-post-modal .form-group {
        min-width: 0;
        width: auto;
    }

    /* Make channel input slightly smaller to fit better */
    #create-post-modal .form-group:first-child {
        flex: 0.8;
    }

    /* Make tags input slightly larger */
    #create-post-modal .form-group:nth-child(2) {
        flex: 1.2;
    }

    /* Adjust input sizes for better fit */
    #create-post-modal input[type="text"] {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    /* Adjust prefix position and size */
    #create-post-modal .input-prefix {
        font-size: 0.9rem;
        left: 12px;
    }

    #create-post-modal .input-with-prefix input {
        padding-left: 30px !important;
    }

    /* Apply column layout to other form-rows */
    .form-row:not(#create-post-modal .form-row) {
        flex-direction: column;
        gap: 10px;
    }
}

.form-group {
    flex: 1;
    min-width: 0;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
    background-color: #f9f9f9;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #4a76a8;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.1);
    background-color: #fff;
}

.form-group input[type="text"]:disabled {
    background-color: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 15px;
    color: #666;
    font-weight: 500;
}

.input-with-prefix input {
    padding-left: 35px !important;
}

.toggle-group {
    display: flex;
    flex-direction: column;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-top: 5px;
}

.toggle-switch input {
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 2;
    cursor: pointer;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
    z-index: 1;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4a76a8;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.create-post-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.create-post-actions .btn-primary {
    margin-left: auto;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
}

.modal-footer a {
    color: #4a76a8;
    text-decoration: none;
}

.modal-footer a:hover {
    text-decoration: underline;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: #e8e8e8;
    color: #4a76a8;
}

.action-btn i {
    font-size: 0.9rem;
}

.action-btn.active {
    background-color: #e6f2ff;
    border-color: #d0e3ff;
    color: #4a76a8;
}

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

.image-preview-wrapper {
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #eee;
    animation: fadeIn 0.3s ease;
}

.image-preview {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin-bottom: 5px;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-preview .remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background-color: #ff4d4d;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.image-preview .remove-image:hover {
    background-color: #ff3333;
    transform: scale(1.1);
}

.image-preview-caption {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    text-align: center;
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #4a76a8;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 118, 168, 0.25);
}

.submit-btn:hover {
    background-color: #3a5a80;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 118, 168, 0.3);
}

.submit-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.submit-btn:hover i {
    transform: translateX(3px);
}

.post-action-btn {
    flex: 1;
    padding: 8px 0;
    background-color: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 6px;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-action-btn i {
    margin-right: 5px;
}

.post-action-btn:hover {
    background-color: #f0f0f0;
    color: #4a76a8;
}

.post-action-btn.active, .action-btn.active {
    background-color: #e6f2ff;
    color: #4a76a8;
    border-color: #d0e3ff;
}

/* Style for photo button to match link button */
.photo-btn, .link-btn {
    background-color: #f8f8f8;
    color: #666;
    border: 1px solid #eee;
}

/* Style for photo button when active - same as link button */
.photo-btn.active {
    background-color: #e6f2ff;
    color: #4a76a8;
    border-color: #d0e3ff;
}

/* Dark mode styles for photo and link buttons */
body.dark-mode .photo-btn,
body.dark-mode .link-btn {
    background-color: #2a2a2a;
    color: #aaa;
    border-color: #444;
}

.feed-filters {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    position: relative;
}

.feed-filters .custom-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
}

.filter-tabs {
    display: flex;
    gap: 10px;
}

.filter-tab {
    padding: 6px 15px;
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 20px;
    color: #666;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-tab:hover, .filter-tab.active {
    background-color: #e6f2ff;
    color: #4a76a8;
    border-color: #d0e3ff;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.sort-options span {
    color: #666;
    font-size: 0.9rem;
}

body.dark-mode .sort-options span {
    color: #aaa;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    padding: 8px 15px;
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 20px;
    color: #4a76a8;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

body.dark-mode .dropdown-toggle {
    background-color: #2a2a2a;
    border-color: #444;
    color: #64b5f6;
}

.dropdown-toggle:hover {
    background-color: #e6f2ff;
    border-color: #d0e3ff;
}

body.dark-mode .dropdown-toggle:hover {
    background-color: #333;
    border-color: #555;
}

.dropdown-toggle i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.dropdown.open .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    margin-top: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

body.dark-mode .dropdown-menu {
    background-color: #2a2a2a;
    border-color: #444;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

body.dark-mode .dropdown-item {
    color: #aaa;
    border-bottom-color: #333;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover, .dropdown-item.active {
    background-color: #f5f5f5;
    color: #4a76a8;
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item.active {
    background-color: #333;
    color: #64b5f6;
}

/* Dark mode search results */
body.dark-mode .search-results {
    background-color: #222;
    border: 1px solid #333;
}

body.dark-mode .search-results-header {
    border-bottom-color: #333;
    color: #f0f0f0;
}

body.dark-mode .search-category-header {
    background-color: #2a2a2a;
    color: #aaa;
}

body.dark-mode .search-result-item {
    border-bottom-color: #333;
}

body.dark-mode .search-result-item:hover {
    background-color: #2a2a2a;
}

body.dark-mode .search-result-item.exact-match {
    background-color: #1e2a38;
}

body.dark-mode .search-result-item.top-result {
    background-color: #2a2a1e;
    border-left-color: #ffc107;
}

body.dark-mode .search-result-item .search-result-link {
    color: #64b5f6;
}

body.dark-mode .search-result-item .post-count {
    color: #aaa;
}

body.dark-mode .search-error i,
body.dark-mode .no-results i {
    color: #777;
}

body.dark-mode .search-error,
body.dark-mode .no-results {
    color: #aaa;
}

.dropdown-item i {
    color: #4a76a8;
    font-size: 0.9rem;
}

body.dark-mode .dropdown-item i {
    color: #64b5f6;
}

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

.post {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(209, 217, 230, 0.8);
    padding: 18px;
    transition: all 0.2s ease;
}

.post:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.post-header {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.post-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.post-channel {
    font-weight: 600;
    color: #4a76a8;
}

.post-author {
    color: #666;
    font-size: 0.9rem;
}

.post-author span {
    font-family: monospace;
    color: #888 !important;
    font-size: 0.85rem;
}

.anonymous-hash {
    font-family: monospace;
    color: #888 !important;
    font-size: 0.85rem;
    text-decoration: none !important;
    pointer-events: none;
    display: inline-block;
    border: none !important;
    background: none !important;
}

/* Style for user names in comments */
.user-name {
    color: #4a76a8;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Ensure no blue link styling for anonymous hash */
.anonymous-hash a,
.anonymous-hash a:hover,
.anonymous-hash a:visited,
.anonymous-hash a:active,
.comment-author .anonymous-hash,
.post-author .anonymous-hash {
    color: #888 !important;
    text-decoration: none !important;
    background: none !important;
    border: none !important;
}

.post-time {
    color: #999;
    font-size: 0.8rem;
}

.post-content {
    margin-bottom: 15px;
    line-height: 1.4; /* Reduced from 1.5 to 1.4 for less spacing */
    color: #333;
    word-break: break-word;
    position: relative; /* For read more/less positioning */
}

.post-content p {
    margin-bottom: 4px; /* Reduced from 6px to 4px for less spacing */
    line-height: 1.4; /* Slightly reduced line height */
}

/* Truncated content styles */
.content-truncated {
    max-height: 300px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: max-height 0.3s ease;
}

.content-truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 80%);
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Dark mode gradient */
body.dark-mode .content-truncated::after {
    background: linear-gradient(to bottom, rgba(32, 33, 36, 0) 0%, rgba(32, 33, 36, 0.9) 80%);
}

/* Remove the read-more-text and read-less-text styles as they won't be needed */

/* Reduce spacing between paragraphs when <br> tags are used */
.post-content br {
    display: block;
    content: "";
    margin-top: 0.3em; /* Reduced from 0.5em to 0.3em for less spacing */
}

/* Additional fixes for line breaks on mobile devices */
@media (max-width: 767px) {
  .post-content {
    line-height: 1.3; /* Even more reduced for mobile */
  }

  .post-content p {
    margin-bottom: 3px; /* Further reduced for mobile */
  }

  .post-content br {
    margin-top: 0.2em; /* Smaller spacing for mobile */
  }
}

/* Mobile-specific styles for create post buttons */
@media (max-width: 600px) {
  /* Make buttons more compact on mobile */
  .create-post-actions .action-btn,
  .modal-footer .action-btn {
    padding: 6px 8px;
    font-size: 12px;
    margin-right: 4px;
  }

  /* Specific styling for Photo Added state */
  .photo-btn.active,
  .modal-footer .photo-btn.active {
    padding: 6px 6px;
    font-size: 11px;
  }

  /* Reduce icon size */
  .create-post-actions .action-btn i,
  .modal-footer .action-btn i {
    font-size: 12px;
    margin-right: 2px;
  }

  /* Ensure buttons don't wrap text */
  .create-post-actions,
  .modal-footer {
    display: flex;
    justify-content: space-between;
  }

  /* Ensure submit button remains prominent */
  .submit-btn {
    padding: 8px 12px;
    font-size: 14px;
  }
}

.dark-mode .post-content {
    color: #f0f0f0;
}

.post-image {
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    max-height: 400px;
}

.post-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 400px;
    display: block;
}

.post-link {
    margin: 10px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #eee;
}

.post-link a {
    color: #4a76a8;
    word-break: break-all;
    font-weight: 500;
}

body.dark-mode .post-link {
    background-color: #2a2a2a;
    border-color: #444;
}

body.dark-mode .post-link a {
    color: #64b5f6;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.post-tag {
    background-color: #f0f7ff;
    color: #4a76a8;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid rgba(74, 118, 168, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-tag:hover {
    background-color: #e0f0ff;
    color: #3a5a80;
    border-color: rgba(74, 118, 168, 0.3);
    transform: translateY(-1px);
}

.post-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    position: relative;
}

.post-footer .custom-divider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
}

.post-actions {
    display: flex;
    gap: 15px;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #777;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-action.vote-up {
    color: #777;
}

.post-action.vote-down {
    color: #777;
}

.post-action.vote-up.voted {
    color: #4CAF50;
}

.post-action.vote-down.voted {
    color: #F44336;
}

.post-action:hover {
    color: #4a76a8;
}

.post-action i {
    font-size: 0.95rem;
}

/* ===== CUSTOM COMPONENTS ===== */
/* Empty state styling */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.empty-state i {
    font-size: 2.5rem;
    color: #4a76a8;
    margin-bottom: 15px;
    opacity: 0.8;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    color: #666;
    margin-bottom: 0; /* Removed margin since there's no button */
    font-size: 0.95rem;
    max-width: 300px;
}

/* No button in empty state */

body.dark-mode .empty-state {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: #333;
}

body.dark-mode .empty-state i {
    color: #64b5f6;
}

body.dark-mode .empty-state h3 {
    color: #f0f0f0;
}

body.dark-mode .empty-state p {
    color: #aaa;
}

/* No channels message */
.trending-channels .no-channels {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.02);
    margin: 10px 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.trending-channels .no-channels::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background-color: #4a76a8;
    border-radius: 2px;
}

.trending-channels .no-channels i {
    margin-right: 5px;
    color: #666;
}

/* Loading state */
.trending-channels .loading {
    padding: 15px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.trending-channels .loading i {
    margin-right: 5px;
    color: #666;
}

/* Error state */
.trending-channels .error {
    padding: 15px;
    text-align: center;
    color: #d32f2f;
    font-size: 0.9rem;
    background-color: rgba(211, 47, 47, 0.1);
    border-radius: 8px;
    margin: 10px 0;
}

.trending-channels .error i {
    margin-right: 5px;
    color: #d32f2f;
}

/* ===== BLOCKQUOTE STYLES ===== */
blockquote {
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #4a90e2 0%, #1976d2 100%);
    border-image-slice: 1;
    padding: 8px 12px;
    margin: 4px 0;
    background: linear-gradient(to right, rgba(74, 144, 226, 0.15), rgba(25, 118, 210, 0.05));
    border-radius: 6px 6px 6px 6px; /* Updated to have consistent border-radius on all corners */
    font-style: italic;
    color: #666;
    display: block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

/* Make sure blockquotes don't break the layout */
.post-content blockquote,
.comment-content blockquote {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    display: block;
    clear: both;
}

/* Ensure blockquotes don't replace other content */
.post-content p,
.comment-content p {
    display: block;
    width: 100%;
}

/* Reduce spacing between blockquotes and other content */
.post-content blockquote + br,
.comment-content blockquote + br {
    display: block;
    content: "";
    margin-top: 4px;
}

/* Reduce spacing after blockquotes */
.post-content blockquote,
.comment-content blockquote {
    margin-bottom: 4x;
}

/* Dark mode styling with adjusted colors */
.dark-mode blockquote {
    background: linear-gradient(to right, rgba(74, 144, 226, 0.2), rgba(25, 118, 210, 0.1));
    color: #f0f0f0; /* Changed from #e6f2ff to #f0f0f0 to match section header text in dark mode */
    border-image: linear-gradient(to bottom, #64b5f6 0%, #42a5f5 100%);
    border-image-slice: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Adjust blockquote spacing for mobile */
@media (max-width: 600px) {
    .post-content blockquote,
    .comment-content blockquote {
        margin: 1px 0; /* Reduced from 2px to 1px */
        padding: 6px 10px;
    }

    /* Reduce spacing after blockquotes */
    .post-content blockquote + br,
    .comment-content blockquote + br {
        margin-top: 1px; /* Reduced from 2px to 1px */
    }

    /* Keep existing paragraph and line break spacing */
    .post-content p,
    .comment-content p {
        margin-bottom: 2px;
    }

    .post-content br,
    .comment-content br {
        margin-top: 0.2em;
    }
}

/* ===== MOBILE SIDEBAR STYLES ===== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -320px; /* Start off-screen */
    width: 320px;
    height: 100%;
    z-index: 1010;
    transition: right 0.3s ease-in-out;
}

.mobile-sidebar.open {
    right: 0;
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; /* Removed dark background */
    z-index: 1009;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    pointer-events: none; /* This prevents the overlay from blocking interaction */
}

.mobile-sidebar.open .mobile-sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.mobile-sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.close-mobile-sidebar {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.close-mobile-sidebar:hover {
    color: #333;
}

.mobile-sidebar-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.mobile-nav-links li {
    margin-bottom: 15px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: #f5f5f5;
}

.mobile-nav-link i {
    margin-right: 15px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Fix for mobile theme toggle icon to prevent layout shift */
#mobile-theme-toggle i {
    transition: transform 0.3s ease;
}

.mobile-nav-link.active,
.mobile-nav-link:hover {
    background-color: #4a76a8;
    color: white;
}

.mobile-sidebar-divider {
    height: 1px;
    background-color: #eee;
    margin: 15px 0;
    position: relative;
}

.mobile-sidebar-divider::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 2px;
    background-color: #4a76a8;
}

.mobile-sidebar-section {
    margin-bottom: 25px;
}

.mobile-sidebar-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

.mobile-sidebar-menu,
.mobile-user-channels {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-sidebar-menu li,
.mobile-user-channels li {
    margin-bottom: 10px;
}

.mobile-discover-link,
.mobile-user-channels li a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: #f5f5f5;
}

.mobile-discover-link i,
.mobile-user-channels li a i {
    margin-right: 10px;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.mobile-discover-link:hover,
.mobile-user-channels li a:hover {
    background-color: #e9f0f8;
    color: #4a76a8;
}

/* Mobile clear history button with red styling to match desktop version */
#mobile-clear-history {
    margin: 10px auto;
    font-size: 0.9rem;
    padding: 8px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #F44336;
    background-color: rgba(244, 67, 54, 0.05);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

#mobile-clear-history:hover {
    background-color: rgba(244, 67, 54, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(244, 67, 54, 0.1);
}

#mobile-clear-history i {
    font-size: 0.8rem;
    margin-right: 8px;
}

.mobile-sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
}

.mobile-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.mobile-footer-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-footer-links a:hover {
    color: #4a76a8;
}

.mobile-copyright {
    color: #999;
    font-size: 0.8rem;
}

.mobile-copyright a {
    color: #4a76a8;
    text-decoration: none;
}

/* Dark mode styles for mobile sidebar */
body.dark-mode .mobile-sidebar-content {
    background-color: #222;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .mobile-sidebar-header {
    border-bottom-color: #333;
}

body.dark-mode .mobile-sidebar-header h3 {
    color: #f0f0f0;
}

body.dark-mode .close-mobile-sidebar {
    color: #aaa;
}

body.dark-mode .close-mobile-sidebar:hover {
    color: #f0f0f0;
}

body.dark-mode .mobile-nav-link {
    color: #f0f0f0;
    background-color: #2a2a2a;
}

body.dark-mode .mobile-nav-link.active,
body.dark-mode .mobile-nav-link:hover {
    background-color: #3a5a7c;
    color: #64b5f6;
}

body.dark-mode .mobile-sidebar-divider {
    background-color: #333;
}

body.dark-mode .mobile-sidebar-divider::after {
    background-color: #64b5f6;
}

body.dark-mode .mobile-sidebar-section h4 {
    color: #f0f0f0;
}

body.dark-mode .mobile-discover-link,
body.dark-mode .mobile-user-channels li a {
    color: #f0f0f0;
    background-color: #2a2a2a;
}

body.dark-mode .mobile-discover-link:hover,
body.dark-mode .mobile-user-channels li a:hover {
    background-color: #3a3a3a;
    color: #64b5f6;
}

/* Dark mode styles for mobile clear history button */
body.dark-mode #mobile-clear-history {
    background-color: rgba(244, 67, 54, 0.1);
    color: #ff6b6b;
    border-color: rgba(244, 67, 54, 0.3);
}

body.dark-mode #mobile-clear-history:hover {
    background-color: rgba(244, 67, 54, 0.15);
    color: #ff8a8a;
    box-shadow: 0 3px 8px rgba(244, 67, 54, 0.2);
}

body.dark-mode .mobile-sidebar-footer {
    border-top-color: #333;
}

body.dark-mode .mobile-footer-links a {
    color: #aaa;
}

body.dark-mode .mobile-footer-links a:hover {
    color: #64b5f6;
}

body.dark-mode .mobile-copyright {
    color: #777;
}

body.dark-mode .mobile-copyright a {
    color: #64b5f6;
}

/* ===== TRENDING CHANNELS STYLES ===== */
/* Trending channels styling */
.trending-channels li {
    display: flex;
    flex-direction: column;
}

.trending-channels li a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.trending-channels li a:hover {
    color: #4a76a8;
    transform: translateX(2px);
}

.trending-channels li a i {
    margin-right: 8px;
    color: #4a76a8;
    font-size: 0.9em;
    width: 16px;
    text-align: center;
    transition: transform 0.3s ease;
}

.trending-channels li a:hover i {
    transform: translateX(2px);
}

.trending-channels li .post-count {
    color: #888;
    font-size: 0.85em;
    margin-top: 4px;
    margin-left: 24px; /* Align with the text after the icon */
    transition: all 0.2s ease;
}

/* Dark mode styles */
body.dark-mode .trending-channels li a {
    color: #f0f0f0;
}

body.dark-mode .trending-channels li a:hover {
    color: #64b5f6;
}

body.dark-mode .trending-channels li a i {
    color: #64b5f6;
}

body.dark-mode .trending-channels li .post-count {
    color: #aaa;
}

body.dark-mode .trending-channels li:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Mobile styles */
@media (max-width: 700px) {
    .trending-channels li {
        text-align: center;
        padding: 10px 0;
    }

    .trending-channels li a {
        justify-content: center;
    }

    .trending-channels li .post-count {
        margin-left: 0;
        margin-top: 5px;
    }
}

/* ===== DARK MODE STYLES ===== */
body.dark-mode {
    background-color: #1a1a1a;
    color: #f0f0f0;
}

body.dark-mode .navbar {
    background-color: #1e1e1e;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .sidebar,
body.dark-mode .view-container,
body.dark-mode .search-results,
body.dark-mode .modal-content {
    background-color: #222;
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Dark mode search results styles */
body.dark-mode .search-results-header {
    border-bottom-color: #333;
    color: #f0f0f0;
}

body.dark-mode .search-results-header .close-search {
    color: #aaa;
}

body.dark-mode .search-results-header .close-search:hover {
    color: #f0f0f0;
}

body.dark-mode .search-result-item {
    border-bottom-color: #333;
    color: #f0f0f0;
}

body.dark-mode .search-result-item:hover {
    background-color: #2a2a2a;
}

body.dark-mode .search-result-item.exact-match {
    background-color: #1a2a3a;
}

body.dark-mode .search-result-item.exact-match:hover {
    background-color: #243242;
}

body.dark-mode .search-result-item.top-result {
    background-color: #2a2a1a;
    border-left-color: #ff9800;
}

body.dark-mode .search-result-item.top-result:hover {
    background-color: #333322;
}

body.dark-mode .search-result-item .search-result-link {
    color: #64b5f6;
}

body.dark-mode .search-result-item .post-count {
    color: #aaa;
}

body.dark-mode .no-results,
body.dark-mode .search-loading {
    color: #aaa;
}

body.dark-mode .search-error i {
    color: #ff4d4d;
}

body.dark-mode .sidebar-header,
body.dark-mode .section-header {
    border-color: #333;
}

body.dark-mode .sidebar-header h3,
body.dark-mode .section-header h2 {
    color: #f0f0f0;
}

body.dark-mode .section-header p {
    color: #ccc;
}

body.dark-mode .sidebar-menu li a,
body.dark-mode .user-channels li a {
    background-color: #2a2a2a;
    border-color: #444;
    color: #f0f0f0;
}

body.dark-mode .sidebar-menu li a:hover,
body.dark-mode .sidebar-menu li.active a {
    background-color: #3a5a7c;
    color: #64b5f6;
    border-color: #64b5f6;
}

body.dark-mode .trending-channels .no-channels {
    background-color: rgba(255, 255, 255, 0.05);
    color: #aaa;
    border: 1px solid #333;
}

body.dark-mode .trending-channels .no-channels::after {
    background-color: #64b5f6;
}

body.dark-mode .trending-channels .no-channels i,
body.dark-mode .trending-channels .loading i {
    color: #aaa;
}

body.dark-mode .trending-channels .error {
    background-color: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

/* Dark mode button styles */
body.dark-mode .btn-primary {
    background-color: #2c3e50;
    color: #f0f0f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .btn-primary:hover {
    background-color: #3c5a7c;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .btn-small {
    background-color: #2c3e50;
    color: #f0f0f0;
}

body.dark-mode .btn-small:hover {
    background-color: #3c5a7c;
}

body.dark-mode .btn-fancy {
    background-color: #2a3a4a;
    color: #64b5f6;
    border-color: #3c5a7c;
}

body.dark-mode .btn-fancy:hover {
    background-color: #3c5a7c;
}

body.dark-mode .btn-outline {
    color: #64b5f6;
    border-color: #64b5f6;
    background-color: transparent;
}

body.dark-mode .btn-outline:hover {
    background-color: rgba(100, 181, 246, 0.1);
}

body.dark-mode .filter-tab {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ccc;
}

body.dark-mode .filter-tab:hover,
body.dark-mode .filter-tab.active {
    background-color: #3a5a7c;
    color: #64b5f6;
    border-color: #64b5f6;
}

body.dark-mode .post-action-btn {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ccc;
}

body.dark-mode .post-action-btn:hover {
    background-color: #3a5a7c;
    color: #64b5f6;
}

/* Additional dark mode styles for post section */
body.dark-mode .post,
body.dark-mode .create-post-card,
body.dark-mode .view-container {
    background-color: #2a2a2a;
    border-color: #444;
    color: #f0f0f0;
}

body.dark-mode .create-post-input {
    background-color: #333;
    border-color: #444;
    color: #ccc;
}

body.dark-mode .create-post-input textarea {
    color: #f0f0f0;
}

body.dark-mode .form-options {
    border-color: #444;
}

body.dark-mode .form-options label {
    color: #ccc;
}

body.dark-mode .form-options input[type="text"] {
    background-color: #333;
    border-color: #444;
    color: #f0f0f0;
}

body.dark-mode #modal-submit-post {
    background-color: #222;
    border-color: #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark-mode .post-content p,
body.dark-mode .post-header h3,
body.dark-mode .section-header h2 {
    color: #f0f0f0;
}

body.dark-mode .post-info,
body.dark-mode .section-header p,
body.dark-mode .post-time,
body.dark-mode .post-author {
    color: #aaa;
}

body.dark-mode .post-author span {
    color: #aaa !important;
}

body.dark-mode .post-channel {
    color: #64b5f6;
}

body.dark-mode .user-channels li a i {
    color: #aaa;
}

body.dark-mode .user-channels li,
body.dark-mode .trending-channels li {
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .user-channels li:first-child,
body.dark-mode .trending-channels li:first-child {
    border-top: none;
}

body.dark-mode .user-channels li a:hover {
    color: #aaa;
    background-color: transparent;
    border-color: transparent;
}

body.dark-mode .post-tag {
    background-color: #2a3a4a;
    color: #64b5f6;
    border-color: #3c5a7c;
}

body.dark-mode .post-tag:hover {
    background-color: #3a5a7c;
    color: #90caf9;
    border-color: #5a7ca0;
    transform: translateY(-1px);
}

body.dark-mode .post-action {
    color: #aaa;
}

body.dark-mode .post-action:hover {
    color: #64b5f6;
}

body.dark-mode .post-action.vote-up.voted {
    color: #4CAF50;
}

body.dark-mode .post-action.vote-down.voted {
    color: #F44336;
}

/* Dark mode post footer styles are handled by the custom divider */

body.dark-mode .create-post-input {
    background-color: #333;
    border-color: #444;
    color: #f0f0f0;
}

body.dark-mode .create-post-input:hover {
    background-color: #3a3a3a;
    border-color: #555;
}

body.dark-mode .user-avatar {
    background-color: #333;
    color: #aaa;
}

body.dark-mode .post-action-btn {
    background-color: #2a2a2a;
    border-color: #444;
    color: #aaa;
}

body.dark-mode .post-action-btn:hover {
    background-color: #333;
    color: #64b5f6;
}

/* Additional dark mode styles for navbar elements */
body.dark-mode .nav-logo a {
    color: #f0f0f0;
}

body.dark-mode .nav-search input {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #f0f0f0 !important;
}

body.dark-mode .nav-search input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    font-style: italic;
}

body.dark-mode .nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .nav-search button {
    color: #f0f0f0;
}

body.dark-mode .nav-link {
    color: #f0f0f0;
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ===== CUSTOM DIVIDERS ===== */
.custom-divider {
    position: relative;
    height: 1px;
    background-color: #eee;
    margin: 15px 0;
    overflow: visible;
}

.custom-divider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: #4a76a8;
    border-radius: 2px;
}

body.dark-mode .custom-divider {
    background-color: #333;
}

body.dark-mode .custom-divider::after {
    background-color: #64b5f6;
}

/* ===== COMMENTS SECTION ===== */
.comments-section {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
    display: none;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.comments-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.comments-list {
    margin-bottom: 15px;
}

.comment {
    padding: 12px;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin-bottom: 15px;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.comment:last-child {
    margin-bottom: 15px !important; /* Ensure the last comment has the same bottom margin */
}

.comment:hover {
    background-color: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

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

.comment-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.comment-author-wrapper {
    display: flex;
    align-items: center;
}

.comment-author {
    font-weight: 600;
    color: #444;
    font-size: 0.9rem;
}

.comment-time {
    color: #888;
    font-size: 0.8rem;
    text-align: right;
}

.comment-content {
    margin-bottom: 10px;
    line-height: 1.4;
    color: #666;
    word-break: break-word;
    position: relative;
}

.comment-content p {
    margin-bottom: 4px;
    color: #666; /* Matched with comment-content */
    line-height: 1.4;
    font-size: 0.95rem;
}

/* Remove this duplicate style that was setting a different color */
.comment p {
    color: #666; /* Matched with comment-content */
}

/* Reduce spacing between paragraphs when <br> tags are used in comments */
.comment-content br {
    display: block;
    content: "";
    margin-top: 0.3em; /* Match post content br margin */
}

/* Additional fixes for line breaks on mobile devices in comments */
@media (max-width: 767px) {
  .comment-content {
    line-height: 1.3; /* Match post content mobile line height */
  }

  .comment-content p {
    margin-bottom: 3px; /* Match post content mobile paragraph margin */
  }

  .comment-content br {
    margin-top: 0.2em; /* Match post content mobile br margin */
  }
}

.comment-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px; /* Add consistent top margin */
    padding-bottom: 10px !important; /* Ensure consistent bottom padding */
    margin-bottom: 5px !important; /* Ensure consistent bottom margin */
}

.comment-actions {
    display: flex;
    gap: 10px;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #777;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-action:hover {
    color: #4a76a8;
}

.comment-action.vote-up {
    color: #777;
}

.comment-action.vote-down {
    color: #777;
}

.comment-action.vote-up.voted {
    color: #4CAF50;
}

.comment-action.vote-down.voted {
    color: #F44336;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-input-wrapper {
    position: relative;
}

.comment-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    resize: none;
    min-height: 80px;
    background-color: #f9f9f9;
    transition: all 0.2s ease;
}

.comment-input:focus {
    outline: none;
    border-color: #4a76a8;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.1);
}

.comment-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-form-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-form-toggle label {
    font-size: 0.9rem;
    color: #666;
}

.comment-submit {
    padding: 8px 16px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-submit:hover {
    background-color: #3a5a80;
    transform: translateY(-1px);
}

.comment-form-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-form-name input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: #f9f9f9;
}

.comment-form-name input:focus {
    outline: none;
    border-color: #4a76a8;
    background-color: #fff;
}

.no-comments-message {
    text-align: center;
    padding: 15px;
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
}

/* Dark mode styles for comments */
body.dark-mode .comments-section {
    border-top-color: #333;
}

body.dark-mode .comments-header h3 {
    color: #f0f0f0;
}

body.dark-mode .comment {
    background-color: #2a2a2a;
    border-color: #444;
}

body.dark-mode .comment:hover {
    background-color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.dark-mode .comment-author {
    color: #ddd;
}

body.dark-mode .anonymous-hash {
    color: #aaa !important;
}

body.dark-mode .user-name {
    color: #f0f0f0;
}

/* New class for comment author names */
.commenter_name {
    font-weight: 600;
    color: #444;
}

body.dark-mode .commenter_name {
    color: #aaa;
}

body.dark-mode .comment-time {
    color: #aaa;
}

body.dark-mode .comment-content p {
    color: #ddd; /* Made lighter for better visibility in dark mode */
}

body.dark-mode .comment-action {
    color: #aaa;
}

body.dark-mode .comment-action:hover {
    color: #64b5f6;
}

body.dark-mode .comment-action.vote-up.voted {
    color: #4CAF50;
}

body.dark-mode .comment-action.vote-down.voted {
    color: #F44336;
}

body.dark-mode .comment-input {
    background-color: #333;
    border-color: #444;
    color: #f0f0f0;
}

body.dark-mode .comment-input:focus {
    border-color: #64b5f6;
    background-color: #2a2a2a;
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.1);
}

body.dark-mode .comment-form-toggle label {
    color: #ccc;
}

body.dark-mode .comment-submit {
    background-color: #3a5a80;
}

body.dark-mode .comment-submit:hover {
    background-color: #4a76a8;
}

body.dark-mode .comment-form-name input {
    background-color: #333;
    border-color: #444;
    color: #f0f0f0;
}

body.dark-mode .comment-form-name input:focus {
    border-color: #64b5f6;
    background-color: #2a2a2a;
}

body.dark-mode .no-comments-message {
    color: #aaa;
}

/* ===== NOTIFICATION TOAST ===== */
.notification-toast {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    z-index: 2000;
    max-width: 350px;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #4a76a8;
}

.notification-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-toast.success {
    border-left-color: #4CAF50;
}

.notification-toast.error {
    border-left-color: #F44336;
}

.notification-toast.warning {
    border-left-color: #FFC107;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content i {
    font-size: 1.2rem;
}

.notification-toast.success i {
    color: #4CAF50;
}

.notification-toast.error i {
    color: #F44336;
}

.notification-toast.warning i {
    color: #FFC107;
}

.notification-toast .close-notification {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.notification-toast .close-notification:hover {
    color: #333;
}

body.dark-mode .notification-toast {
    background-color: #222;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .notification-toast .close-notification {
    color: #aaa;
}

body.dark-mode .notification-toast .close-notification:hover {
    color: #fff;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Beautiful Loading Spinner */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    padding: 40px 0;
    margin: 0 auto;
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
}

.spinner-svg {
    animation: spin 2s linear infinite;
    width: 100%;
    height: 100%;
}

.spinner-circle {
    stroke: #4a76a8;
    stroke-width: 4;
    stroke-linecap: round;
    fill: none;
    animation: dash 1.5s ease-in-out infinite;
}

.shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0));
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.slide-up {
    animation: slideInUp 0.5s ease forwards;
}

.slide-left {
    animation: slideInLeft 0.5s ease forwards;
}

/* Scroll to top button */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4a76a8;
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background-color: #3a5a80;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .scroll-top-btn {
    background-color: #2c3e50;
}

body.dark-mode .scroll-top-btn:hover {
    background-color: #3c5a7c;
}

/* ===== MODAL STYLES ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000; /* Higher than sidebar (1010) */
    opacity: 0;
    visibility: hidden;
    transition: visibility 0.3s ease, opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Ensure modals appear on top of sidebar */
.modal.show {
    z-index: 2000 !important;
    opacity: 1;
    visibility: visible;
}

/* Ensure modal content appears above the overlay */
.modal .modal-content {
    position: relative;
    z-index: 1;
}


/* Compact error state */
.empty-state.error.compact {
    padding: 10px;
    max-width: 450px;
    margin: 10px auto;
    border-radius: 6px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.empty-state.error.compact i {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: #d32f2f;
}

body.dark-mode .empty-state.error.compact i {
    color: #f44336;
}

.empty-state.error.compact h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    margin-top: 0;
}

.empty-state.error.compact p {
    font-size: 0.85rem;
    line-height: 1.2;
    margin-bottom: 4px;
    margin-top: 0;
}



.empty-state.error .return-home {
    display: inline-block;
    background-color: #d32f2f;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: background-color 0.2s ease;
}

.empty-state.error .return-home:hover {
    background-color: #b71c1c;
}

body.dark-mode .empty-state.error .return-home {
    background-color: #f44336;
}

body.dark-mode .empty-state.error .return-home:hover {
    background-color: #d32f2f;
}

/* Custom Alert Modal Styles */
.custom-alert-modal .modal-content {
    max-width: 300px;
    width: 90%;
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.custom-alert-modal.show .modal-content {
    transform: translateY(0);
}

.custom-alert-modal .alert-icon {
    font-size: 1.75rem;
    color: #4a76a8;
    margin-bottom: 8px;
}

.custom-alert-modal .alert-icon.warning i {
    color: #ff9800;
}

.custom-alert-modal .alert-icon.error i {
    color: #f44336;
}

.custom-alert-modal .alert-icon.success i {
    color: #4caf50;
}

.custom-alert-modal .alert-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.custom-alert-modal .alert-message {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.3;
}

.custom-alert-modal .alert-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.custom-alert-modal .alert-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.85rem;
}

.custom-alert-modal .alert-cancel {
    background-color: #f0f0f0;
    color: #666;
}

.custom-alert-modal .alert-cancel:hover {
    background-color: #e0e0e0;
    color: #333;
}

.custom-alert-modal .alert-confirm {
    background-color: #4a76a8;
    color: white;
}

.custom-alert-modal .alert-confirm:hover {
    background-color: #3a5a80;
}

/* Dark mode styles for custom alert */
body.dark-mode .custom-alert-modal .modal-content {
    background-color: #222;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .custom-alert-modal .alert-icon {
    color: #64b5f6;
}

body.dark-mode .custom-alert-modal .alert-title {
    color: #f0f0f0;
}

body.dark-mode .custom-alert-modal .alert-message {
    color: #aaa;
}

body.dark-mode .custom-alert-modal .alert-cancel {
    background-color: #333;
    color: #ccc;
}

body.dark-mode .custom-alert-modal .alert-cancel:hover {
    background-color: #444;
    color: #fff;
}

body.dark-mode .custom-alert-modal .alert-confirm {
    background-color: #2c3e50;
    color: #f0f0f0;
}

body.dark-mode .custom-alert-modal .alert-confirm:hover {
    background-color: #3c5a7c;
}

/* Terms Modal Specific Styles */
.terms-modal-container .modal-content {
    background-color: #d32f2f;
    color: white;
}

.terms-modal-container .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.terms-modal-container .modal-header h3 {
    color: white;
    font-weight: 700;
    letter-spacing: 1px;
}

.terms-modal-container .modal-body h4 {
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.terms-modal-container .modal-body ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.terms-modal-container .modal-body li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.terms-modal-container .close-modal {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.terms-modal-container .close-modal:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.terms-modal-container .last-updated {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-size: 0.85rem;
    margin: 0;
}

.terms-modal-container .last-updated a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.terms-modal-container .last-updated a:hover {
    color: #ffffff;
}

.terms-modal-container .modal-footer {
    background-color: rgba(0, 0, 0, 0.1);
    border-top-color: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
}

.terms-modal-container .legal-intro {
    font-weight: 500;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Help Modal Specific Styles */
.help-content .help-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.help-content .help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-content h4 {
    color: #4a76a8;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-content h4 i {
    color: #4a76a8;
    font-size: 0.9em;
}

.help-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.help-content ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.help-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.help-content .contact-info {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.help-content .contact-info a,
.privacy-content .last-updated a,
.about-content .version-info a {
    color: #4a9fe6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.help-content .contact-info a:hover,
.privacy-content .last-updated a:hover,
.about-content .version-info a:hover {
    color: #2980b9;
}

/* About Modal Specific Styles */
.about-content .about-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.about-content .about-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.about-content h4 {
    color: #4a76a8;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-content h4 i {
    color: #4a76a8;
    font-size: 0.9em;
}

.about-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.about-content ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.about-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.about-content .version-info {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Privacy Modal Specific Styles */
.privacy-content .privacy-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.privacy-content .privacy-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.privacy-content h4 {
    color: #4a76a8;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.privacy-content h4 i {
    color: #4a76a8;
    font-size: 0.9em;
}

.privacy-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.privacy-content ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.privacy-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.privacy-content .last-updated {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: fixed; /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1; /* Behind the modal content */
}

.modal.show .modal-overlay {
    opacity: 1;
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 20px;
    transform: translateY(50px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.modal.show .modal-container {
    transform: translateY(0);
    opacity: 1;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    z-index: 10;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: rotate(90deg);
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal-header .user-avatar {
    width: 36px;
    height: 36px;
    background-color: #4a76a8;
    color: white;
}

.modal-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
}

.content-input-wrapper {
    margin-bottom: 20px;
}

.content-input-wrapper label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.content-input-wrapper textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    font-size: 1rem;
    color: #333;
    background-color: #f9f9f9;
    resize: none;
    transition: all 0.2s ease;
}

.content-input-wrapper textarea:focus {
    outline: none;
    border-color: #4a76a8;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.1);
    background-color: #fff;
}

.link-input-wrapper {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
    background-color: #f5f9ff;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #d0e3ff;
}

.link-input-wrapper label {
    display: block;
    font-size: 0.9rem;
    color: #4a76a8;
    margin-bottom: 8px;
    font-weight: 500;
}

.link-input-wrapper input {
    width: 100%;
    border: 1px solid #d0e3ff;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.95rem;
    color: #333;
    background-color: white;
    transition: all 0.2s ease;
}

.link-input-wrapper input:focus {
    outline: none;
    border-color: #4a76a8;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.1);
}

/* Removed duplicate comment styles */

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

.comment-author {
    font-weight: 600;
    color: #4a76a8;
}

.comment-time {
    font-size: 0.8rem;
    color: #999;
}

.comment-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
}

.comment-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dark mode styles for modals */
body.dark-mode .modal-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

body.dark-mode .modal-content {
    background-color: #222;
    border-color: #333;
}

body.dark-mode .modal-header {
    border-color: #333;
}

body.dark-mode .modal-header h3 {
    color: #f0f0f0;
}

body.dark-mode .modal-header .user-avatar {
    background-color: #3a5a80;
}

body.dark-mode .content-input-wrapper label,
body.dark-mode .form-group label {
    color: #aaa;
}

body.dark-mode .content-input-wrapper textarea,
body.dark-mode .form-group input[type="text"] {
    background-color: #333;
    border-color: #444;
    color: #f0f0f0;
}

body.dark-mode .content-input-wrapper textarea:focus,
body.dark-mode .form-group input[type="text"]:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
    background-color: #2a2a2a;
}

body.dark-mode .form-group input[type="text"]:disabled {
    background-color: #2a2a2a;
    color: #666;
}

body.dark-mode .input-prefix {
    color: #aaa;
}

body.dark-mode .link-input-wrapper {
    background-color: #2a3a4a;
    border-color: #3a5a80;
}

body.dark-mode .link-input-wrapper label {
    color: #64b5f6;
}

body.dark-mode .link-input-wrapper input {
    background-color: #333;
    border-color: #3a5a80;
    color: #f0f0f0;
}

body.dark-mode .link-input-wrapper input:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
}

body.dark-mode .modal-footer {
    background-color: #2a2a2a;
    border-color: #333;
}

body.dark-mode .modal-footer a {
    color: #64b5f6;
    text-decoration: none;
}

body.dark-mode .modal-footer a:hover {
    text-decoration: underline;
}

body.dark-mode .action-btn {
    background-color: #333;
    border-color: #444;
    color: #aaa;
}

body.dark-mode .action-btn:hover {
    background-color: #3a3a3a;
    color: #64b5f6;
}

body.dark-mode .action-btn.active {
    background-color: #2a3a4a;
    border-color: #3a5a80;
    color: #64b5f6;
}

body.dark-mode .submit-btn {
    background-color: #3a5a80;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .submit-btn:hover {
    background-color: #4a76a8;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

body.dark-mode .toggle-slider {
    background-color: #444;
}

body.dark-mode input:checked + .toggle-slider {
    background-color: #3a5a80;
}

body.dark-mode .image-preview-wrapper {
    background-color: #2a2a2a;
    border-color: #444;
}

body.dark-mode .image-preview-caption {
    color: #aaa;
}

body.dark-mode .close-modal {
    background-color: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

body.dark-mode .close-modal:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #f0f0f0;
}

body.dark-mode .comments-section {
    border-color: #333;
}

body.dark-mode .comments-section h3 {
    color: #f0f0f0;
}

body.dark-mode .comment {
    border-color: #333;
}

body.dark-mode .comment-author {
    color: #64b5f6;
}

/* Dark mode styles for comment content */
body.dark-mode .comment-content,
body.dark-mode .comment-content p,
body.dark-mode .comment p {
    color: #ddd; /* Consistent color in dark mode */
}

/* Dark mode styles for Help, About, and Privacy modals */
body.dark-mode .help-content .help-section,
body.dark-mode .about-content .about-section,
body.dark-mode .privacy-content .privacy-section {
    border-bottom-color: #333;
}

body.dark-mode .help-content h4,
body.dark-mode .about-content h4,
body.dark-mode .privacy-content h4 {
    color: #64b5f6;
}

body.dark-mode .help-content h4 i,
body.dark-mode .about-content h4 i,
body.dark-mode .privacy-content h4 i {
    color: #64b5f6;
}

body.dark-mode .help-content .contact-info,
body.dark-mode .about-content .version-info,
body.dark-mode .privacy-content .last-updated {
    color: #aaa;
}

body.dark-mode .help-content .contact-info a,
body.dark-mode .privacy-content .last-updated a,
body.dark-mode .about-content .version-info a {
    color: #64b5f6;
}

body.dark-mode .help-content .contact-info a:hover,
body.dark-mode .privacy-content .last-updated a:hover,
body.dark-mode .about-content .version-info a:hover {
    color: #2980b9;
}
body.dark-mode .about-content .version-info a:hover {
    color: #90caf9;
}

/* Responsive styles for posts and comments on smaller screens */
@media (max-width: 700px) {
    /* Stack channel and author on smaller screens */
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        width: 100%;
    }

    /* Hide the middot separator on small screens */
    .meta-dot {
        display: none;
    }

    /* Adjust post info layout to keep timestamp on the right */
    .post-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        width: 100%;
    }

    /* Create a container for channel and author */
    .post-meta-container {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    /* Move timestamp to the right in comments */
    .comment-info {
        display: flex;
        justify-content: space-between;
        width: 100%;
        align-items: center;
    }

    .comment-time, .post-time {
        text-align: right;
        margin-left: auto;
    }
}

/* ===== POST ANIMATION STYLES ===== */
/* Post animation for initial load (slide down) */
.post-animate-down {
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.post-animate-down-active {
    transform: translateY(0);
}

/* Post animation for pagination (slide up) */
.post-animate-up {
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.post-animate-up-active {
    transform: translateY(0);
}

/* Loading indicator for more posts */
.loading-more-posts {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    width: 100%;
}

.loading-more-posts .spinner-container {
    width: 40px;
    height: 40px;
    position: relative;
}

.loading-more-posts .spinner-svg {
    animation: rotate 2s linear infinite;
    width: 100%;
    height: 100%;
}

.loading-more-posts .spinner-circle {
    stroke: #4a76a8;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
    stroke-width: 4;
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    fill: none;
}

/* Dark mode styles for loading spinner */
html.dark-mode .loading-more-posts .spinner-circle {
    stroke: #64b5f6;
}

/* Animation for post deletion */
.post-deleting {
    transition: opacity 0.4s ease, height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
    overflow: hidden;
}

/* Sort loading indicator */
.sort-loading-indicator {
    position: absolute;
    top: 0;
    right: -10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.sort-loading-indicator .spinner-container {
    width: 20px;
    height: 20px;
}

.sort-loading-indicator .spinner-svg {
    width: 20px;
    height: 20px;
    animation: rotate 1s linear infinite;
}

.sort-loading-indicator .spinner-circle {
    fill: none;
    stroke: #4a76a8;
    stroke-width: 4;
    stroke-dasharray: 80;
    stroke-dashoffset: 60;
    animation: dash 1.5s ease-in-out infinite;
}

body.dark-mode .sort-loading-indicator .spinner-circle {
    stroke: #64b5f6;
}

/* Share modal styles */
.share-link-container {
    margin-bottom: 20px;
}

.share-description {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.share-input-wrapper {
    display: flex;
    margin-top: 8px;
}

.share-input-wrapper .share-link-display {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    background-color: #f9f9f9;
    user-select: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.copy-btn {
    background-color: var(--theme-color, #4a76a8);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.copy-btn:hover {
    background-color: var(--theme-hover-color, #3a5a80);
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
    background-color: #f9f9f9;
    pointer-events: none;
    outline: none;
}

/* Single post view styles */
.single-post-comments {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.back-icon {
    margin-right: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #000; /* Always black in light mode */
    transition: color 0.2s;
}

.back-icon:hover {
    color: var(--theme-color, #4a76a8);
}

/* Dark mode styles for share modal */
body.dark-mode .share-description {
    color: #aaa;
}

body.dark-mode .no-select,
body.dark-mode .share-link-display {
    background-color: #2a2a2a;
    color: #f0f0f0;
}

body.dark-mode .copy-btn {
    background-color: var(--dark-theme-color, #64b5f6);
}

body.dark-mode .copy-btn:hover {
    background-color: var(--dark-theme-hover-color, #5a9fd9);
}

body.dark-mode .single-post-comments {
    border-top-color: #333;
}

body.dark-mode .back-icon {
    color: #fff !important; /* White in dark mode */
}

body.dark-mode .back-icon:hover {
    color: #fff !important; /* Keep white on hover in dark mode */
    opacity: 0.8 !important; /* Just reduce opacity on hover */
}

/* Message Button and Chat System */
/* Shared styles for floating buttons */
.floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    color: white;
}

.floating-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.floating-button i {
    font-size: 20px;
}

.message-button, .scroll-top-button {
    background-color: #4a76a8;
}

body.dark-mode .message-button, body.dark-mode .scroll-top-button {
    background-color: #64b5f6;
}

.hidden {
    display: none !important;
}

/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 20px; /* Reduced from 80px to position at the very bottom */
    right: 20px;
    width: 320px;
    height: 400px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: move; /* Indicate it's draggable */
}

.chat-header {
    padding: 12px 15px;
    background-color: var(--theme-color, #4a76a8);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move; /* Indicate that the header is draggable */
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-controls {
    display: flex;
    gap: 10px;
}

.chat-control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.chat-control-btn:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    padding: 15px; /* Restored original padding */
    overflow-y: auto;
    background-color: #f5f5f5;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
    position: relative; /* For absolute positioning of typing indicator */
}

/* Custom scrollbar for Webkit browsers */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

/* Dark mode scrollbar */
body.dark-mode .chat-messages {
    scrollbar-color: #555 #2a2a2a;
    background-color: #2a2a2a;
}

body.dark-mode .chat-messages::-webkit-scrollbar-track {
    background: #2a2a2a;
}

body.dark-mode .chat-messages::-webkit-scrollbar-thumb {
    background-color: #555;
}

/* Chat messages */
.chat-message {
    margin-bottom: 8px;
    max-width: 85%;
    clear: both;
}

.own-message {
    float: right;
}

.other-message {
    float: left;
}

.message-content {
    padding: 6px 10px;
    border-radius: 16px;
    position: relative;
    word-wrap: break-word;
}

.own-message .message-content {
    background: linear-gradient(to right, #0084ff, #0099ff);
    color: white;
    border-bottom-right-radius: 4px;
}

.other-message .message-content {
    background-color: #4CAF50;
    color: white;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
}

.message-user-hash {
    display: block;
    font-size: 11px;
    margin-bottom: 3px;
    color: #666;
    font-weight: 600;
    margin-left: 5px;
    text-transform: none !important; /* Ensure display names are never transformed */
}

body.dark-mode .message-user-hash {
    color: #aaa;
}

.message-time {
    font-size: 11px;
    opacity: 0.8;
    display: block;
    margin-top: 2px;
    padding: 0 5px;
}

.own-message .message-time {
    text-align: right;
    margin-right: 5px;
}

.other-message .message-time {
    text-align: left;
    margin-left: 5px;
}

body.dark-mode .other-message .message-content {
    background-color: #4CAF50;
    color: white;
}

body.dark-mode .own-message .message-content {
    background: linear-gradient(to right, #0084ff, #0099ff);
    color: white;
}

/* Prevent body scrolling when chat is open on mobile */
body.chat-open {
    overflow: hidden;
}

/* Typing indicator */
.typing-indicator {
    padding: 4px 10px;
    font-size: 10px;
    color: #666;
    font-style: italic;
    background-color: white; /* Same as footer background */
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    clear: both;
    position: absolute;
    bottom: 56px; /* Position right above the footer (which is 56px tall) */
    left: 0;
    right: 0;
    width: 100%;
    text-align: left;
    animation: typing-pulse 1.5s infinite;
    height: 20px; /* Fixed height for more compact appearance */
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10; /* Ensure it's above messages */
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* When typing indicator is added to DOM, it will fade in */
.typing-indicator.active {
    opacity: 1;
}

/* Typing dots animation */
.typing-dots {
    display: inline-flex;
    margin-right: 6px;
}

.typing-dots .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #666;
    margin: 0 1px;
    animation: typing-dot 1.4s infinite ease-in-out;
}

.typing-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-dot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@keyframes typing-pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Removed slide-up animation in favor of fade-in transition */

body.dark-mode .typing-indicator {
    color: #ccc;
    background-color: #1e1e1e; /* Same as dark mode footer background */
    border-top-color: #333;
}

body.dark-mode .typing-dots .dot {
    background-color: #ccc;
}

/* Message animations */
.chat-message {
    animation: message-appear 0.3s ease-out;
}

@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.removing {
    animation: message-remove 0.3s ease-out forwards;
}

@keyframes message-remove {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
        height: 0;
        margin: 0;
        padding: 0;
    }
}

.chat-welcome {
    text-align: center;
    padding: 20px 0;
    color: #666;
}

.chat-welcome-icon {
    font-size: 40px;
    color: var(--theme-color, #4a76a8);
    margin-bottom: 10px;
}

.chat-welcome h4 {
    margin: 10px 0;
    font-size: 16px;
    color: #333;
}

.chat-welcome p {
    margin: 0;
    font-size: 14px;
}

.chat-input-container {
    padding: 10px;
    background-color: white;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
}

.chat-input-container textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 8px 12px;
    resize: none;
    height: 36px;
    max-height: 100px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    caret-color: transparent; /* Hide the cursor initially */
    overflow: hidden !important; /* Hide scrollbars */
    white-space: nowrap; /* Prevent text wrapping */
    text-overflow: ellipsis; /* Show ellipsis for overflow text */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.chat-input-container textarea::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.chat-input-container textarea:focus {
    caret-color: auto; /* Show cursor when focused */
    white-space: normal; /* Allow text wrapping when focused */
    overflow-y: auto !important; /* Only show vertical scrollbar when needed */
    overflow-x: hidden !important; /* Never show horizontal scrollbar */
}

.send-chat-btn {
    background-color: var(--theme-color, #4a76a8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.send-chat-btn:hover {
    background-color: var(--theme-hover-color, #3a5a80);
}

.send-chat-btn i {
    font-size: 14px;
}

/* Dark mode styles for chat */
body.dark-mode .chat-container {
    background-color: #222;
    border: 1px solid #333;
}

body.dark-mode .chat-header {
    background-color: #1e1e1e;
}

body.dark-mode .chat-messages {
    background-color: #2a2a2a;
}

body.dark-mode .chat-welcome {
    color: #aaa;
}

body.dark-mode .chat-welcome h4 {
    color: #f0f0f0;
}

body.dark-mode .chat-welcome-icon {
    color: #1e1e1e;
}

body.dark-mode .chat-input-container {
    background-color: #1e1e1e;
    border-top-color: #333;
}

body.dark-mode .chat-input-container textarea {
    background-color: #2a2a2a;
    border-color: #444;
    color: #f0f0f0;
}

body.dark-mode .send-chat-btn {
    background-color: #1e1e1e;
}

body.dark-mode .send-chat-btn:hover {
    background-color: #333;
}

/* Mobile styles for chat */
@media (max-width: 700px) {
    .chat-container {
        width: 100%;
        height: calc(100% - 45px);
        bottom: 0;
        right: 0;
        border-radius: 0;
        top: 45px;
        margin-top: 0;
        cursor: default !important; /* Disable dragging on mobile */
        position: fixed !important; /* Ensure it stays fixed */
        transform: none !important; /* Prevent any transforms from dragging */
    }

    .chat-header {
        position: fixed;
        top: 45px;
        left: 0;
        right: 0;
        z-index: 10;
        border-top: none;
    }

    .chat-messages {
        margin-top: 45px; /* Add margin to account for fixed header */
    }

    .scroll-top-button {
        bottom: 20px;
        right: 20px;
        z-index: 1001;
    }
}

/* Hide message button in navbar on larger screens */
.nav-mobile-message {
    display: none;
}

/* Feed chat icon */
.feed-chat-icon {
    margin-right: 10px;
    color: var(--theme-color, #4a76a8) !important; /* Match navbar blue color */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    position: relative;
    display: inline-block;
}

.feed-chat-icon:hover {
    color: var(--theme-color, #4a76a8) !important;
    opacity: 0.8;
}

body.dark-mode .feed-chat-icon {
    color: #fff !important; /* Keep white in dark mode */
}

body.dark-mode .feed-chat-icon:hover {
    color: var(--dark-theme-color, #64b5f6) !important;
}

/* Show message button in navbar on mobile */
@media (max-width: 765px) {
    .nav-mobile-message {
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 20px;
        margin-right: 15px;
        cursor: pointer;
        transition: color 0.3s ease;
    }

    .nav-mobile-message.active {
        color: #64b5f6;
    }

    body.dark-mode .nav-mobile-message {
        color: #f0f0f0;
    }

    body.dark-mode .nav-mobile-message.active {
        color: #64b5f6;
    }
}

/* Dark mode styles moved from HTML */
html.dark-mode, html.dark-mode body {
    background-color: #222 !important;
    color: #f0f0f0 !important;
}

/* Navbar dark mode */
html.dark-mode .navbar {
    background-color: #1e1e1e !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3) !important;
}

/* Main containers dark mode */
html.dark-mode .app-container,
html.dark-mode .content-area,
html.dark-mode .view-container,
html.dark-mode #feed-view,
html.dark-mode .feed-filters,
html.dark-mode .section-header,
html.dark-mode .sort-options,
html.dark-mode .dropdown,
html.dark-mode .dropdown-toggle {
    background-color: #222 !important;
    color: #f0f0f0 !important;
    border-color: #333 !important;
}

/* Sidebar dark mode */
html.dark-mode .sidebar,
html.dark-mode .sidebar-section,
html.dark-mode .sidebar-header,
html.dark-mode .sidebar-menu,
html.dark-mode .user-channels {
    background-color: #222 !important;
    color: #f0f0f0 !important;
    border-color: #333 !important;
}

/* Section headers dark mode */
html.dark-mode .section-header h2 {
    color: #f0f0f0 !important;
}

html.dark-mode .section-header p {
    color: #ccc !important;
}

/* Post elements dark mode */
html.dark-mode .create-post-card,
html.dark-mode .posts-feed,
html.dark-mode .post-card,
html.dark-mode .no-posts-message,
html.dark-mode .loading-container,
html.dark-mode .empty-state {
    background-color: #222 !important;
    color: #f0f0f0 !important;
    border-color: #333 !important;
}

/* Dark mode for inputs and buttons */
html.dark-mode input,
html.dark-mode textarea,
html.dark-mode button,
html.dark-mode .dropdown-menu,
html.dark-mode .dropdown-item,
html.dark-mode .create-post-input,
html.dark-mode .photo-btn,
html.dark-mode .link-btn,
html.dark-mode .action-btn {
    background-color: #2a2a2a !important;
    color: #f0f0f0 !important;
    border-color: #444 !important;
}

/* Active dropdown items */
html.dark-mode .dropdown-item.active {
    background-color: #3a5a7c !important;
    color: #64b5f6 !important;
}

/* User avatar dark mode */
html.dark-mode .user-avatar {
    background-color: #333 !important;
    color: #aaa !important;
}

/* Menu items dark mode */
html.dark-mode .sidebar-menu li a,
html.dark-mode .user-channels li a {
    background-color: #2a2a2a !important;
    color: #f0f0f0 !important;
    border-color: #444 !important;
}

/* Active menu items */
html.dark-mode .sidebar-menu li.active a {
    background-color: #3a5a7c !important;
    color: #64b5f6 !important;
    border-color: #64b5f6 !important;
}

/* Trending section dark mode */
html.dark-mode .trending-grid,
html.dark-mode .trending-channels,
html.dark-mode .trending-channels li {
    background-color: #222 !important;
    color: #f0f0f0 !important;
}

/* Dividers dark mode */
html.dark-mode .custom-divider,
html.dark-mode .post-footer .custom-divider {
    background-color: #333 !important;
    border-color: #333 !important;
}

/* Hide empty sidebar sections by default */
#visited-channels-section,
#visited-tags-section,
#clear-history-container {
    display: none;
}

/* Hide trending channels section by default */
.sidebar-section:has(.trending-channels) {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show trending channels section when loaded */
.sidebar-section:has(.trending-channels.loaded) {
    opacity: 1;
}

/* Loading spinner for trending channels */
.loading-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    width: 100%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

html.dark-mode .loading-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: #3498db;
}

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

/* Post animations */
.post-animate-down {
    transform: translateY(-20px);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.post-animate-down-active {
    transform: translateY(0);
}

.post-animate-up {
    transform: translateY(20px);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.post-animate-up-active {
    transform: translateY(0);
}

.loading-more-posts {
    text-align: center;
    padding: 20px;
    margin-top: 10px;
}

.post-deleting {
    transition: opacity 0.4s ease, height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
}
