/* ===========================================
   AGOCARE - SOCIAL MEDIA FEED LAYOUT
   Twitter/Instagram-style centered feed
   Layout & structure only — no color changes
   =========================================== */

/* ─── Feed Layout: 3 columns, full-width ── */
.feed-layout {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 68px 0 24px;
    display: flex;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ─── Left Sidebar (sticky nav) ──────────── */
.feed-sidebar-left {
    position: sticky;
    top: 72px;
    width: 250px;
    min-width: 250px;
    height: fit-content;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    scrollbar-width: none;
    padding-left: 16px;
}
.feed-sidebar-left::-webkit-scrollbar { display: none; }

.feed-nav-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-bottom: 6px;
}

.feed-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.feed-nav-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}
.feed-nav-item.active {
    color: #0d9488;
    font-weight: 600;
    background: #f0fdfa;
}
.feed-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.feed-nav-section {
    margin-bottom: 20px;
}

.feed-nav-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 12px 0;
}

/* ─── Center Feed Column ─────────────────── */
.feed-center {
    flex: 1;
    min-width: 0;
    padding: 0 24px;
}

/* Compose / Ask prompt (Twitter-style) */
.feed-compose {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-compose-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
}

.feed-compose-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 15px;
    color: #6b7280;
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.feed-compose-input:hover {
    border-color: #9ca3af;
}

/* Sort Tabs (Twitter-style underline tabs) */
.feed-tabs {
    display: flex;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 8px;
}

.feed-tab {
    flex: 1;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    text-align: center;
}
.feed-tab:hover {
    color: #1f2937;
    background: #f8fafc;
}
.feed-tab.active {
    color: #0d9488;
    border-bottom-color: #0d9488;
}

/* ─── Question Card (Twitter/IG post style) ─ */
.q-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 0;
    transition: background 0.15s;
}
.q-card:first-child {
    border-top: 1px solid #e5e7eb;
}
.q-card:hover {
    background: #fafafa;
    box-shadow: none;
}

.q-card-body {
    padding: 14px 16px 6px;
}

/* Topic Tag (hashtag pill, IG style — above content) */
.q-topic-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.q-topic-tag:hover { opacity: 0.8; }

/* Author Row (Twitter-style: avatar | name+meta | timestamp right) */
.q-author-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.q-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 15px;
    flex-shrink: 0;
}

.q-author-info {
    flex: 1;
    min-width: 0;
}

.q-author-name {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}
.q-author-name .q-verified {
    color: #0d9488;
    font-size: 15px;
}

.q-author-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}
.q-author-meta .dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #9ca3af;
}

.q-timestamp {
    font-size: 13px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.q-follow-btn {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid #0d9488;
    background: transparent;
    color: #0d9488;
    flex-shrink: 0;
    margin-top: 2px;
}
.q-follow-btn:hover {
    background: #f0fdfa;
}

/* Title & Content */
.q-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.4;
    cursor: pointer;
}
.q-title:hover { color: #0d9488; }

.q-content {
    font-size: 15px;
    color: #374151;
    line-height: 1.55;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Medical Answer Banner */
.q-medical-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #16a34a;
    font-weight: 600;
}

/* ─── Engagement Bar (Twitter-style icon+count row) ── */
.q-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid #e5e7eb;
    padding: 0 8px;
    max-width: 450px;
}

.q-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: color 0.15s;
    border-radius: 50px;
    white-space: nowrap;
}
.q-action-btn:hover {
    color: #0d9488;
    background: #f0fdfa;
}
.q-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Upvote special hover */
.q-action-btn.upvote-btn:hover {
    color: #0d9488;
    background: #f0fdfa;
}
.q-action-btn.downvote-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}
.q-action-btn.comment-btn:hover {
    color: #3b82f6;
    background: #eff6ff;
}
.q-action-btn.share-btn:hover {
    color: #0d9488;
    background: #f0fdfa;
}

/* ─── Comment Section ────────────────────── */
.q-comment-section {
    display: none;
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.q-comment-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.q-comment-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: white;
}
.q-comment-input:focus { border-color: #0d9488; }

.q-comment-submit {
    padding: 8px 16px;
    background: #0d9488;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.q-comment-submit:hover { background: #0b7e73; }

.q-comment-item {
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 6px;
}
.q-comment-item .q-comment-author {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 2px;
}
.q-comment-item .q-comment-body {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.45;
}
.q-comment-item .q-comment-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ─── Right Sidebar ──────────────────────── */
.feed-sidebar-right {
    position: sticky;
    top: 72px;
    width: 280px;
    min-width: 280px;
    height: fit-content;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    scrollbar-width: none;
    padding-right: 16px;
}
.feed-sidebar-right::-webkit-scrollbar { display: none; }

.feed-sidebar-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.feed-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 14px;
}

.feed-trending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: #4b5563;
    transition: background 0.15s;
    font-size: 14px;
}
.feed-trending-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}
.feed-trending-count {
    margin-left: auto;
    font-size: 12px;
    color: #9ca3af;
}

.feed-doctor-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}
.feed-doctor-item + .feed-doctor-item {
    border-top: 1px solid #f3f4f6;
}
.feed-doctor-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}
.feed-doctor-stat {
    font-size: 12px;
    color: #9ca3af;
}

/* ─── Loading / Empty States ─────────────── */
.q-loading {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
}
.q-loading .q-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: #0d9488;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: q-spin 0.7s linear infinite;
}
@keyframes q-spin { to { transform: rotate(360deg); } }

.q-empty {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
}
.q-empty h3 {
    font-size: 16px;
    color: #4b5563;
    margin: 12px 0 6px;
}

.q-load-more {
    text-align: center;
    padding: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
}
.q-load-more button {
    padding: 8px 28px;
    background: white;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.q-load-more button:hover {
    background: #f3f4f6;
    color: #1f2937;
    border-color: #9ca3af;
}

/* ─── Responsive ─────────────────────────── */
@media (max-width: 1024px) {
    .feed-layout {
        justify-content: center;
    }
    .feed-sidebar-left {
        display: none;
    }
}

@media (max-width: 768px) {
    .feed-layout {
        flex-direction: column;
        padding: 60px 0 0;
    }
    .feed-sidebar-left,
    .feed-sidebar-right {
        display: none;
    }
    .feed-compose {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .q-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .q-card-body {
        padding: 12px 14px 4px;
    }
    .q-title { font-size: 15px; }
    .q-content { font-size: 14px; }
    .q-actions {
        padding: 0 4px;
    }
    .q-action-btn {
        padding: 10px 8px;
        font-size: 12px;
    }
    .q-action-btn .q-action-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .feed-layout {
        padding: 56px 0 0;
    }
    .q-avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
    .q-author-name { font-size: 14px; }
    .q-author-meta { font-size: 12px; }
    .q-title { font-size: 14px; }
    .q-content { font-size: 13px; }
}
