/* Targeted Twitter Feed Styles - Only affects #postsContainer */
/* Does not interfere with existing login/signup or other site styles */

#postsContainer .twitter-feed-enhanced {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

/* Minimal Feed Stats - Clean design */
#postsContainer .feed-stats-minimal {
    text-align: right;
    margin-bottom: 16px;
    padding: 0;
}

#postsContainer .tweet-count {
    display: inline-block;
    background: rgba(29, 161, 242, 0.1);
    color: #1da1f2;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(29, 161, 242, 0.2);
}

#postsContainer .theme-toggle {
    background: rgba(29, 161, 242, 0.1);
    border: 1px solid rgba(29, 161, 242, 0.2);
    border-radius: 20px;
    padding: 6px 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
    width: auto !important;
    height: auto !important;
    position: static !important;
    display: inline-block !important;
}

/* Prevent forum toggle styles from affecting Inside Talk toggle */
#postsContainer .theme-toggle::before {
    display: none !important;
}

#postsContainer .theme-toggle:hover {
    background: rgba(29, 161, 242, 0.2);
    transform: scale(1.05);
}

/* Create Post Section */
#postsContainer .create-post-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e1e8ed;
}

#postsContainer .create-post-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* Avatar Logo Styling - Circular design for modern look */
#postsContainer .avatar-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
    object-position: center;
    background: #000000 !important;
    background-color: #000000 !important;
    background-image: none !important;
    border: 2px solid #1da1f2;
    padding: 0px;
}

#postsContainer .avatar-logo.small {
    width: 28px;
    height: 28px;
    border-width: 1px;
    padding: 0px;
    border-radius: 50%;
    object-fit: contain;
    object-position: center;
    background: #000000 !important;
    background-color: #000000 !important;
    background-image: none !important;
}

#postsContainer .avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-right: 10px;
}

/* Random color variations for user avatars */
#postsContainer .avatar-circle.color-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#postsContainer .avatar-circle.color-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

#postsContainer .avatar-circle.color-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

#postsContainer .avatar-circle.color-4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

#postsContainer .avatar-circle.color-5 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

#postsContainer .avatar-circle.color-6 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

#postsContainer .avatar-circle.color-7 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

#postsContainer .avatar-circle.color-8 {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

#postsContainer .avatar-circle.color-9 {
    background: linear-gradient(135deg, #fad0c4 0%, #ffd1ff 100%);
}

#postsContainer .avatar-circle.color-10 {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

#postsContainer .avatar-circle.small {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
}

#postsContainer .avatar-circle.admin-avatar {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
    border: 2px solid #ffd700;
}

#postsContainer .post-input-container {
    flex: 1;
}

#postsContainer .post-input-container textarea {
    width: 100%;
    border: none;
    outline: none;
    /* CRITICAL: Enable line breaks and text selection */
    white-space: pre-wrap;
    word-wrap: break-word;
    /* Enable text selection and copy/paste on mobile */
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    /* Enable long-press context menu on mobile */
    -webkit-touch-callout: default !important;
    touch-action: auto !important;
    background: transparent;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    min-height: 80px;
    max-height: 300px;
    line-height: 1.5;
}

#postsContainer .post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e1e8ed;
}

#postsContainer .character-count {
    font-size: 0.85rem;
    color: #657786;
}

#postsContainer .post-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

#postsContainer .admin-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #657786;
    cursor: pointer;
}

/* User Prompt for non-admin users */
#postsContainer .user-prompt {
    background: linear-gradient(135deg, #17bf63 0%, #11998e 100%);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: center;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(23, 191, 99, 0.2);
}

/* Login Prompt */
#postsContainer .login-prompt {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

#postsContainer .prompt-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

#postsContainer .prompt-content p {
    margin: 0 0 16px 0;
    opacity: 0.9;
}

/* Tweet Styles */
#postsContainer .tweet {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid #e1e8ed;
    transition: all 0.2s ease;
    position: relative;
}

#postsContainer .tweet:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

#postsContainer .tweet.admin-tweet {
    border-left: 3px solid #ffd700;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

