/* Main Container */
#elder-forum-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #000000; /* Pure Black text */
}

.elder-forum-container {
    display: flex;
    height: 600px;
    border: 1px solid #000000; /* Black border */
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff; /* Pure White background */
}

/* Sidebar Styles */
.elder-forum-sidebar {
    width: 300px;
    background: #000000; /* Pure Black Sidebar Background */
    color: white;
    display: flex;
    flex-direction: column;
}

.elder-forum-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #333333; /* Dark gray border */
    background: #111111; /* Off-black background for header */
}

.elder-forum-sidebar-header h2 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.user-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.current-user.verified::after {
    content: " ✓";
    color: #cccccc; /* Light gray checkmark */
    font-weight: bold;
}

.online-indicator {
    font-size: 12px;
}

.topics-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.topic-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #f0f0f0; /* Off-white text */
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.topic-item:hover {
    background: #333333; /* Darker hover background */
    color: white;
}

.topic-item.active {
    background: #444444; /* Darker gray for active state */
    border-left-color: #ffffff; /* White active indicator */
    color: white;
}

.topic-emoji {
    font-size: 20px;
    margin-right: 12px;
    width: 30px;
    text-align: center;
}

.topic-info {
    flex: 1;
    position: relative;
}

.topic-title {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-description {
    font-size: 12px;
    color: #aaaaaa; /* Medium gray text */
    margin-top: 2px;
}

.topic-stats {
    font-size: 11px;
    color: #888888; /* Darker gray text */
    margin-top: 2px;
}

.unread-count {
    background: #ffffff; /* White badge */
    color: #000000; /* Black text on badge */
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #333333; /* Dark gray border */
}

.new-topic-btn {
    width: 100%;
    padding: 10px;
    background: #444444; /* Dark gray button */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.new-topic-btn:hover {
    background: #000000; /* Pure Black hover background */
    transform: translateY(-1px);
}

/* Main Content */
.elder-forum-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Overview Styles */
.elder-forum-overview {
    padding: 30px;
    text-align: center;
}

.overview-header h1 {
    color: #000000; /* Pure Black heading */
    margin: 0 0 10px 0;
    font-size: 28px;
}

.overview-header p {
    color: #666666; /* Medium gray text */
    font-size: 16px;
    margin: 0 0 30px 0;
}

.overview-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.stat-card {
    background: #333333; /* Dark gray stat card background */
    color: white;
    padding: 25px;
    border-radius: 12px;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.recent-activity {
    margin-top: 30px;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.recent-activity h3 {
    color: #000000; /* Pure Black heading */
    margin-bottom: 20px;
}

.activity-list {
    background: #f0f0f0; /* Light gray background for activity list */
    border-radius: 8px;
    padding: 15px;
}

.activity-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0; /* Very light gray separator */
}

.activity-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.activity-avatar {
    margin-right: 12px;
}

.activity-avatar img {
    border-radius: 50%;
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 14px;
}

.activity-author {
    font-weight: 600;
    color: #000000; /* Pure Black author */
}

.activity-author.verified::after {
    content: " ✓";
    color: #cccccc; /* Light gray checkmark */
}

.activity-topic {
    color: #666666; /* Medium gray topic text */
}

.activity-time {
    color: #999999; /* Light gray time text */
    font-size: 12px;
    margin-left: auto;
}

.activity-message {
    color: #333333; /* Dark gray message text */
    font-size: 14px;
}

/* Chat Styles */
.elder-forum-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0; /* Very light gray separator */
    background: #f0f0f0; /* Light gray header background */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-topic-info h2 {
    margin: 0;
    font-size: 18px;
    color: #000000; /* Pure Black heading */
}

.chat-topic-info .topic-description {
    color: #666666; /* Medium gray description */
    font-size: 14px;
    margin: 2px 0 0 0;
}

.chat-actions {
    display: flex;
    gap: 5px;
}

.chat-action-btn {
    background: none;
    border: 1px solid #333333; /* Dark gray border */
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #000000; /* Pure Black text */
}

.chat-action-btn:hover {
    background: #e0e0e0; /* Lighter hover background */
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
    background: white; /* Pure White background */
}

.date-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.date-separator::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0; /* Very light gray line */
}

