/* CSS Document */

:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-bg: #121212;
    --light-text: #212529;
    --dark-text: #e9ecef;
    --light-card: #ffffff;
    --dark-card: #1e1e1e;
    --light-border: #dee2e6;
    --dark-border: #343a40;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--light-text);
    transition: var(--transition);
}

body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background-color: var(--light-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

body.dark-mode header {
    background-color: var(--dark-card);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid var(--primary-color);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--secondary-color);
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--primary-color);
}

/* Main Content Styles */
.main-content {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar, .right-sidebar {
        display: none;
    }
}

/* Sidebar Styles */
.sidebar, .right-sidebar {
    background-color: var(--light-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

body.dark-mode .sidebar,
body.dark-mode .right-sidebar {
    background-color: var(--dark-card);
}

.sidebar-title, .right-sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--light-border);
}

body.dark-mode .sidebar-title,
body.dark-mode .right-sidebar-title {
    border-bottom: 1px solid var(--dark-border);
}

.category-list {
    list-style: none;
}

.category-item {
    padding: 10px 0;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.category-item:hover {
    color: var(--primary-color);
}

.category-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Search Styles */
.search-container {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    margin-bottom: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--light-border);
    border-radius: 5px 0 0 5px;
    outline: none;
    transition: var(--transition);
}

body.dark-mode .search-input {
    background-color: var(--dark-card);
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
}

.search-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-button:hover {
    background-color: #3a5bd9;
}

.search-results-count {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

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

.filter-select {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid var(--light-border);
    border-radius: 5px;
    outline: none;
    transition: var(--transition);
}

body.dark-mode .filter-select {
    background-color: var(--dark-card);
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
}

/* Post Creation Styles */
.create-post {
    background-color: var(--light-card);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

body.dark-mode .create-post {
    background-color: var(--dark-card);
}

.post-input {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 1px solid var(--light-border);
    border-radius: 10px;
    resize: vertical;
    margin-bottom: 15px;
    outline: none;
    transition: var(--transition);
}

.poster-icon.anonymous {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-weight: bold;
}

.poster-icon.anonymous::before {
    content: "?";
    font-size: 14px;
}

body.dark-mode .post-input {
    background-color: var(--dark-card);
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
}

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

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-button {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--secondary-color);
    cursor: pointer;
    transition: var(--transition);
}

.action-button:hover {
    color: var(--primary-color);
}

.post-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.post-button:hover {
    background-color: #3a5bd9;
}

.hidden {
    display: none;
}

.image-preview {
    margin-top: 15px;
    max-width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

/* Timeline Styles */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post {
    background-color: var(--light-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

body.dark-mode .post {
    background-color: var(--dark-card);
}

/* Updated post header styles */
.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
/* Avatar styles */
.post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.avatar-placeholder {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
}

/* Different colors based on user */
.post-avatar[data-user-initial="A"] { background: linear-gradient(135deg, #667eea, #764ba2); }
.post-avatar[data-user-initial="Y"] { background: linear-gradient(135deg, #f093fb, #f5576c); }
.post-avatar[data-user-initial="U"] { background: linear-gradient(135deg, #4facfe, #00f2fe); }

.post-user-info {
    display: flex;
    flex-direction: column;
}

.post-user {
    font-weight: 600;
    font-size: 14px;
    color: #2d3748;
}

/* Add to existing .post-date */
.post-date {
    position: relative;
    cursor: help;
}

/* Delayed tooltip - add these new rules */
.post-date:hover::after {
    content: attr(data-full-date);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 8px;
    font-weight: normal;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.2s ease 1s;
}

.post-date:hover::after {
    opacity: 1;
}

.post-date:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    margin-bottom: -2px;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.2s ease 1s;
}

.post-date:hover::before {
    opacity: 1;
}

/* Dark mode */
.dark-mode .post-date:hover::after {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
}

.dark-mode .post-date:hover::before {
    border-top-color: rgba(255, 255, 255, 0.95);
}

.post-content {
    margin-bottom: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.post-content p {
    margin: 0 0 1rem 0; /* space between paragraphs */
    line-height: 1.6;
}

.post-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
    max-height: 400px;
    object-fit: contain;
    cursor: pointer;
}

.post-actions-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--light-border);
    padding-top: 15px;
}

body.dark-mode .post-actions-footer {
    border-top: 1px solid var(--dark-border);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--secondary-color);
    cursor: pointer;
    transition: var(--transition);
}

.post-action:hover {
    color: var(--primary-color);
}

.post-topic {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    margin-bottom: 10px;
}

/* Right Sidebar Styles */
.trending-topics {
    list-style: none;
}

.trending-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--light-border);
    cursor: pointer;
    transition: var(--transition);
}

body.dark-mode .trending-item {
    border-bottom: 1px solid var(--dark-border);
}

.trending-item:hover {
    color: var(--primary-color);
}

.trending-count {
    font-size: 12px;
    color: var(--secondary-color);
    margin-left: 5px;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--secondary-color);
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

body.dark-mode .spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary-color);
}

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

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    color: var(--secondary-color);
    border-top: 1px solid var(--light-border);
}

body.dark-mode footer {
    border-top: 1px solid var(--dark-border);
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

body.dark-mode .error-message {
    background-color: #311b1b;
    color: #ef9a9a;
    border-left: 4px solid #ef9a9a;
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #2e7d32;
}

body.dark-mode .success-message {
    background-color: #1b311b;
    color: #81c784;
    border-left: 4px solid #81c784;
}

.date-input-container {
    display: flex;
    align-items: center;
}

.date-input {
    padding: 8px 10px;
    border: 1px solid var(--light-border);
    border-radius: 5px;
    outline: none;
    transition: var(--transition);
    font-size: 14px;
}

body.dark-mode .date-input {
    background-color: var(--dark-card);
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
}

.date-input:focus {
    border-color: var(--primary-color);
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #2e7d32;
}

body.dark-mode .success-message {
    background-color: #1b311b;
    color: #81c784;
    border-left: 4px solid #81c784;
}

.search-info {
    background-color: var(--light-card);
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 14px;
    color: var(--secondary-color);
    border-left: 3px solid var(--primary-color);
}

body.dark-mode .search-info {
    background-color: var(--dark-card);
    color: var(--dark-text);
}

.search-container {
    margin-bottom: 20px;
    position: relative;
}
/* Style for the search results count */
.search-results-count {
    margin: 15px 0 10px 0;
    padding: 10px 0;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 14px;
}
/* Post image styles with error handling */
.post-image-container {
    position: relative;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    min-height: 100px;
}

body.dark-mode .post-image-container {
    background: var(--dark-card);
}

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

.image-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6c757d;
    text-align: center;
}

.image-fallback i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #adb5bd;
}

