/* ═══════════════════════════════════════════════════════
   👥 SOCIAL TRADING — Feature 15.1
   Discussion forum, social feed, leaderboard, follow
   Theme: Cyan (#06b6d4, #22d3ee)
   ═══════════════════════════════════════════════════════ */

/* ── Page Header ── */
.soc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.soc-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    gap: 10px;
}
.soc-title svg { width: 26px; height: 26px; color: #06b6d4; }

.soc-header-actions {
    display: flex;
    gap: 8px;
}
.soc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.soc-btn-primary {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff;
}
.soc-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.soc-btn-outline {
    background: transparent;
    color: #06b6d4;
    border: 1px solid rgba(6,182,212,0.3);
}
.soc-btn-outline:hover { background: rgba(6,182,212,0.08); }
.soc-btn svg { width: 16px; height: 16px; }

/* ── Tabs ── */
.soc-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.soc-tabs::-webkit-scrollbar { display: none; }
.soc-tab {
    flex-shrink: 0;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.soc-tab:hover { background: rgba(6,182,212,0.06); }
.soc-tab.active {
    background: rgba(6,182,212,0.1);
    color: #22d3ee;
    border-color: rgba(6,182,212,0.2);
}

/* ── Panels ── */
.soc-panel { display: none; }
.soc-panel.active { display: block; }

/* ── Stock Selector (Discussion tab) ── */
.soc-stock-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.soc-stock-input {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    background: var(--bg-elevated, #1e293b);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 10px;
    color: var(--text-primary, #fff);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.soc-stock-input:focus { border-color: rgba(6,182,212,0.5); }
.soc-stock-input::placeholder { color: var(--text-muted, #64748b); }

.soc-stock-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.soc-chip {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(6,182,212,0.08);
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: all 0.2s;
}
.soc-chip:hover { background: rgba(6,182,212,0.15); color: #22d3ee; }
.soc-chip.active {
    background: rgba(6,182,212,0.15);
    color: #22d3ee;
    border-color: rgba(6,182,212,0.3);
}

/* ── Post Composer ── */
.soc-composer {
    background: var(--bg-elevated, #1e293b);
    border: 1px solid var(--border-color, rgba(255,255,255,0.06));
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}
.soc-composer-row {
    display: flex;
    gap: 12px;
}
.soc-composer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.soc-composer-body { flex: 1; }
.soc-composer textarea {
    width: 100%;
    min-height: 60px;
    background: var(--bg-card, #0f172a);
    border: 1px solid var(--border-color, rgba(255,255,255,0.06));
    border-radius: 10px;
    color: var(--text-primary, #fff);
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}
.soc-composer textarea:focus { border-color: rgba(6,182,212,0.4); }
.soc-composer textarea::placeholder { color: var(--text-muted, #64748b); }
.soc-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.soc-composer-tags {
    display: flex;
    gap: 6px;
}
.soc-tag-btn {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.06);
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}
.soc-tag-btn:hover { background: rgba(6,182,212,0.08); color: #22d3ee; }
.soc-tag-btn.active { background: rgba(6,182,212,0.12); color: #22d3ee; border-color: rgba(6,182,212,0.3); }

.soc-post-btn {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.soc-post-btn:hover { opacity: 0.9; }
.soc-post-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Feed Posts ── */
.soc-feed { display: flex; flex-direction: column; gap: 12px; }

.soc-post {
    background: var(--bg-elevated, #1e293b);
    border: 1px solid var(--border-color, rgba(255,255,255,0.06));
    border-radius: 14px;
    padding: 16px;
    position: relative;
}
.soc-post::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(90deg, #06b6d4, #0891b2);
    opacity: 0;
    transition: opacity 0.2s;
}
.soc-post:hover::before { opacity: 1; }

.soc-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.soc-post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.soc-post-meta { flex: 1; }
.soc-post-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}
.soc-post-time {
    font-size: 11px;
    color: var(--text-muted, #64748b);
}
.soc-post-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
}
.badge-bullish { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-bearish { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-info { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-trade { background: rgba(245,158,11,0.15); color: #f59e0b; }

.soc-post-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(6,182,212,0.1);
    color: #22d3ee;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
}

.soc-post-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary, #cbd5e1);
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Trade share card */
.soc-trade-card {
    background: var(--bg-card, #0f172a);
    border: 1px solid var(--border-color, rgba(255,255,255,0.06));
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.soc-trade-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.soc-trade-icon.buy { background: rgba(34,197,94,0.15); }
.soc-trade-icon.sell { background: rgba(239,68,68,0.15); }
.soc-trade-info { flex: 1; }
.soc-trade-info .stock { font-size: 14px; font-weight: 700; color: var(--text-primary, #fff); }
.soc-trade-info .detail { font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 2px; }
.soc-trade-pl {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}
.soc-trade-pl.up { color: #22c55e; }
.soc-trade-pl.down { color: #ef4444; }

/* Post actions */
.soc-post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.04));
}
.soc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.soc-action-btn:hover { color: #22d3ee; background: rgba(6,182,212,0.06); }
.soc-action-btn.liked { color: #ef4444; }
.soc-action-btn svg { width: 16px; height: 16px; }

/* Comments */
.soc-comments {
    margin-top: 10px;
    padding-left: 20px;
    border-left: 2px solid rgba(6,182,212,0.1);
}
.soc-comment {
    display: flex;
    gap: 8px;
    padding: 8px 0;
}
.soc-comment + .soc-comment { border-top: 1px solid rgba(255,255,255,0.03); }
.soc-comment-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(6,182,212,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #22d3ee;
    flex-shrink: 0;
}
.soc-comment-body { flex: 1; }
.soc-comment-author { font-size: 12px; font-weight: 600; color: var(--text-primary, #fff); }
.soc-comment-text { font-size: 12px; color: var(--text-secondary, #cbd5e1); line-height: 1.5; margin-top: 2px; }
.soc-comment-time { font-size: 10px; color: var(--text-muted, #64748b); margin-top: 2px; }

.soc-comment-input {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}
.soc-comment-input input {
    flex: 1;
    background: var(--bg-card, #0f172a);
    border: 1px solid var(--border-color, rgba(255,255,255,0.06));
    border-radius: 8px;
    color: var(--text-primary, #fff);
    padding: 8px 12px;
    font-size: 12px;
    outline: none;
}
.soc-comment-input input:focus { border-color: rgba(6,182,212,0.4); }
.soc-comment-input input::placeholder { color: var(--text-muted, #64748b); }
.soc-comment-send {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.soc-comment-send svg { width: 14px; height: 14px; color: #fff; }

/* ── Leaderboard ── */
.soc-leaderboard { display: flex; flex-direction: column; gap: 10px; }
.soc-lb-card {
    background: var(--bg-elevated, #1e293b);
    border: 1px solid var(--border-color, rgba(255,255,255,0.06));
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.15s;
}
.soc-lb-card:hover { transform: translateY(-1px); }
.soc-lb-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    color: var(--text-muted, #94a3b8);
}
.soc-lb-card:nth-child(1) .soc-lb-rank { background: rgba(245,158,11,0.2); color: #fbbf24; }
.soc-lb-card:nth-child(2) .soc-lb-rank { background: rgba(148,163,184,0.15); color: #cbd5e1; }
.soc-lb-card:nth-child(3) .soc-lb-rank { background: rgba(180,83,9,0.2); color: #d97706; }
.soc-lb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.soc-lb-info { flex: 1; min-width: 0; }
.soc-lb-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.soc-lb-stats {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    margin-top: 2px;
}
.soc-lb-return {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
}
.soc-lb-return.up { color: #22c55e; }
.soc-lb-return.down { color: #ef4444; }
.soc-lb-follow {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(6,182,212,0.3);
    background: transparent;
    color: #06b6d4;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.soc-lb-follow:hover { background: rgba(6,182,212,0.1); }
.soc-lb-follow.following {
    background: rgba(6,182,212,0.12);
    color: #22d3ee;
    border-color: rgba(6,182,212,0.4);
}

/* ── Following Feed ── */
.soc-following-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.soc-following-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}
.soc-following-count {
    font-size: 12px;
    color: #22d3ee;
    background: rgba(6,182,212,0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* ── Info Banner ── */
.soc-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(6,182,212,0.06);
    border: 1px solid rgba(6,182,212,0.12);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}
.soc-info-banner svg {
    width: 18px;
    height: 18px;
    color: #06b6d4;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Loading / Empty ── */
.soc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--text-muted, #64748b);
    font-size: 13px;
}
.soc-spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(6,182,212,0.2);
    border-top-color: #06b6d4;
    border-radius: 50%;
    animation: socSpin 0.7s linear infinite;
}
@keyframes socSpin { to { transform: rotate(360deg); } }

.soc-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #64748b);
    font-size: 13px;
}
.soc-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .soc-header { flex-direction: column; align-items: flex-start; }
    .soc-title { font-size: 18px; }
    .soc-composer-row { flex-direction: column; gap: 8px; }
    .soc-composer-avatar { display: none; }
    .soc-trade-card { flex-direction: column; align-items: flex-start; }
    .soc-trade-pl { text-align: left; }
    .soc-lb-card { flex-wrap: wrap; }
    .soc-lb-follow { width: 100%; text-align: center; margin-top: 8px; }
    .soc-post-actions { flex-wrap: wrap; gap: 8px; }
    .soc-stock-bar { flex-direction: column; align-items: stretch; }
    .soc-stock-input { max-width: 100%; }
}