.date-separator span {
    background: white;
    color: #666666; /* Medium gray text */
    padding: 0 15px;
    font-size: 12px;
    position: relative;
    z-index: 1;
}

.message-wrapper {
    margin-bottom: 15px;
    position: relative;
}

.message-wrapper.grouped {
    margin-bottom: 3px;
}

.message-wrapper.own-message {
    margin-left: 50px;
}

.message-wrapper.own-message .message-content {
    background: #333333; /* Dark gray for own messages */
    color: white;
    margin-left: auto;
    margin-right: 0;
    border: 1px solid #333333;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 10px;
}

.message-avatar img {
    border-radius: 50%;
}

.message-author {
    font-weight: 600;
    font-size: 14px;
    color: #000000; /* Pure Black author */
}

.message-author.verified::after {
    content: " ✓";
    color: #cccccc; /* Light gray checkmark */
}

.message-time {
    font-size: 12px;
    color: #999999; /* Light gray time */
}

.message-content {
    background: #f0f0f0; /* Light gray message bubble */
    border-radius: 12px;
    padding: 12px 15px;
    max-width: 70%;
    position: relative;
    border: 1px solid #cccccc; /* Lighter border */
}

.message-text {
    word-wrap: break-word;
}

.mention {
    background: #444444; /* Dark gray mention background */
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.message-content a {
    color: #333333; /* Dark gray link color */
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-image img {
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
}

.image-caption {
    margin-top: 8px;
    font-size: 14px;
}

.message-file {
    padding: 10px;
    background: #e0e0e0; /* Very light gray file background */
    border-radius: 8px;
    border: 1px dashed #999999; /* Medium light gray dashed border */
}

.message-file a {
    color: #000000; /* Pure Black link */
    font-weight: 600;
    text-decoration: none;
}

.file-description {
    margin-top: 5px;
    font-size: 13px;
    color: #666666; /* Medium gray description */
}

/* Reactions */
.message-reactions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.reaction-btn {
    background: #f0f0f0; /* Light gray reaction button */
    border: 1px solid #cccccc; /* Light gray border */
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #000000;
}

.reaction-btn:hover {
    background: #e0e0e0; /* Slightly darker hover background */
}

.reaction-btn.user-reacted {
    background: #333333; /* Dark gray for user reacted */
    color: white;
    border-color: #333333;
}

/* Message Actions */
.message-actions {
    display: none;
    position: absolute;
    top: -15px;
    right: 10px;
    background: white;
    border: 1px solid #cccccc; /* Light gray border */
    border-radius: 20px;
    padding: 5px;
    gap: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.message-wrapper:hover .message-actions {
    display: flex;
}

.action-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    color: #333333; /* Dark gray icon color */
}

.action-btn:hover {
    background: #e0e0e0; /* Light gray hover background */
}

/* Chat Input */
.chat-input-container {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0; /* Light gray separator */
    background: white;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f0f0f0; /* Light gray input background */
    border-radius: 25px;
    padding: 8px 12px;
    border: 1px solid #cccccc; /* Light gray border */
}

.input-wrapper:focus-within {
    border-color: #333333; /* Dark gray focus border */
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.2); /* Dark gray focus shadow */
}

.attachment-btn, .emoji-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
    color: #666666; /* Medium gray icons */
}

.attachment-btn:hover, .emoji-btn:hover {
    background: #e0e0e0; /* Light gray hover background */
    color: #000000; /* Pure Black icon on hover */
}

.message-input {
    flex: 1;
    border: none;
    background: none;
    resize: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    max-height: 100px;
    min-height: 20px;
}