.image-fallback span {
    font-size: 14px;
    color: #6c757d;
}

/* Alternative: Simple broken image replacement */
.post-image[alt]:after {
    display: none; /* We'll handle this with our custom fallback */
}

/* Google Sign-In Button Styles - Clean White */
.login-button {
    background: white;
    color: #757575;
    border: 2px solid #dadce0;
    border-radius: 4px;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-button:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border-color: #d2e3fc;
    transform: translateY(-1px);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.login-button i {
    color: #4285f4;
    font-size: 18px;
}
/* Logout Button Styles */
.logout-button {
    background: #f8f9fa;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 12px;
}

.logout-button:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.logout-button:active {
    transform: translateY(0);
}

/* Alternative: More subtle logout button */
.logout-button.subtle {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
}

.logout-button.subtle:hover {
    background: #f8f9fa;
    color: #dc3545;
    border-color: #dc3545;
}

/* Make sure the user section looks good too */
#userSection {
    display: flex;
    align-items: center;
    gap: 8px;
}

#userName {
    font-weight: 500;
    color: #2d3748;
}

/* Header user name styles */
#userName {
    color: #2d3748; /* Default light mode color */
    font-weight: 500;
}

/* Dark mode support for header user name */
.dark-mode #userName {
    color: #e2e8f0; /* Light color for dark mode */
}

/* If you want to style the entire header profile section in dark mode */
.dark-mode .header-profile {
    color: #e2e8f0;
}

/* Optional: Improve contrast for the entire header in dark mode */
.dark-mode header {
    background: #1a202c;
    border-bottom: 1px solid #2d3748;
}

.dark-mode .header-content {
    color: #e2e8f0;
}

/* Logout button dark mode */
.dark-mode .logout-button {
    background: #2d3748;
    color: #e2e8f0;
    border: 1px solid #4a5568;
}

.dark-mode .logout-button:hover {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
}

.profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.logout-button i {
    margin-right: 6px;
    font-size: 11px;
}