#postsContainer .tweet.pinned-tweet {
    border: 2px solid #1da1f2;
    background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
}

#postsContainer .pin-indicator {
    position: absolute;
    top: -1px;
    right: 12px;
    background: #1da1f2;
    color: white;
    padding: 2px 8px;
    border-radius: 0 0 6px 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

#postsContainer .tweet-header {
    margin-bottom: 10px;
}

#postsContainer .author-info {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
    width: 100%;
}

#postsContainer .user-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#postsContainer .author-avatar,
#postsContainer .reply-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#postsContainer .author-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #14171a;
    display: flex;
    align-items: center;
    gap: 6px;
}

#postsContainer .admin-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 500;
    background: #ffd700;
    color: #333;
}

#postsContainer .tweet-meta {
    font-size: 0.85rem;
    color: #657786;
    margin-top: 2px;
}

#postsContainer .tweet-content {
    margin-bottom: 12px;
}

#postsContainer .tweet-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #14171a;
    margin: 0;
    word-wrap: break-word;
}

#postsContainer .tweet-text .hashtag {
    color: #1da1f2;
    font-weight: 500;
}

#postsContainer .tweet-text .mention {
    color: #1da1f2;
    font-weight: 500;
}

#postsContainer .tweet-text a {
    color: #1da1f2;
    text-decoration: none;
}

#postsContainer .tweet-text a:hover {
    text-decoration: underline;
}

/* Tweet Actions */
#postsContainer .tweet-actions {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e1e8ed;
}

#postsContainer .action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: none;
    border: 1px solid #e1e8ed;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #657786;
    position: relative;
    overflow: hidden;
    min-height: 36px;
    justify-content: center;
}

#postsContainer .action-btn:hover:not(:disabled) {
    background: rgba(29, 161, 242, 0.1);
    border-color: rgba(29, 161, 242, 0.3);
    color: #1da1f2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(29, 161, 242, 0.15);
}

#postsContainer .action-btn .action-text {
    font-weight: 600;
    letter-spacing: 0.025em;
}

#postsContainer .action-btn .action-icon {
    font-size: 1rem;
    transition: transform 0.2s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

#postsContainer .action-btn:hover .action-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* Enhanced icon styling for specific actions */
#postsContainer .action-btn.reply-btn .action-icon {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#postsContainer .action-btn.share-btn .action-icon {
    background: linear-gradient(135deg, #17bf63, #14a456);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#postsContainer .action-btn.edit-btn .action-icon {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#postsContainer .action-btn.delete-btn .action-icon {
    background: linear-gradient(135deg, #e0245e, #c91e4a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Spinner animation for loading states */
.btn-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#postsContainer .action-btn .action-count {
    font-weight: 600;
    font-size: 0.8rem;
    background: rgba(101, 119, 134, 0.1);
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

#postsContainer .action-btn:hover .action-count {
    background: rgba(29, 161, 242, 0.2);
    color: #1da1f2;
}

#postsContainer .action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#postsContainer .action-btn.liked {
    color: #e0245e;
}

#postsContainer .action-btn.liked:hover {
    background: rgba(224, 36, 94, 0.1);
    color: #e0245e;
}

#postsContainer .action-btn.delete-btn {
    color: #e0245e;
}

#postsContainer .action-btn.delete-btn:hover {
    background: rgba(224, 36, 94, 0.1);
    color: #e0245e;
}

/* Enhanced Reply Button Styling */
#postsContainer .action-btn.reply-btn {
    border-color: rgba(29, 161, 242, 0.2);
}

#postsContainer .action-btn.reply-btn:hover {
    background: linear-gradient(135deg, rgba(29, 161, 242, 0.1), rgba(29, 161, 242, 0.05));
    border-color: #1da1f2;
    color: #1da1f2;
    box-shadow: 0 3px 12px rgba(29, 161, 242, 0.2);
}

#postsContainer .action-btn.reply-btn .action-icon {
    color: #1da1f2;
}

/* Enhanced Share Button Styling */
#postsContainer .action-btn.share-btn {
    border-color: rgba(23, 191, 99, 0.2);
}