.send-btn {
    background: #333333; /* Dark gray send button */
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.send-btn:hover {
    background: #000000; /* Pure Black hover background */
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #cccccc; /* Light gray disabled background */
    color: #666666;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    font-size: 12px;
    color: #666666; /* Medium gray text */
    margin-top: 5px;
    height: 15px;
}

/* Load More */
.load-more-container {
    text-align: center;
    margin: 20px 0;
}

.load-more-btn {
    background: #e0e0e0; /* Light gray button */
    border: 1px solid #999999; /* Medium light gray border */
    color: #000000; /* Pure Black text */
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: #cccccc; /* Slightly darker hover background */
}

/* Error Messages */
.elder-forum-error {
    text-align: center;
    padding: 50px 20px;
    font-size: 18px;
    color: #880000; /* Dark red for error (the one exception to grayscale) */
}

/* Responsive Design */
@media (max-width: 768px) {
    .elder-forum-container {
        flex-direction: column;
        height: auto;
        min-height: 500px;
    }
    
    .elder-forum-sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        order: 2;
    }
    
    .elder-forum-main {
        order: 1;
        min-height: 400px;
    }
    
    .topics-list {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    
    .topic-item {
        min-width: 200px;
        margin-right: 10px;
    }
    
    .overview-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-card {
        margin: 0 auto;
        max-width: 200px;
    }
    
    .message-wrapper.own-message {
        margin-left: 20px;
    }
    
    .message-content {
        max-width: 85%;
    }
}

/* Modal and Picker Styles */
.reaction-picker, .emoji-picker {
    position: absolute;
    background: white;
    border: 1px solid #cccccc; /* Light gray border */
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    gap: 5px;
}

.reaction-picker button, .emoji-picker button {
    background: none;
    border: none;
    font-size: 18px;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-picker button:hover, .emoji-picker button:hover {
    background: #f0f0f0; /* Light gray hover */
    transform: scale(1.2);
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.topic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.topic-modal-content h3 {
    margin: 0 0 20px 0;
    color: #000000; /* Pure Black heading */
}

.topic-modal-content input,
.topic-modal-content textarea,
.topic-modal-content select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #cccccc; /* Light gray border */
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    color: #000000; /* Pure Black text */
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.modal-actions button[type="submit"] {
    background: #333333; /* Dark gray submit button */
    color: white;
}

.modal-actions button[type="button"] {
    background: #999999; /* Medium gray cancel button */
    color: white;
}

.edit-message-form {
    width: 100%;
}

.edit-input {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #cccccc; /* Light gray border */
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: inherit;
}

.edit-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.edit-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.edit-actions button:first-child {
    background: #333333; /* Dark gray save button */
    color: white;
}

.edit-actions button:last-child {
    background: #999999; /* Medium gray cancel button */
    color: white;
}

/* Widget Styles */
.elder-forum-widget-list {
    list-style: none;
    padding: 0;
}

.elder-forum-widget-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0; /* Very light gray separator */
}

.elder-forum-widget-list li:last-child {
    border-bottom: none;
}

.elder-forum-widget-list .verified::after {
    content: " ✓";
    color: #cccccc; /* Light gray checkmark */
    font-weight: bold;
}

/* Login Form Styles */
.elder-forum-login-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 400px; 
    background: #333333; /* Dark gray login container */ 
    border-radius: 15px; 
    margin: 20px 0;
}

.elder-forum-login-box { 
    background: white; 
    padding: 40px; 
    border-radius: 15px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
    text-align: center; 
    max-width: 400px;
}

.elder-forum-login-box h2 { 
    color: #000000; 
    margin-bottom: 20px; 
    font-size: 24px; 
}

.elder-forum-login-box p { 
    color: #333333; 
    margin-bottom: 30px; 
    font-size: 16px; 
}

.login-actions { 
    display: flex; 
    gap: 15px; 
    justify-content: center; 
}

.login-btn, .register-btn { 
    padding: 12px 25px; 
    border-radius: 25px; 
    text-decoration: none; 
    font-weight: bold; 
    transition: all 0.3s;
}

.login-btn { 
    background: #333333; /* Dark gray login button */ 
    color: white; 
}

.login-btn:hover { 
    background: #000000; /* Pure Black hover */ 
    transform: translateY(-2px); 
}

.register-btn { 
    background: #666666; /* Medium gray register button */ 
    color: white; 
}

.register-btn:hover { 
    background: #333333; /* Darker hover */ 
    transform: translateY(-2px); 
}