.search-info {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 14px;
    color: var(--text-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.clear-filters-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    margin-left: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clear-filters-btn:hover {
    background: var(--primary-dark);
}

/* Add active state for category items */
.category-item.active {
    background: var(--primary-color);
    color: white;
}

.category-item.active i {
    color: white;
}

.search-info {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 14px;
    color: var(--text-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.clear-filters-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    margin-left: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clear-filters-btn:hover {
    background: var(--primary-dark);
}

/* Add active state for category items */
.category-item.active {
    background: var(--primary-color);
    color: white;
}

.category-item.active i {
    color: white;
}
/* Like button styles */
.post-action.like-action {
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-action.like-action:hover {
    transform: scale(1.1);
}

.post-action.like-action.liked {
    color: #e74c3c;
}

.post-action.like-action.liked i {
    color: #e74c3c;
}

.post-action.like-action:active {
    transform: scale(0.95);
}

/* Pulse animation when liked */
@keyframes likePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.post-action.like-action.liked i {
    animation: likePulse 0.3s ease;
}
/* Comments Modal */
.comments-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.comments-modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.close-comments {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: 400px;
}

.comment-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

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

.comment-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.comment-user {
    font-weight: bold;
    font-size: 14px;
}

.comment-time {
    color: #666;
    font-size: 12px;
    margin-left: auto;
}

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

.add-comment-section {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.comment-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    background: var(--input-bg);
    color: var(--text-color);
}

.post-comment-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.post-comment-btn:hover {
    background: var(--primary-dark);
}

.loading-comments,
.no-comments,
.error-comments {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}
/* CSS Variables for consistent theming */
:root {
    --card-bg: #ffffff;
    --border-color: #e1e8ed;
    --text-color: #333333;
    --primary-color: #1877f2;
    --primary-dark: #166fe5;
    --input-bg: #f0f2f5;
    --hover-color: #f5f8fa;
}

.dark-mode {
    --card-bg: #242526;
    --border-color: #3a3b3c;
    --text-color: #e4e6eb;
    --primary-color: #1877f2;
    --primary-dark: #166fe5;
    --input-bg: #3a3b3c;
    --hover-color: #3a3b3c;
}

/* Comments Modal */
.comments-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.comments-modal-content {
    background: var(--card-bg, #ffffff); /* Fallback to white if variable not defined */
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color, #e1e8ed);
}

.comments-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color, #e1e8ed);
    background: var(--card-bg, #ffffff);
}

.comments-modal-header h3 {
    margin: 0;
    color: var(--text-color, #333333);
    font-size: 18px;
    font-weight: 600;
}

.close-comments {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color, #666666);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-comments:hover {
    background: var(--hover-color, #f5f8fa);
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: 400px;
    background: var(--card-bg, #ffffff);
}

.comment-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color, #e1e8ed);
}

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

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-color, #1877f2);
}

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

.comment-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--primary-color, #1877f2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.comment-user {
    font-weight: bold;
    font-size: 14px;
    color: var(--text-color, #333333);
}

.comment-time {
    color: var(--text-color, #666666);
    font-size: 12px;
    margin-left: auto;
    opacity: 0.7;
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-color, #333333);
    padding-left: 42px; /* Align with comment text below avatar */
}

.add-comment-section {
    padding: 20px;
    border-top: 1px solid var(--border-color, #e1e8ed);
    background: var(--card-bg, #ffffff);
}

.comment-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    background: var(--input-bg, #f0f2f5);
    color: var(--text-color, #333333);
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color, #1877f2);
}

.post-comment-btn {
    background: var(--primary-color, #1877f2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.post-comment-btn:hover {
    background: var(--primary-dark, #166fe5);
}

.post-comment-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading-comments,
.no-comments,
.error-comments {
    text-align: center;
    padding: 40px;
    color: var(--text-color, #666666);
    font-style: italic;
    background: var(--card-bg, #ffffff);
}

/* Scrollbar styling for comments list */
.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: var(--input-bg, #f0f2f5);
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--border-color, #c4c4c4);
    border-radius: 3px;
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Comment Image Styles */
.comment-image-container {
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-bg);
    max-width: 300px;
}

body.dark-mode .comment-image-container {
    background: var(--dark-card);
}

.comment-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    border-radius: 8px;
}

.comment-preview-container {
    position: relative;
    display: inline-block;
    margin: 8px 0;
}

.comment-preview-image {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-comment-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.comment-image-btn {
    background: none;
    border: 1px solid var(--light-border);
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    color: var(--secondary-color);
    transition: var(--transition);
}

body.dark-mode .comment-image-btn {
    border: 1px solid var(--dark-border);
    color: var(--dark-text);
}

.comment-image-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-color, #999999);
}