/**
 * posts.css - Styles pour les publications et le formulaire de création
 */

/* Styles pour le formulaire de création de publication */
#create-post-container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

#create-post-container .composer-header {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

#create-post-container img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

#create-post-container textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    min-height: 60px;
    font-size: 14px;
    font-family: inherit;
    padding: 10px 0;
    background-color: transparent;
}

#create-post-container textarea::placeholder {
    color: #888;
}

#create-post-container .post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid #eee;
}

#create-post-container .btn-icon {
    background-color: transparent;
    border: none;
    color: #555;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

#create-post-container .btn-icon:hover {
    background-color: #f0f2f5;
}

#create-post-container .btn-icon i {
    font-size: 16px;
}

#create-post-container .btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

#create-post-container .btn-primary:disabled {
    background-color: var(--primary-color-light);
    cursor: not-allowed;
}

/* Styles pour la prévisualisation des médias */
.media-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 16px;
    margin-bottom: 12px;
}

.media-preview-item {
    position: relative;
    width: calc(25% - 8px);
    border-radius: 8px;
    overflow: hidden;
}

.media-preview-item img, 
.media-preview-item video {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.remove-media-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.remove-media-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Styles pour l'affichage de la localisation */
.location-container {
    padding: 0 16px;
    margin-bottom: 12px;
}

.selected-location {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f0f2f5;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.selected-location i {
    color: var(--primary-color);
}

.remove-location-btn {
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    margin-left: auto;
}

/* Styles pour les notifications */
#notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 280px;
    max-width: 400px;
    animation: fadeIn 0.3s ease-out;
}

.notification.success { background-color: #28a745; }
.notification.error { background-color: #dc3545; }
.notification.info { background-color: #17a2b8; }

.notification .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
}

/* Styles pour les publications existantes */
.post-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.post-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

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

.post-user-info h4 {
    margin: 0;
    font-size: 15px;
}

.post-user-info .post-meta {
    font-size: 13px;
    color: #666;
}

.post-content {
    padding: 0 16px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.post-media {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
}

.post-media img, 
.post-media video {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 4px;
}

.post-actions-buttons {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #eee;
    padding: 8px 0;
}

.post-action-btn {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #555;
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-action-btn:hover {
    background-color: #f0f2f5;
}

.post-action-btn.liked {
    color: #1877f2;
}

.post-stats {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #eee;
}

/* Styles pour le menu contextuel (trois points) */
.post-menu {
    position: relative;
}

.post-menu-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.post-menu-btn:hover {
    background-color: #f0f2f5;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 10;
    min-width: 180px;
    overflow: hidden;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 10px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.dropdown-menu button:hover {
    background-color: #f5f5f5;
}

.dropdown-menu button i {
    width: 16px;
}

.dropdown-menu .edit-post-btn:hover {
    color: #2196F3;
}

.dropdown-menu .delete-post-btn:hover {
    color: #F44336;
}

.dropdown-menu .report-post-btn:hover {
    color: #FF9800;
}

.dropdown-menu .block-user-btn:hover {
    color: #9C27B0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Styles pour les actions sur les publications (like, commentaire, partage) */
.post-actions-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    padding: 10px 16px;
}

.post-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: #555;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-action:hover {
    background-color: #f0f2f5;
}

.post-action.liked {
    color: #1877f2;
}

.post-action.liked i {
    animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Styles pour la section des commentaires */
.comments-section {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

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

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-author-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    background-color: white;
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-author-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.comment-time {
    font-size: 12px;
    color: #777;
}

.comment-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.comment-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.comment-input:focus {
    border-color: var(--primary-color);
}

.send-comment-btn {
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.send-comment-btn:hover {
    background-color: #e6e6e6;
}

.send-comment-btn:disabled {
    color: #999;
    cursor: not-allowed;
}

.no-comments {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #777;
    text-align: center;
}

.no-comments i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #999;
}

/* Styles pour les médias dans les commentaires */
.comment-media {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.comment-image-container,
.comment-video-container {
    position: relative;
    width: calc(50% - 4px);
    max-width: 250px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 5px;
}

.comment-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    transition: opacity 0.2s;
}

.comment-image:hover {
    opacity: 0.9;
}

.comment-video-container video {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: 8px;
}

/* Styles pour le formulaire de commentaire avec médias */
.comment-form {
    position: relative;
}

.comment-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.add-comment-media-btn {
    background-color: transparent;
    border: none;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.add-comment-media-btn:hover {
    background-color: #e6e6e6;
    color: var(--primary-color);
}

.comment-media-preview-container {
    margin: 8px 0;
    padding: 8px;
    background-color: #f8f8f8;
    border-radius: 8px;
}

.comment-media-preview {
    position: relative;
    margin-bottom: 8px;
}

.comment-media-preview-img,
.comment-media-preview-video {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: 6px;
    display: block;
}

.remove-comment-media-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.remove-comment-media-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Styles pour l'édition des commentaires */
.edit-comment-form {
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
}

.edit-comment-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 10px;
}

.edit-comment-media-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.edit-comment-media-item {
    position: relative;
    width: calc(50% - 4px);
    max-width: 200px;
}

.edit-comment-media-preview {
    width: 100%;
    height: auto;
    max-height: 150px;
    border-radius: 4px;
    object-fit: cover;
}

.edit-comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.cancel-edit-comment-btn,
.save-edit-comment-btn {
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    border: none;
}

.cancel-edit-comment-btn {
    background-color: #f0f0f0;
    color: #555;
}

.save-edit-comment-btn {
    background-color: var(--primary-color);
    color: white;
}

.add-edit-comment-media-btn {
    background-color: transparent;
    border: none;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-edit-comment-media-btn:hover {
    color: var(--primary-color);
}

.remove-edit-media-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

/* Styles pour le commentaire */
.comment-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    position: relative;
}

.comment-author-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2px;
}

.comment-author-info {
    display: flex;
    flex-direction: column;
}

.comment-author-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    text-decoration: none;
}

.comment-time {
    font-size: 11px;
    color: #888;
}

.edited-indicator {
    font-size: 11px;
    color: #888;
    margin-left: 4px;
}

.comment-text {
    font-size: 14px;
    margin: 2px 0 5px;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    gap: 8px;
    margin-left: auto; /* Pousse les boutons à droite */
}

.btn-icon {
    background-color: rgba(240, 240, 240, 0.6);
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px; /* Boutons arrondis */
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    text-transform: none;
    font-weight: normal;
}

.btn-icon i {
    margin-right: 4px;
    font-size: 12px;
}

.btn-icon:hover {
    background-color: rgba(240, 240, 240, 0.9);
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.edit-comment-btn {
    color: #2980b9;
}

.edit-comment-btn:hover {
    color: #2980b9;
    background-color: rgba(41, 128, 185, 0.1);
}

.delete-comment-btn {
    color: #e74c3c;
}

.delete-comment-btn:hover {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

/* Adaptations pour les mobiles */

/* Adaptations pour les mobiles */
@media (max-width: 480px) {
    .comment-image-container,
    .comment-video-container,
    .edit-comment-media-item {
        width: 100%;
    }
}

/* Styles pour la modal de partage */
.share-modal .modal-content {
    max-width: 500px;
}

.share-options button {
    font-weight: 500;
}

.external-share {
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 768px) {
    .media-preview-item {
        width: calc(50% - 8px);
    }
    
    .post-actions-footer {
        justify-content: space-around;
    }
    
    .post-action {
        font-size: 13px;
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .media-preview-item {
        width: 100%;
    }
    
    #create-post-container .post-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    #create-post-container .btn-primary {
        margin-top: 8px;
        width: 100%;
    }
    
    .comment-input {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Styles pour les posts partagés */
.shared-post-container {
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0 15px 0;
    background-color: #f8f8f8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shared-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.shared-author-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.shared-author-info {
    display: flex;
    flex-direction: column;
}

.shared-author-name {
    font-weight: 600;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}

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

.shared-post-date {
    font-size: 0.75rem;
    color: #666;
}

.shared-post-content {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 15px;
}

.shared-post-media {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.shared-media-item {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

.shared-media-item img,
.shared-media-item video {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

.shared-post-media-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    margin-bottom: 15px;
}

.shared-media-grid-item {
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
}

.shared-media-grid-item img,
.shared-media-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.view-original-post {
    display: inline-block;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    margin-top: 5px;
    transition: color 0.2s;
}

.view-original-post:hover {
    color: var(--primary-color-dark);
    text-decoration: underline;
}

.shared-post-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e6e6e6;
    color: #666;
    font-size: 0.8rem;
}

.shared-post-actions {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}

.shared-post-action-btn {
    flex: 1;
    background-color: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    gap: 5px;
}

.shared-post-action-btn:hover {
    background-color: #eee;
}

.shared-post-action-btn.liked {
    color: #1877f2;
}

.shared-post-action-btn i {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .shared-post-container {
        padding: 10px;
        margin: 8px 0 12px 0;
    }
    
    .shared-author-img {
        width: 32px;
        height: 32px;
    }
    
    .shared-media-item {
        max-height: 200px;
    }
    
    .shared-post-action-btn {
        padding: 5px;
        font-size: 0.75rem;
    }
    
    .shared-post-stats {
        gap: 10px;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
}
