/**
 * Social Newsfeed CSS - Facebook/LinkedIn Style Posts
 * Individual posts with interactions
 */

/* ===== HEADER STYLING ===== */
.chat-header,
.forum-header {
    border: 4px solid #1d4ed8 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    background-color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2) !important;
}

.chat-header h1,
.forum-header h1 {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    color: #000000 !important;
}

.chat-header p,
.forum-header p {
    margin-bottom: 0 !important;
    color: #000000 !important;
}

/* ===== NEWSFEED CONTAINER ===== */
.newsfeed-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ===== POST CREATION BOX ===== */
.post-creation-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    padding: 16px;
}

.post-creation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-creation-avatar {
    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: 16px;
}

.post-creation-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    resize: none;
    min-height: 20px;
    max-height: 120px;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
    background: #f8fafc;
}

.post-creation-input:focus {
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.post-creation-input::placeholder {
    color: #64748b;
}

.post-creation-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    margin-top: 12px;
}

.post-media-options {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.media-btn {
    padding: 8px 14px;
    border: none;
    background: #f8fafc;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.media-btn:hover {
    background: #f1f5f9;
    color: #4f46e5;
    border-color: #c7d2fe;
    transform: translateY(-1px);
}

.media-btn.photo {
    color: #059669;
}

.media-btn.photo:hover {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.media-btn.video {
    color: #dc2626;
}

.media-btn.video:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.media-btn.file {
    color: #7c3aed;
}

.media-btn.file:hover {
    background: #faf5ff;
    color: #6b21a8;
    border-color: #d8b4fe;
}

/* Hidden file inputs */
.media-btn input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.post-submit-btn {
    padding: 8px 20px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease;
}

.post-submit-btn:hover:not(:disabled) {
    background: #4338ca;
}

.post-submit-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

/* ===== NEWSFEED POSTS - Chat Style Layout ===== */
.newsfeed-posts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 8px;
}

/* Default posts (others) - Left aligned */
.newsfeed-post {
    background: transparent !important;
    border-radius: 0;
    box-shadow: none !important;
    overflow: visible;
    transition: none;
    max-width: 85%;
    width: 100%;
    align-self: flex-start;
    margin-bottom: 8px;
    border: none !important;
    padding: 0 !important;
}

/* Current user's posts - Right aligned */
.newsfeed-post.current-user {
    align-self: flex-end;
    margin-left: auto;
    margin-right: 0;
}

.newsfeed-post:hover {
    box-shadow: none;
}

/* Post Bubble Container */
.post-bubble {
    background: #6b7280;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 16px;
    border: 1px solid #4b5563;
    position: relative;
    margin-top: 8px;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 100%;
}

.newsfeed-post.current-user .post-bubble {
    background: linear-gradient(135deg, #87ceeb 0%, #87cefa 100%);
    color: #1e293b;
    border-radius: 18px 18px 4px 18px;
    border: 1px solid #5ba7d4;
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.3);
    width: 100%;
    max-width: 100%;
}

.post-header {
    display: flex;
    align-items: center;
    padding: 0;
    gap: 12px;
    margin-bottom: 12px;
}

.post-avatar {
    width: 36px;
    height: 36px;
    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: 14px;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.newsfeed-post.current-user .post-avatar {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    order: 2;
}

.post-author-info {
    flex: 1;
    min-width: 0;
}

.newsfeed-post.current-user .post-author-info {
    order: 1;
    text-align: right;
}

.post-author-name {
    font-weight: 600;
    font-size: 14px;
    color: #000000;
    margin-bottom: 2px;
}

.newsfeed-post.current-user .post-author-name {
    color: #000000;
}

.post-time {
    font-size: 12px;
    color: #000000;
}

.newsfeed-post.current-user .post-time {
    color: #000000;
}

/* Post Controls - Individual Edit/Delete Buttons */
.post-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
    order: 3;
}

.edit-post-btn,
.delete-post-btn {
    padding: 6px 10px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    border: 1px solid rgba(226, 232, 240, 0.3);
}

.edit-post-btn:hover {
    background: #f8fafc;
    color: #4f46e5;
    border-color: #4f46e5;
}

.delete-post-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #dc2626;
}