#postsContainer .action-btn.share-btn:hover {
    background: linear-gradient(135deg, rgba(23, 191, 99, 0.1), rgba(23, 191, 99, 0.05));
    border-color: #17bf63;
    color: #17bf63;
    box-shadow: 0 3px 12px rgba(23, 191, 99, 0.2);
}

#postsContainer .action-btn.share-btn .action-icon {
    color: #17bf63;
}

#postsContainer .action-icon {
    font-size: 1rem;
}

#postsContainer .action-count {
    font-weight: 500;
    min-width: 16px;
    text-align: left;
}

/* Reply Form */
#postsContainer .reply-form-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e1e8ed;
}

#postsContainer .reply-form {
    background: #f7f9fa;
    border-radius: 10px;
    padding: 12px;
}

#postsContainer .reply-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

#postsContainer .reply-input {
    flex: 1;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    max-height: 200px;
    line-height: 1.4;
    font-family: inherit;
}

#postsContainer .reply-input:focus {
    outline: none;
    border-color: #1da1f2;
    box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.2);
}

#postsContainer .reply-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#postsContainer .reply-char-count {
    font-size: 0.8rem;
    color: #657786;
}

#postsContainer .reply-buttons {
    display: flex;
    gap: 6px;
}

#postsContainer .login-to-reply {
    text-align: center;
    color: #657786;
    font-style: italic;
    margin: 12px 0;
}

/* Replies */
#postsContainer .replies-container {
    margin-top: 12px;
    padding-left: 16px;
    border-left: 2px solid #e1e8ed;
}

#postsContainer .reply {
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
}

#postsContainer .reply:last-child {
    border-bottom: none;
}

#postsContainer .reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

#postsContainer .reply-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: #14171a;
}

/* Dark theme fix for reply author name */
#postsContainer.dark-theme .reply-author {
    color: #ffffff;
}

/* Dark theme fix for reply content text */
#postsContainer.dark-theme .reply-content p {
    color: #ffffff; /* Light text for dark theme - good contrast */
}

#postsContainer .reply-time {
    font-size: 0.75rem;
    color: #657786;
}

#postsContainer .reply-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #14171a; /* Dark text for light theme - good contrast */
}

#postsContainer .reply-actions-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

#postsContainer .reply-delete-btn {
    background: none;
    border: none;
    color: #e0245e;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

#postsContainer .reply-delete-btn:hover {
    background: rgba(224, 36, 94, 0.1);
}

/* Buttons - Scoped to posts container */
#postsContainer .btn-primary,
#postsContainer .btn-secondary {
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

#postsContainer .btn-primary {
    background: #1da1f2;
    color: white;
}

#postsContainer .btn-primary:hover:not(:disabled) {
    background: #0d8bd9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(29, 161, 242, 0.3);
}

#postsContainer .btn-primary:disabled {
    background: #aab8c2;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#postsContainer .btn-secondary {
    background: #f7f9fa;
    color: #14171a;
    border: 1px solid #e1e8ed;
}

#postsContainer .btn-secondary:hover {
    background: #e1e8ed;
}

#postsContainer .load-more-btn {
    width: 100%;
    max-width: 250px;
    margin: 16px auto;
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#postsContainer .load-more-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#postsContainer .load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading States */
#postsContainer .loading-container {
    text-align: center;
    padding: 30px 16px;
    color: #657786;
}

#postsContainer .loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #1da1f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#postsContainer .btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
/* Empty State */
#postsContainer .empty-state {
    text-align: center;
    padding: 40px 16px;
    color: #657786;
}

#postsContainer .empty-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* Notifications - Global but scoped */
.twitter-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-left: 3px solid #1da1f2;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.twitter-notification.show {
    transform: translateX(0);
}

.twitter-notification.success {
    border-left-color: #17bf63;
}

.twitter-notification.error {
    border-left-color: #e0245e;
}

.twitter-notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.twitter-notification-icon {
    font-size: 1.1rem;
}

.twitter-notification-message {
    font-weight: 500;
    color: #14171a;
    font-size: 0.9rem;
}

