/* ============================================================
   public/css/feed.css
   Styles du fil social — onglet Accueil
   ============================================================ */

/* ===================== ZONE MÉTÉO FIGÉE ===================== */
.accueil-meteo-fixed {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

/* ===================== FEED CONTENEUR ===================== */
.accueil-feed {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: #f3f4f6;
}

/* ===================== HEADER FEED ===================== */
.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    width: 100%;
    max-width: 600px;
}

.feed-filters {
    display: flex;
    gap: 8px;
}

.feed-filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all .2s;
}

.feed-filter-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}

.feed-new-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(124,58,237,.25);
}

/* ===================== FEED LIST ===================== */
#feed-list {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===================== CARD POST ===================== */
.feed-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.feed-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.feed-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.feed-avatar-initiale {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-username {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-handle {
    font-size: 11px;
    color: #9ca3af;
}

.feed-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.feed-follow-btn {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid #7c3aed;
    background: #fff;
    color: #7c3aed;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.feed-follow-btn.following {
    background: #7c3aed;
    color: #fff;
}

.feed-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #d1d5db;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s, background .2s;
}

.feed-action-btn:hover {
    color: #7c3aed;
    background: #f3f0ff;
}

.feed-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #d1d5db;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s, background .2s;
}

.feed-delete-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* ===================== CONTENU POST ===================== */
.feed-contenu {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===================== PHOTO POST ===================== */
.feed-photo-wrap {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: center;
}

.feed-photo {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    display: block;
    cursor: pointer;
    transition: opacity .2s;
    background: #f3f4f6;
}

.feed-photo:hover {
    opacity: .92;
}

/* ===================== FOOTER POST ===================== */
.feed-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

.feed-like-btn,
.feed-comment-btn,
.feed-share-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
    transition: color .2s;
}

.feed-like-btn:hover    { color: #7c3aed; }
.feed-like-btn.liked    { color: #7c3aed; }
.feed-comment-btn:hover { color: #7c3aed; }
.feed-share-btn:hover   { color: #7c3aed; }

.feed-like-count {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===================== COMMENTAIRES ===================== */
.feed-comments {
    border-top: 1px solid #f3f4f6;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feed-comment {
    background: #f9fafb;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feed-comment-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.feed-comment-author {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
}

.feed-comment-date {
    font-size: 11px;
    color: #9ca3af;
}

.feed-comment-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.feed-comment-edit-btn,
.feed-comment-delete,
.feed-comment-like-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #d1d5db;
    padding: 3px 5px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    transition: color .2s, background .2s;
}

.feed-comment-edit-btn:hover  { color: #7c3aed; background: #f3f0ff; }
.feed-comment-delete:hover    { color: #ef4444; background: #fee2e2; }
.feed-comment-like-btn:hover  { color: #7c3aed; }
.feed-comment-like-btn.liked  { color: #7c3aed; }

.feed-comment-contenu {
    font-size: 13px;
    color: #374151;
    word-break: break-word;
    line-height: 1.5;
}

.feed-comment-form {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    position: relative;   /* requis pour dropdown @mention */
}

.feed-comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color .2s;
}

.feed-comment-input:focus {
    border-color: #7c3aed;
}

.feed-comment-send {
    padding: 8px 14px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

/* ===================== ÉTATS ===================== */
.feed-loading,
.feed-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    padding: 24px 0;
}

/* ===================== PLACEHOLDER ===================== */
.feed-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #9ca3af;
    font-size: 15px;
    font-weight: 600;
    background: #fff;
    border-radius: 16px;
    border: 2px dashed #e5e7eb;
    margin: 8px 0;
}

/* ===================== @MENTION TAG ===================== */
.mention-tag {
    display: inline;
    color: #7c3aed;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    padding: 0 2px;
    transition: background .15s, color .15s;
}

.mention-tag:hover {
    background: #f3e8ff;
    color: #6d28d9;
}

/* ===================== @MENTION DROPDOWN ===================== */
.mention-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);  /* s'ouvre AU-DESSUS du champ */
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 500;
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
}

/* Dans la modale nouveau post / édition : s'ouvre en dessous */
.modal .mention-dropdown {
    bottom: auto;
    top: calc(100% + 4px);
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid #f3f4f6;
}

.mention-item:last-child {
    border-bottom: none;
}

.mention-item:hover,
.mention-item.active {
    background: #f5f3ff;
}