.newsfeed-post.current-user .edit-post-btn,
.newsfeed-post.current-user .delete-post-btn {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

.newsfeed-post.current-user .edit-post-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.newsfeed-post.current-user .delete-post-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.4);
}

/* Post Action Buttons - Like/Comment/Share */
.post-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.newsfeed-post.current-user .post-actions {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.post-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    color: #000000;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    border: 1px solid #d1d5db;
    font-weight: 600;
}

.post-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #000000;
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.post-action-btn.edit-btn {
    background: #3b82f6 !important;
    border: 1px solid #2563eb !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    width: auto !important;
    min-width: 60px !important;
    padding: 6px 12px !important;
}

.post-action-btn.edit-btn:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
}

.post-action-btn.delete-btn {
    background: #dc2626 !important;
    border: 1px solid #b91c1c !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    width: auto !important;
    min-width: 70px !important;
    padding: 6px 12px !important;
}

.post-action-btn.delete-btn:hover {
    background: #b91c1c !important;
    color: #ffffff !important;
    border-color: #991b1b !important;
}

.newsfeed-post.current-user .post-action-btn {
    background: #f3f4f6;
    color: #000000;
    border-color: #d1d5db;
}

.newsfeed-post.current-user .post-action-btn.edit-btn {
    background: #3b82f6 !important;
    border: 1px solid #2563eb !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.newsfeed-post.current-user .post-action-btn.delete-btn {
    background: #dc2626 !important;
    border: 1px solid #b91c1c !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.newsfeed-post.current-user .post-action-btn:hover {
    transform: scale(1.05);
}

/* Post Content Styling */
.post-content {
    font-size: 15px;
    line-height: 1.5;
    color: #000000;
    margin-bottom: 12px;
    word-wrap: break-word;
    font-weight: 600;
}

.newsfeed-post.current-user .post-content {
    color: #000000;
    font-weight: 600;
}

/* File Upload and Media */
.post-media {
    margin: 12px 0;
    border-radius: 12px;
    overflow: hidden;
}

.post-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.post-file {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.newsfeed-post.current-user .post-file {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: #4f46e5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    font-size: 14px;
    color: #000000;
    margin-bottom: 2px;
}

.newsfeed-post.current-user .file-name {
    color: #000000;
}

.file-size {
    font-size: 12px;
    color: #000000;
}

.newsfeed-post.current-user .file-size {
    color: #000000;
}

/* Edit mode styles */
.post-content.editing {
    display: none;
}

.post-edit-form {
    display: none;
    padding: 0 16px 12px;
}

.post-edit-form.active {
    display: block;
}

.post-edit-textarea {
    width: 100%;
    min-height: 60px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}

.post-edit-textarea:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.post-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.post-edit-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-edit-save {
    background: #4f46e5;
    color: white;
}

.post-edit-save:hover {
    background: #4338ca;
}

.post-edit-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.post-edit-cancel:hover {
    background: #e2e8f0;
    color: #4a5568;
}

.post-content {
    padding: 0 16px 12px;
    font-size: 15px;
    line-height: 1.5;
    color: #2d3748;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-media {
    margin: 12px 0;
}

.post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.post-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #64748b;
}

.post-likes {
    display: flex;
    align-items: center;
    gap: 4px;
}

.like-emoji {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #e53e3e 0%, #fc8181 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.post-actions {
    display: flex;
    padding: 8px 4px;
    position: relative;
    margin: 8px 0;
}

.action-btn {
    flex: 1;
    padding: 10px 8px;
    border: 2px solid #000000;
    background: transparent;
    color: #000000;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 4px;
}

.action-btn:hover {
    background: #f1f5f9;
    color: #000000;
}

.action-btn.active {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.action-btn.liked {
    color: #e53e3e;
}

.action-btn.liked:hover {
    color: #c53030;
    background: #fed7d7;
}

/* ===== EMOJI REACTIONS ===== */
.emoji-reactions-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    display: none;
    z-index: 1000;
    margin-bottom: 8px;
    min-width: 280px;
}