/* Edit Tweet Functionality */
.edit-tweet-form {
    margin: 10px 0;
}

.edit-tweet-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #1da1f2;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    background: #ffffff;
    color: #000000;
}

.edit-tweet-input:focus {
    outline: none;
    border-color: #0d8bd9;
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.1);
}

.edit-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.edit-char-count {
    font-size: 12px;
    color: #536471;
    font-weight: 500;
}

.edit-buttons {
    display: flex;
    gap: 8px;
}

.edit-buttons .btn-secondary,
.edit-buttons .btn-primary {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.edit-buttons .btn-secondary {
    background: #f7f9fa;
    color: #536471;
    border: 1px solid #cfd9de;
}

.edit-buttons .btn-secondary:hover {
    background: #e7e9ea;
}

.edit-buttons .btn-primary {
    background: #1da1f2;
    color: white;
}

.edit-buttons .btn-primary:hover:not(:disabled) {
    background: #0d8bd9;
}

.edit-buttons .btn-primary:disabled {
    background: #aab8c2;
    cursor: not-allowed;
}

/* Dark theme support for edit functionality */
#postsContainer.dark-theme .edit-tweet-input {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #333;
}

#postsContainer.dark-theme .edit-tweet-input:focus {
    border-color: #1da1f2;
    box-shadow: 0 0 0 3px rgba(29, 161, 242, 0.3);
}

#postsContainer.dark-theme .edit-char-count {
    color: #8899a6;
}

#postsContainer.dark-theme .edit-buttons .btn-secondary {
    background: #2a2a2a;
    color: #8899a6;
    border-color: #333;
}

#postsContainer.dark-theme .edit-buttons .btn-secondary:hover {
    background: #333;
}

/* Light Theme Support (Default) */
#postsContainer:not(.dark-theme) .post-input-container textarea {
    color: #000000 !important;
    background: #ffffff;
}

#postsContainer:not(.dark-theme) .post-input-container textarea::placeholder {
    color: #666666;
}

#postsContainer:not(.dark-theme) .reply-input {
    color: #000000 !important;
    background: #ffffff;
}

#postsContainer:not(.dark-theme) .reply-input::placeholder {
    color: #666666;
}

#postsContainer:not(.dark-theme) .author-name,
#postsContainer:not(.dark-theme) .tweet-text {
    color: #000000;
}

#postsContainer:not(.dark-theme) .tweet-meta,
#postsContainer:not(.dark-theme) .action-btn {
    color: #536471;
}

/* Manual Dark Theme Support */
#postsContainer.dark-theme .twitter-feed-enhanced {
    background: transparent;
}

#postsContainer.dark-theme .tweet-count {
    background: rgba(29, 161, 242, 0.2);
    color: #1da1f2;
    border-color: rgba(29, 161, 242, 0.3);
}

#postsContainer.dark-theme .theme-toggle {
    background: rgba(29, 161, 242, 0.2);
    border-color: rgba(29, 161, 242, 0.3);
    color: #1da1f2;
}

#postsContainer.dark-theme .create-post-section,
#postsContainer.dark-theme .tweet {
    background: #1a1a1a;
    border-color: #333;
    color: #ffffff;
}

#postsContainer.dark-theme .tweet:hover {
    background: #222;
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.05);
}

#postsContainer.dark-theme .tweet.admin-tweet {
    background: linear-gradient(135deg, #2a2a1a 0%, #1a1a1a 100%);
    border-left-color: #ffd700;
}

#postsContainer.dark-theme .author-name,
#postsContainer.dark-theme .tweet-text {
    color: #ffffff;
}

/* Enhanced content rendering for both themes */
#postsContainer .tweet-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

/* Ensure proper div and br tag handling */
#postsContainer .tweet-text div {
    margin: 0;
    padding: 0;
    display: inline;
}

#postsContainer .tweet-text br {
    display: block;
    margin: 0.5em 0;
    line-height: 0;
}

/* Light theme specific fixes */
#postsContainer:not(.dark-theme) .tweet-text {
    color: #000000 !important;
    background: transparent;
}

