/* Styles modernes pour les posts et interactions */

/* Filtres du fil d'actualité */
.feed-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.filter-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

/* Posts */
.post {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    opacity: 0;
    transition: var(--transition);
}

.post:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.post-author-info {
    flex: 1;
    margin-left: 16px;
}

.post-author-name {
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    transition: var(--transition);
}

.post-author-name:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.post-time {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.post-options {
    position: relative;
}

.post-option-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.post-option-btn:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

.post-content {
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 15px;
}

.post-content p {
    margin-bottom: 12px;
}

.post-content p:last-child {
    margin-bottom: 0;
}

.post-image {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.post-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Statistiques des posts */
.post-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.post-stats .likes-count::before {
    content: '👍';
    font-size: 16px;
}

.post-stats .comments-count::before {
    content: '💬';
    font-size: 16px;
}

.post-stats .shares-count::before {
    content: '🔄';
    font-size: 16px;
}

/* Barre d'actions des posts */
.post-actions-bar {
    display: flex;
    justify-content: space-around;
    gap: 8px;
}

.post-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.post-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.post-action:hover::before {
    left: 100%;
}

.post-action:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.post-action.liked {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.post-action.liked .icon {
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.post-action .icon {
    margin-right: 8px;
    font-size: 16px;
    transition: var(--transition);
}

/* Section des commentaires */
.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.comments-list {
    margin-bottom: 20px;
}

.comment {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.comment:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

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

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
}

.comment-author:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.comment-time {
    color: var(--text-muted);
    font-size: 12px;
}

.comment-text {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    gap: 16px;
}

.comment-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.comment-action:hover {
    background: var(--bg-hover);
    color: var(--primary-color);
}

/* Formulaire de commentaire */
.comment-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.comment-input-container {
    flex: 1;
    position: relative;
}

.comment-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: var(--bg-secondary);
    font-size: 14px;
    resize: none;
    min-height: 40px;
    transition: var(--transition);
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.comment-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    white-space: nowrap;
}

.comment-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Animations pour les nouveaux posts */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post.new-post {
    animation: slideInUp 0.5s ease-out;
}

/* États de chargement */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Bouton charger plus */
.load-more-container {
    text-align: center;
    margin-top: 32px;
}

.load-more-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 25px;
    padding: 16px 32px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messages d'état */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-posts p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .feed-filters {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .filter-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .post {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .post-actions-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .post-action {
        padding: 14px 20px;
    }
    
    .comment {
        padding: 12px;
    }
    
    .comment-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .comment-submit {
        align-self: flex-end;
        margin-top: 8px;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .post {
        background: #242526;
        border-color: #3a3b3c;
    }
    
    .post:hover {
        border-color: var(--primary-color);
    }
    
    .post-stats {
        border-color: #3a3b3c;
    }
    
    .comment {
        background: #3a3b3c;
    }
    
    .comment:hover {
        background: #4a4b4c;
    }
    
    .comment-input {
        background: #3a3b3c;
        border-color: #4a4b4c;
        color: #e4e6ea;
    }
    
    .comment-input:focus {
        background: #242526;
        border-color: var(--primary-color);
    }
}
