/* ============================================================
   post-thread.css — Post Thread Modal styles
   ============================================================ */

/* ── Original Post (expanded) ─────────────────────────────── */

.thread-original-post {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.thread-post-header {
    margin-bottom: 12px;
}

.thread-author-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.thread-author-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.thread-author-name {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}
.thread-author-name:hover {
    text-decoration: underline;
}

.thread-post-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.thread-tribe-link {
    color: #10b981;
    font-weight: 500;
}
.thread-tribe-link:hover {
    text-decoration: underline;
}

.thread-post-content {
    font-size: 16px;
    line-height: 1.6;
    color: #111827;
    padding: 8px 0 16px;
    word-wrap: break-word;
}

/* Stats row */
.thread-post-stats {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}

.thread-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}

/* Action buttons */
.thread-post-actions {
    display: flex;
    justify-content: space-around;
    padding: 8px 0 0;
}

.thread-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.thread-action-btn:hover {
    background: #f3f4f6;
}
.thread-action-btn.liked {
    color: #ef4444;
}
.thread-action-btn.liked svg {
    fill: #ef4444;
    stroke: #ef4444;
}

/* ── Divider ──────────────────────────────────────────────── */

.thread-divider {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

/* ── Replies ──────────────────────────────────────────────── */

.thread-replies {
    padding: 8px 0;
    /* Leave room for the sticky reply input */
    padding-bottom: 80px;
}

.thread-replies-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: #6b7280;
    font-size: 14px;
}

.thread-reply {
    display: flex;
    gap: 0;
    padding: 8px 16px;
    transition: background 0.15s;
}
.thread-reply:hover {
    background: #f9fafb;
}

.thread-reply-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 44px;
    flex-shrink: 0;
}

.thread-reply-connector {
    flex: 1;
    width: 2px;
    background: #e5e7eb;
    margin-top: 4px;
    min-height: 8px;
}

/* Hide connector on last reply */
.thread-reply:last-of-type .thread-reply-connector {
    display: none;
}

.thread-reply-body {
    flex: 1;
    min-width: 0;
    padding: 2px 0 12px 8px;
}

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

.thread-reply-author {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}
.thread-reply-author:hover {
    text-decoration: underline;
}

.thread-reply-time {
    font-size: 12px;
    color: #9ca3af;
}

.thread-reply-you-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: #10b981;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thread-reply-text {
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    word-wrap: break-word;
}

.thread-reply-actions {
    margin-top: 4px;
}

.thread-reply-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}
.thread-reply-action:hover {
    background: #f3f4f6;
    color: #6b7280;
}
.thread-reply-action.liked {
    color: #ef4444;
}

/* ── Reply Input (sticky bottom) ──────────────────────────── */

.thread-reply-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    position: sticky;
    bottom: 0;
}

.thread-reply-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.thread-reply-input input:focus {
    border-color: #10b981;
}

.thread-reply-send {
    background: #10b981;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s;
    flex-shrink: 0;
}
.thread-reply-send:hover {
    background: #059669;
}

/* ── Make the modal scrollable ────────────────────────────── */

#postThreadModal .modal-body {
    max-height: 75vh;
    overflow-y: auto;
    padding: 0;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    #postThreadModal .modal-container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    #postThreadModal .modal-body {
        max-height: calc(100vh - 56px);
        /* Account for header */
    }

    .thread-post-content {
        font-size: 15px;
    }

    .thread-action-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}
