/**
 * Styles CSS du module Posts/Feed
 * Fichier: modules/Posts/css/posts.css
 */
 /**
 * AJOUTER À posts.css - Styles pour la modale des réactions
 */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.3; }
}

#recordingDot {
    animation: blink 1s infinite;
}
/* Modale des réactions */
#reactionsModal .modal-body {
    padding: 0;
}

#reactionsModal .nav-pills {
    padding: 1rem;
    padding-bottom: 0;
    border-bottom: 1px solid #dee2e6;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
}

#reactionsModal .nav-pills .nav-item {
    flex-shrink: 0;
}

#reactionsModal .nav-pills .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#reactionsModal .nav-pills .nav-link:hover {
    background-color: #f8f9fa;
}

#reactionsModal .nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: white;
}

#reactionsModal .nav-pills .badge {
    font-size: 0.75rem;
}

#reactionsList {
    padding: 1rem;
}

#reactionsList .list-group-item {
    border: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s;
}

#reactionsList .list-group-item:hover {
    background-color: #f8f9fa;
}

#reactionsList .list-group-item img {
    object-fit: cover;
}

/* Amélioration des stats de post */
.post-stats a {
    transition: all 0.2s;
}

.post-stats a:hover {
    color: #0d6efd !important;
    text-decoration: underline !important;
}

/* Animation du compteur */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.post-stats a span {
    display: inline-block;
}

.post-stats a:hover span {
    animation: pulse 0.3s ease-in-out;
}

/* Picker de réactions amélioré */
.reaction-picker {
    position: absolute;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px 12px;
    display: flex;
    gap: 4px;
    z-index: 1000;
    margin-top: -50px;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reaction-picker button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: all 0.2s;
}

.reaction-picker button:hover {
    background-color: #f0f2f5;
    transform: scale(1.3);
}

/* Bouton J'aime actif */
.post-actions button.active {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 576px) {
    #reactionsModal .nav-pills {
        padding: 0.5rem;
    }
    
    #reactionsModal .nav-pills .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    #reactionsList .list-group-item img {
        width: 32px !important;
        height: 32px !important;
    }
    
    .reaction-picker {
        margin-top: -45px;
        padding: 6px 8px;
    }
    
    .reaction-picker button {
        font-size: 1.3rem;
        padding: 3px 6px;
    }
}
 
 
/* Header du site */
#uppernavbar {
    position: fixed;  /* rester en haut même au scroll */
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;    /* plus haut que la modale */
}

#postModal .modal-dialog {
    margin-top: 60px; /* décale toute la modale vers le bas */
}

#postModal .modal-content {
    height: calc(80vh - 50px); /* ajuste la hauteur pour ne pas dépasser l'écran */
}

.post-media-row {
    display: flex;
   
    gap: 4px;
}

.post-media-row .photo {
    flex: 1; /* 3 photos = 3 colonnes égales */
    height: 120px; /* hauteur fixe */
    overflow: hidden;
    border-radius: 6px;
    position: relative;
}

.post-media-row .photo img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* crop propre */
    display: block;
}

.photo-overlay .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 26px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
}


/* ===== Cartes de posts ===== */
.post-card {
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.post-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-create-card {
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.post-create-card textarea {
    border: none;
    resize: none;
    min-height: 60px;
}

.post-create-card textarea:focus {
    outline: none;
    box-shadow: none;
}

/* ===== Contenu des posts ===== */
.post-content {
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.post-content p {
    margin-bottom: 0.5rem;
}

.post-content a {
    color: #1877f2;
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

/* ===== Médias ===== */
.post-media {
    margin: 10px 0;
}

.post-media.single-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
}

.post-media-grid {
    display: grid;
    gap: 4px;
    border-radius: 8px;
    overflow: hidden;
}

.post-media-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.post-media-grid.grid-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.post-media-grid.grid-3 img:first-child {
    grid-row: 1 / 3;
}

.post-media-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.post-media-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-media-grid img:hover {
    opacity: 0.9;
}

/* ===== Post partagé ===== */
.shared-post {
    background: #f0f2f5;
    border: 1px solid #dddfe2;
    margin-top: 10px;
}

/* ===== Stats et actions ===== */
.post-stats {
    font-size: 14px;
}

.post-actions {
    padding: 4px 0;
}

.post-actions button {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.post-actions button:hover {
    background-color: #f0f2f5;
}

.post-actions button.active {
    color: #1877f2;
}

/* ===== Sélecteur de réactions ===== */
.reaction-picker {
    position: absolute;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: flex;
    gap: 4px;
    margin-top: 8px;
    z-index: 1000;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.reaction-picker button {
    border: none;
    background: transparent;
    font-size: 28px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.2s;
}

.reaction-picker button:hover {
    transform: scale(1.3);
}

/* ===== Commentaires ===== */
.comments-section {
    border-top: 1px solid #e4e6eb;
    padding-top: 12px;
}

.comment {
    margin-bottom: 8px;
}

.comment-content {
    background: #f0f2f5;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 100%;
}

.comment-content strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

.comment-content p {
    font-size: 14px;
    margin: 0;
}

.comment-actions {
    padding-left: 12px;
}

.comment-actions a {
    font-size: 12px;
    font-weight: 600;
    color: #65676b;
}

.comment-actions a:hover {
    text-decoration: underline;
    color: #050505;
}

.replies {
    margin-left: 40px;
}

/* ===== Input commentaire ===== */
#comments-section input {
    border-radius: 20px;
    border: 1px solid #ccd0d5;
    padding: 8px 12px;
    font-size: 14px;
}

#comments-section input:focus {
    outline: none;
    border-color: #1877f2;
}

/* ===== Prévisualisation médias ===== */
#media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#media-preview img,
#media-preview video {
    border-radius: 8px;
}

/* ===== Badges ===== */
.badge {
    font-weight: 500;
    padding: 4px 8px;
}

/* ===== Sidebar ===== */
.list-group-item {
    border: none;
    padding: 10px 16px;
    color: #050505;
    font-weight: 500;
}

.list-group-item:hover {
    background-color: #f0f2f5;
}

.list-group-item i {
    width: 24px;
    color: #65676b;
}

/* ===== Animations ===== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Scrollbar personnalisé ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f2f5;
}

::-webkit-scrollbar-thumb {
    background: #bcc0c4;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8a8d91;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .post-media-grid img {
        height: 150px;
    }
    
    .post-media.single-image img {
        max-height: 300px;
    }
    
    .post-actions button {
        font-size: 12px;
        padding: 6px;
    }
    
    .reaction-picker button {
        font-size: 20px;
        padding: 2px 4px;
    }
    
    .replies {
        margin-left: 20px;
    }
}

/* ===== États vides ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #65676b;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ===== Loading ===== */
.post-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1877f2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Dropdown menu ===== */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
}

.dropdown-item i {
    width: 20px;
    margin-right: 8px;
}

/* ===== Tooltips ===== */
[title] {
    position: relative;
}

/* ===== Mentions et hashtags ===== */
.mention {
    color: #1877f2;
    font-weight: 600;
}

.hashtag {
    color: #1877f2;
    font-weight: 500;
}

.mention:hover,
.hashtag:hover {
    text-decoration: underline;
}