.emoji-reactions-picker.show {
    display: flex;
    gap: 4px;
    animation: reactionsBounceIn 0.3s ease;
}

.reaction-emoji {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.reaction-emoji:hover {
    transform: scale(1.3);
}

.reaction-emoji::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 4px;
}

.reaction-emoji:hover::before {
    opacity: 1;
}

.post-reactions-summary {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
}

.reaction-count {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.reaction-count .emoji {
    font-size: 14px;
}

.user-reacted {
    background: #e6fffa;
    color: #234e52;
    border: 1px solid #38b2ac;
}

@keyframes reactionsBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(10px);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== COMMENTS SECTION ===== */
.post-comments {
    border-top: 1px solid #e2e8f0;
    background: transparent;
    margin-top: 8px;
    width: 100%;
    position: static !important;
    display: block !important;
    z-index: auto !important;
}

.comments-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px 0;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    margin-bottom: 8px;
}

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

.comment-avatar {
    width: 32px;
    height: 32px;
    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: 12px;
    flex-shrink: 0;
}

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

.comment-bubble {
    background: #f1f5f9;
    border-radius: 18px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border: 1px solid #e2e8f0;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: #000000;
    margin-bottom: 2px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    color: #000000;
}

.comment-time {
    font-size: 12px;
    color: #000000;
    margin-left: 12px;
    font-weight: 500;
}

.comment-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    align-items: flex-end;
}

.comment-input-avatar {
    width: 28px;
    height: 28px;
    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: 11px;
    flex-shrink: 0;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    resize: none;
    min-height: 20px;
    max-height: 80px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.comment-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.comment-submit-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    font-size: 12px;
}

.comment-submit-btn:hover:not(:disabled) {
    background: #4338ca;
}

.comment-submit-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

/* ===== LOADING STATES ===== */
.loading-posts {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #64748b;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #4f46e5;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.no-posts-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-posts h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #4a5568;
}

.no-posts p {
    margin: 0;
    font-size: 14px;
}

/* ===== PINNED POST ===== */
.newsfeed-post.pinned {
    border: 2px solid #4f46e5;
    position: relative;
}

