/* Social v3 - Clean Comments & Notifications */

/* ==================== POST CARD ==================== */
.post-card {
    background: var(--card-bg, #1e1e2e);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color, #333);
    transition: box-shadow 0.3s;
}

.post-card.highlight {
    box-shadow: 0 0 0 2px var(--primary-color, #4CAF50);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-author {
    font-weight: 600;
    color: var(--primary-color, #4CAF50);
    cursor: pointer;
}

.post-author:hover {
    text-decoration: underline;
}

.post-time {
    color: var(--text-muted, #888);
    font-size: 0.8rem;
    margin-left: auto;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

.post-plant-tag {
    display: inline-block;
    background: var(--tag-bg, rgba(76, 175, 80, 0.15));
    color: var(--primary-color, #4CAF50);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.post-content {
    margin: 0.75rem 0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-media {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin-top: 0.5rem;
    background: #000;
}

/* ==================== POST ACTIONS ==================== */
.post-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #333);
    margin-top: 0.75rem;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    color: var(--text-muted, #888);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    transition: all 0.2s;
}

.btn-action:hover {
    background: var(--hover-bg, rgba(255,255,255,0.08));
    color: var(--text-color, #fff);
}

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

.btn-action.liked:hover {
    background: rgba(231, 76, 60, 0.15);
}

/* ==================== COMMENTS ==================== */
.comments-wrapper {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #333);
}

.comments-container {
    background: var(--comment-bg, rgba(0,0,0,0.2));
    border-radius: 12px;
    padding: 0.75rem;
}

.comments-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}

.no-comments, .error-small {
    text-align: center;
    color: var(--text-muted, #666);
    font-size: 0.85rem;
    padding: 1rem 0;
}

.comment-item {
    margin-bottom: 0.75rem;
}

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

.comment-bubble {
    background: var(--bubble-bg, rgba(255,255,255,0.08));
    padding: 0.6rem 0.85rem;
    border-radius: 18px;
    display: inline-block;
    max-width: 100%;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-light, #81C784);
    margin-right: 0.5rem;
}

.comment-text {
    font-size: 0.9rem;
    color: var(--text-color, #eee);
    word-wrap: break-word;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
    padding-left: 0.85rem;
}

.comment-time {
    font-size: 0.7rem;
    color: var(--text-muted, #666);
}

.btn-delete-comment {
    background: none;
    border: none;
    color: var(--text-muted, #666);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
}

.btn-delete-comment:hover {
    color: #e74c3c;
    text-decoration: underline;
}

/* Comment Input */
.comment-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.comment-input-row input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color, #444);
    border-radius: 24px;
    background: var(--input-bg, #1a1a2e);
    color: var(--text-color, #fff);
    font-size: 0.9rem;
}

.comment-input-row input:focus {
    outline: none;
    border-color: var(--primary-color, #4CAF50);
}

.comment-input-row input:disabled {
    opacity: 0.6;
}

.btn-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color, #4CAF50);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.btn-send:hover {
    background: var(--primary-dark, #388E3C);
    transform: scale(1.05);
}

/* ==================== NOTIFICATIONS ==================== */
.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0.5rem;
}

#notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #e74c3c;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notifications-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #333);
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0.5rem;
}

.notification-item:hover {
    background: var(--hover-bg, rgba(255,255,255,0.05));
}

.notification-item.unread {
    background: var(--unread-bg, rgba(76, 175, 80, 0.1));
    border-left: 3px solid var(--primary-color, #4CAF50);
}

.notif-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

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

.notif-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-color, #eee);
}

.notif-text strong {
    color: var(--primary-light, #81C784);
}

.notif-post-preview {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--text-muted, #666);
    margin-top: 0.25rem;
}

.empty-notifications {
    text-align: center;
    color: var(--text-muted, #888);
    padding: 2rem;
}

/* ==================== LOADING ==================== */
.loading-small {
    text-align: center;
    color: var(--text-muted, #666);
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .post-card {
        padding: 0.75rem;
        border-radius: 0;
        margin-bottom: 0.5rem;
    }
    
    .post-actions {
        gap: 0.5rem;
    }
    
    .btn-action {
        padding: 0.35rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .comments-container {
        padding: 0.5rem;
    }
    
    .comment-bubble {
        padding: 0.5rem 0.7rem;
    }
    
    .comments-list {
        max-height: 200px;
    }
    
    .notifications-list {
        max-height: 300px;
    }
}

/* Compact tabs on mobile */
@media (max-width: 500px) {
    .tab-nav {
        gap: 0 !important;
    }
    
    .tab-btn {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.75rem !important;
        flex: 1;
        white-space: nowrap;
    }
    
    #social-tab .section-header {
        flex-wrap: nowrap;
        gap: 0.3rem;
    }
    
    #social-tab .section-header h2 {
        font-size: 1.1rem;
    }
    
    #social-tab .header-actions {
        gap: 0.3rem;
    }
    
    #social-tab .header-actions .btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .notification-bell {
        padding: 0.3rem !important;
        font-size: 1.2rem !important;
    }
}

/* Force compact tabs on mobile - stronger selectors */
@media (max-width: 520px) {
    nav.tab-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        overflow-x: auto;
    }
    
    nav.tab-nav .tab-btn {
        padding: 0.4rem 0.35rem !important;
        font-size: 0.7rem !important;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
    }
}

@media (max-width: 400px) {
    nav.tab-nav .tab-btn {
        padding: 0.4rem 0.25rem !important;
        font-size: 0.65rem !important;
    }
}

/* Tab notification badge */
.tab-badge {
    background: #e74c3c;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
}