/* Dark theme specific fixes */  
#postsContainer.dark-theme .tweet-text {
    color: #ffffff !important;
    background: transparent;
}

#postsContainer.dark-theme .tweet-meta,
#postsContainer.dark-theme .action-btn {
    color: #8899a6;
}

#postsContainer.dark-theme .action-btn:hover:not(:disabled) {
    background: rgba(29, 161, 242, 0.2);
    color: #1da1f2;
}

/* Dark theme enhancements for reply and share buttons */
#postsContainer.dark-theme .action-btn {
    border-color: #333;
}

#postsContainer.dark-theme .action-btn.reply-btn {
    border-color: rgba(29, 161, 242, 0.3);
}

#postsContainer.dark-theme .action-btn.reply-btn:hover {
    background: linear-gradient(135deg, rgba(29, 161, 242, 0.2), rgba(29, 161, 242, 0.1));
    border-color: #1da1f2;
    box-shadow: 0 3px 12px rgba(29, 161, 242, 0.3);
}

#postsContainer.dark-theme .action-btn.share-btn {
    border-color: rgba(23, 191, 99, 0.3);
}

#postsContainer.dark-theme .action-btn.share-btn:hover {
    background: linear-gradient(135deg, rgba(23, 191, 99, 0.2), rgba(23, 191, 99, 0.1));
    border-color: #17bf63;
    box-shadow: 0 3px 12px rgba(23, 191, 99, 0.3);
}

#postsContainer.dark-theme .action-btn .action-count {
    background: rgba(136, 153, 166, 0.2);
}

#postsContainer.dark-theme .action-btn:hover .action-count {
    background: rgba(29, 161, 242, 0.3);
}

#postsContainer.dark-theme .reply-input {
    background: #1a1a1a;
    border-color: #333;
    color: #ffffff;
}

#postsContainer.dark-theme .reply-input:focus {
    border-color: #1da1f2;
    box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.3);
}

#postsContainer.dark-theme .post-input-container textarea {
    color: #ffffff;
}

#postsContainer.dark-theme .post-input-container textarea::placeholder,
#postsContainer.dark-theme .reply-input::placeholder {
    color: #8899a6;
}

#postsContainer.dark-theme .avatar-logo {
    border-color: #1da1f2;
    background: #000000 !important;
    background-color: #000000 !important;
    background-image: none !important;
}