.pinned-badge {
    position: absolute;
    top: -1px;
    right: 12px;
    background: #4f46e5;
    color: white;
    padding: 4px 8px;
    border-radius: 0 0 6px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ===== LOGIN REQUIRED ===== */
.login-required {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.login-required a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

.login-required a:hover {
    text-decoration: underline;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .newsfeed-container {
        padding: 0 8px;
    }
    
    .post-creation-box,
    .newsfeed-post {
        border-radius: 8px;
        margin-bottom: 16px;
    }
    
    .post-creation-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .post-header {
        padding: 12px 12px 8px;
    }
    
    .post-content {
        padding: 0 12px 8px;
        font-size: 14px;
    }
    
    .post-actions {
        padding: 6px 2px;
    }
    
    .action-btn {
        padding: 8px 4px;
        font-size: 13px;
    }
    
    .comment-input-area {
        padding: 8px 12px;
    }
    
    .comments-list {
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .post-creation-header {
        gap: 8px;
    }
    
    .post-creation-avatar,
    .post-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .post-author-name {
        font-size: 14px;
    }
    
    .post-time {
        font-size: 12px;
    }
    
    .post-media-options {
        gap: 4px;
    }
    
    .media-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .post-submit-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .emoji-reactions-picker {
        min-width: 260px;
        padding: 6px 8px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .reaction-emoji {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

/* ===== SCROLLBAR STYLING ===== */
.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .newsfeed-post,
    .action-btn,
    .media-btn,
    .loading-spinner {
        animation: none;
        transition: none;
    }
}

@media (prefers-contrast: high) {
    .newsfeed-post {
        border: 1px solid #2d3748;
    }
    
    .action-btn:hover {
        background: #e2e8f0;
    }
    
    .post-submit-btn {
        background: #2d3748;
    }
}

/* ===== MEDIA UPLOAD STYLES ===== */
.media-preview-container {
    margin: 12px 0;
    padding: 0;
    display: none;
}

.media-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.media-preview img {
    max-width: 100px;
    max-height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.video-icon,
.link-icon {
    width: 50px;
    height: 50px;
    background: #eef2ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #4f46e5;
}

.media-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.media-name {
    font-weight: 500;
    color: #2d3748;
    font-size: 14px;
    word-break: break-all;
}

.media-size,
.media-type {
    font-size: 12px;
    color: #64748b;
}

.remove-media-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.remove-media-btn:hover {
    background: #dc2626;
}

/* Media in posts */
.post-media {
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
}

.post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.post-image:hover {
    transform: scale(1.02);
}

.post-video {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

.post-link-preview {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.post-link-preview:hover {
    background: #f1f5f9;
}

.post-link-icon {
    width: 40px;
    height: 40px;
    background: #eef2ff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #4f46e5;
}

.post-link-info {
    flex: 1;
}

.post-link-title {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 2px;
}

.post-link-url {
    font-size: 12px;
    color: #64748b;
    word-break: break-all;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .newsfeed-container {
        background: #1a202c;
    }
    
    .post-creation-box,
    .newsfeed-post {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .post-creation-input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .post-creation-input::placeholder {
        color: #a0aec0;
    }
    
    .post-author-name,
    .post-content,
    .comment-author,
    .comment-text {
        color: #e2e8f0;
    }
    
    .post-time,
    .comment-time {
        color: #a0aec0;
    }
    
    .action-btn,
    .media-btn {
        color: #cbd5e0;
    }
    
    .action-btn:hover,
    .media-btn:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .post-comments {
        background: #1a202c;
        border-top-color: #4a5568;
    }
    
    .comment-bubble {
        background: #4a5568;
    }
    
    .comment-input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .media-preview {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .media-name {
        color: #e2e8f0;
    }
    
    .post-link-preview {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .post-link-preview:hover {
        background: #374151;
    }
    
    .post-link-title {
        color: #e2e8f0;
    }
}

/* ===== MULTIPLE FILE UPLOAD STYLES ===== */

/* Multiple Files Preview Container */
.multiple-files-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    position: relative;
    transition: all 0.2s ease;
}

.file-preview-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.file-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 11px;
    color: #6b7280;
}

.remove-file-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-file-btn:hover {
    background: #fecaca;
    transform: scale(1.1);
}

/* Enhanced Media Preview Container */
.media-preview-container {
    margin-top: 12px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.media-preview-container .media-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    position: relative;
}

.media-preview-container .remove-media-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.media-preview-container .remove-media-btn:hover {
    background: #fecaca;
    transform: scale(1.1);
}

/* Post Edit Forms */
.post-edit-form {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.post-edit-form.active {
    display: block;
}

.post-edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
}

.post-edit-textarea:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.post-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.post-edit-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.post-edit-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.post-edit-cancel:hover {
    background: #e2e8f0;
}

.post-edit-save {
    background: #4f46e5;
    color: white;
}

.post-edit-save:hover {
    background: #4338ca;
}

.post-edit-save:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.post-content.editing {
    display: none;
}

/* Dark mode support for new elements */
@media (prefers-color-scheme: dark) {
    .multiple-files-preview,
    .file-preview-item,
    .post-edit-form {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .file-preview-item {
        background: #374151;
    }
    
    .file-name {
        color: #e2e8f0;
    }
    
    .file-size {
        color: #a0aec0;
    }
    
    .post-edit-textarea {
        background: #374151;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .post-edit-cancel {
        background: #4a5568;
        color: #cbd5e0;
    }
    
    .post-edit-cancel:hover {
        background: #718096;
    }
}

/* Comments toggle button */
.comments-toggle-btn {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comments-toggle-btn:hover {
    background: #f3f4f6;
    color: #000000;
}

.comments-toggle-btn.expanded i {
    transform: rotate(180deg);
}

.comments-toggle-btn i {
    transition: transform 0.2s ease;
}