@media (prefers-color-scheme: dark) {
    #postsContainer .twitter-feed-enhanced {
        background: transparent;
    }
    
    #postsContainer .tweet-count {
        background: rgba(29, 161, 242, 0.2);
        color: #1da1f2;
        border-color: rgba(29, 161, 242, 0.3);
    }
    
    #postsContainer .create-post-section,
    #postsContainer .tweet {
        background: #1a1a1a;
        border-color: #333;
        color: #ffffff;
    }
    
    #postsContainer .tweet:hover {
        background: #222;
        box-shadow: 0 2px 12px rgba(255, 255, 255, 0.05);
    }
    
    #postsContainer .tweet.admin-tweet {
        background: linear-gradient(135deg, #2a2a1a 0%, #1a1a1a 100%);
        border-left-color: #ffd700;
    }
    
    #postsContainer .author-name,
    #postsContainer .tweet-text {
        color: #ffffff;
    }
    
    #postsContainer .tweet-meta,
    #postsContainer .action-btn {
        color: #8899a6;
    }
    
    #postsContainer .action-btn:hover:not(:disabled) {
        background: rgba(29, 161, 242, 0.2);
        color: #1da1f2;
    }
    
    #postsContainer .reply-form {
        background: #0f0f0f;
    }
    
    #postsContainer .reply-input {
        background: #1a1a1a;
        border-color: #333;
        color: #ffffff;
    }
    
    #postsContainer .reply-input:focus {
        border-color: #1da1f2;
        box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.3);
    }
    
    #postsContainer .post-input-container textarea {
        color: #ffffff;
    }
    
    #postsContainer .post-input-container textarea::placeholder,
    #postsContainer .reply-input::placeholder {
        color: #8899a6;
    }
    
    #postsContainer .avatar-logo {
        border-color: #1da1f2;
        background: #000000 !important;
        background-color: #000000 !important;
        background-image: none !important;
    }
    
    .twitter-notification {
        background: #1a1a1a;
        color: #ffffff;
        border-left-color: #1da1f2;
    }
    
    .twitter-notification.success {
        border-left-color: #17bf63;
    }
    
    .twitter-notification.error {
        border-left-color: #e0245e;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #postsContainer .twitter-feed-enhanced {
        padding: 12px;
    }
    
    #postsContainer .feed-stats-minimal {
        text-align: center;
        margin-bottom: 12px;
    }
    
    #postsContainer .tweet-count {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    
    #postsContainer .create-post-section,
    #postsContainer .tweet {
        padding: 12px;
        border-radius: 10px;
    }
    
    #postsContainer .tweet-actions {
        max-width: none;
        justify-content: space-around;
    }
    
    #postsContainer .action-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-height: 32px;
        gap: 4px;
    }
    
    #postsContainer .action-btn .action-text {
        display: none; /* Hide text on mobile to save space */
    }
    
    #postsContainer .action-btn .action-icon {
        font-size: 1.1rem;
    }
    
    #postsContainer .action-btn .action-count {
        font-size: 0.75rem;
        padding: 1px 4px;
        min-width: 16px;
    }
    
    #postsContainer .replies-container {
        padding-left: 10px;
    }
    
    .twitter-notification {
        right: 12px;
        left: 12px;
        max-width: none;
    }
    
    #postsContainer .avatar-logo {
        width: 32px;
        height: 32px;
        padding: 0px;
    }
    
    #postsContainer .avatar-logo.small {
        width: 24px;
        height: 24px;
        padding: 0px;
    }
}

/* Admin-specific styling */
.admin-notice {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: 2px solid #e6c200;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: center;
}

.admin-badge {
    font-weight: 600;
    color: #8b5a00;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.admin-notice p {
    margin: 0;
    color: #8b5a00;
    font-size: 0.85rem;
}

.admin-avatar {
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
    color: #8b5a00 !important;
    border: 2px solid #e6c200 !important;
}

.admin-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #8b5a00;
    font-weight: 500;
}

.admin-toggle input[type="checkbox"] {
    accent-color: #ffd700;
}

/* Enhanced admin tweet styling */
.tweet.admin-tweet {
    border-left: 4px solid #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(255, 237, 78, 0.05));
}

.tweet.admin-tweet .admin-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b5a00;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

/* Dark theme admin styling */
.dark-theme .admin-notice {
    background: linear-gradient(135deg, #b8860b, #daa520);
    border-color: #9a7c0a;
}

.dark-theme .admin-badge,
.dark-theme .admin-notice p {
    color: #2c1810;
}

.dark-theme .admin-toggle {
    color: #daa520;
}

.dark-theme .tweet.admin-tweet {
    border-left-color: #daa520;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.1), rgba(184, 134, 11, 0.1));
}

.dark-theme .tweet.admin-tweet .admin-badge {
    background: linear-gradient(135deg, #b8860b, #daa520);
    color: #2c1810;
}

/* Edit Tweet Form Styles */
.edit-tweet-form {
    width: 100%;
    margin: 10px 0;
}

.edit-tweet-input {
    width: 100%;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    max-height: 300px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s ease;
}

.edit-tweet-input:focus {
    border-color: #1da1f2;
    box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.2);
}

.edit-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e1e8ed;
}

.edit-char-count {
    font-size: 0.85rem;
    color: #657786;
}

.edit-buttons {
    display: flex;
    gap: 10px;
}

/* Dark theme support for edit form */
.dark-theme .edit-tweet-input {
    background: #1a1a1a;
    border-color: #333;
    color: #ffffff;
}

.dark-theme .edit-tweet-input:focus {
    border-color: #1da1f2;
    box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.3);
}

.dark-theme .edit-actions {
    border-top-color: #333;
}

.dark-theme .edit-char-count {
    color: #8899a6;
}
