/* ==========================================================================
   Community Section - Consistent with Other Sections
   ========================================================================== */

/* =================================================================== */
/* Dashboard Cards Section - 시각적 카드 그리드 */
/* =================================================================== */

.dashboard-cards-section {
    width: 100%;
    margin: 0 0 1.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(145deg, #f8fafc 0%, #eef2f7 100%);
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    max-width: 100%;
    margin: 0 auto;
    align-items: stretch;
}

.dashboard-cards-grid .dashboard-card {
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.dashboard-cards-grid .dashboard-card > div:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 기본 대시보드 카드 스타일 */
.dashboard-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.dashboard-card:hover::before {
    opacity: 1;
}

/* 카드 헤더 */
.card-header-mini {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
    color: white;
    font-size: 0.875rem;
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.25);
}

.card-title-mini {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #16a34a;
    background: rgba(34, 197, 94, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.badge-hot {
    font-size: 0.625rem;
    font-weight: 700;
    color: #ea580c;
    background: rgba(249, 115, 22, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.03em;
}

.dashboard-card .update-time {
    font-size: 0.75rem;
    color: #64748b;
}

/* 시장 현황 카드 */
.market-card .card-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.25);
}

.market-overview {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.market-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: rgba(59, 130, 246, 0.04);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.market-item:hover {
    background: rgba(59, 130, 246, 0.08);
    transform: translateX(2px);
}

.coin-info {
    display: flex;
    flex-direction: column;
    min-width: 55px;
    gap: 2px;
}

.coin-symbol {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.coin-price {
    font-size: 0.75rem;
    color: #64748b;
}

.mini-chart-container {
    flex: 1;
    height: 28px;
    min-width: 50px;
}

.price-change {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 52px;
    text-align: center;
}

.price-change.positive {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.12);
}

.price-change.negative {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.12);
}

/* 인기 전략 카드 */
.popular-strategy-card .card-icon {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 3px 8px rgba(249, 115, 22, 0.25);
}

.popular-strategies {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.strategy-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: rgba(249, 115, 22, 0.04);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strategy-item:hover {
    background: rgba(249, 115, 22, 0.1);
    transform: translateX(3px);
}

.strategy-rank {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.3);
}

.strategy-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.strategy-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.strategy-roi {
    font-size: 0.875rem;
    font-weight: 700;
}

.strategy-roi.positive {
    color: #16a34a;
}

.strategy-roi.negative {
    color: #dc2626;
}

.mini-sparkline {
    width: 60px;
    height: 28px;
}

/* AI 시장 분석 카드 */
.ai-analysis-card .card-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 3px 8px rgba(139, 92, 246, 0.25);
}

.ai-analysis-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
}

.sentiment-gauge {
    width: 100%;
    display: flex;
    justify-content: center;
}

.gauge-container {
    position: relative;
    width: 110px;
    height: 65px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.gauge-value {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
}

.gauge-label {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
}

.ai-signals {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
}

.dashboard-card .signal-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
}

.dashboard-card .signal-item.buy {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.12);
}

.dashboard-card .signal-item.sell {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.12);
}

.dashboard-card .signal-item i {
    font-size: 0.75rem;
}

.dashboard-card .signal-item strong {
    font-weight: 700;
    font-size: 0.9375rem;
}

/* 오늘의 성과 카드 */
.performance-card .card-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 3px 8px rgba(34, 197, 94, 0.25);
}

.performance-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.performance-chart-container {
    width: 100%;
    height: 55px;
    background: rgba(34, 197, 94, 0.06);
    border-radius: 10px;
    margin-bottom: 0.25rem;
}

.performance-stats {
    display: flex;
    justify-content: space-between;
    gap: 0.625rem;
}

.dashboard-card .stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.625rem 0.5rem;
    background: rgba(0, 0, 0, 0.025);
    border-radius: 8px;
    gap: 2px;
}

.dashboard-card .stat-label {
    font-size: 0.6875rem;
    color: #64748b;
}

.dashboard-card .stat-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e293b;
}

.dashboard-card .stat-value.positive {
    color: #16a34a;
}

.dashboard-card .stat-value.negative {
    color: #dc2626;
}

/* 거래량 급등 카드 */
.volume-card .card-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.25);
}

.badge-alert {
    font-size: 0.625rem;
    font-weight: 700;
    color: #dc2626;
    background: rgba(239, 68, 68, 0.12);
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.03em;
}

.volume-surge-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.volume-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: rgba(245, 158, 11, 0.04);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.volume-item:hover {
    background: rgba(245, 158, 11, 0.08);
}

.volume-coin {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.volume-coin .coin-symbol {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1e293b;
}

.volume-change {
    font-size: 0.8125rem;
    font-weight: 700;
}

.volume-change.positive {
    color: #16a34a;
}

.volume-bar-container {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.volume-bar {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* 커뮤니티 활동 카드 */
.activity-card .card-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
}

.online-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
}

.online-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.activity-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
}

.activity-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.activity-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: rgba(16, 185, 129, 0.04);
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.activity-stat:hover {
    background: rgba(16, 185, 129, 0.08);
    transform: translateY(-2px);
}

.activity-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.activity-icon.posts {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.activity-icon.comments {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
}

.activity-icon.likes {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.activity-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.activity-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.activity-label {
    font-size: 0.6875rem;
    color: #64748b;
}

/* 반응형 - 태블릿 */
@media (max-width: 1200px) {
    #tab-home {
        padding: 1.25rem;
    }

    .home-grid,
    .dashboard-cards-section,
    .home-grid-bottom {
        max-width: 100%;
    }

    .dashboard-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .dashboard-cards-grid .dashboard-card {
        min-height: 180px;
    }
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    #tab-home {
        padding: 1rem;
    }

    .dashboard-cards-section {
        padding: 1rem;
        margin: 0 0 1rem 0;
        border-radius: 16px;
    }

    .dashboard-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-cards-grid .dashboard-card {
        min-height: auto;
    }

    .dashboard-card {
        padding: 1rem;
        border-radius: 14px;
    }

    .card-header-mini {
        margin-bottom: 0.875rem;
        padding-bottom: 0.625rem;
    }

    .card-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }

    .card-title-mini {
        font-size: 0.875rem;
    }

    .home-grid {
        padding: 0.75rem;
    }

    .home-grid-bottom {
        padding: 0.75rem;
    }
}

/* 다크 모드 - 대시보드 섹션 */
body.theme-dark .dashboard-cards-section {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

/* 다크 모드 - 대시보드 카드 */
body.theme-dark .dashboard-card {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.theme-dark .dashboard-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.25);
}

body.theme-dark .card-title-mini {
    color: #f1f5f9;
}

body.theme-dark .market-item,
body.theme-dark .strategy-item {
    background: rgba(255, 255, 255, 0.04);
}

body.theme-dark .market-item:hover,
body.theme-dark .strategy-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .coin-symbol,
body.theme-dark .strategy-name,
body.theme-dark .gauge-value,
body.theme-dark .dashboard-card .stat-value {
    color: #f1f5f9;
}

body.theme-dark .coin-price,
body.theme-dark .gauge-label,
body.theme-dark .dashboard-card .stat-label,
body.theme-dark .dashboard-card .update-time {
    color: #94a3b8;
}

body.theme-dark .card-header-mini {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.theme-dark .dashboard-card .stat-item {
    background: rgba(255, 255, 255, 0.05);
}

body.theme-dark .performance-chart-container {
    background: rgba(34, 197, 94, 0.1);
}

body.theme-dark .volume-item,
body.theme-dark .activity-stat {
    background: rgba(255, 255, 255, 0.04);
}

body.theme-dark .volume-item:hover,
body.theme-dark .activity-stat:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .volume-coin .coin-symbol,
body.theme-dark .activity-value {
    color: #f1f5f9;
}

body.theme-dark .volume-bar-container {
    background: rgba(255, 255, 255, 0.1);
}

body.theme-dark .online-count {
    background: rgba(16, 185, 129, 0.15);
}

body.theme-dark .live-indicator {
    background: rgba(34, 197, 94, 0.15);
}

body.theme-dark .badge-hot {
    background: rgba(249, 115, 22, 0.15);
}

body.theme-dark .badge-alert {
    background: rgba(239, 68, 68, 0.15);
}

/* =================================================================== */

/* Section Content */
#community-section .section-content {
    padding: 0 20px;
    background: #f8f9fa;
    min-height: calc(100vh - 120px);
}

/* Tab + Stats Wrapper */
.community-tabs-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Compact Stats (오른쪽 배치) */
.community-stats-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-right: 0.5rem;
}

.community-stats-compact .stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: all 0.2s ease;
}

.community-stats-compact .stat-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

.community-stats-compact .stat-item i {
    font-size: 0.85rem;
    color: #667eea;
}

.community-stats-compact .stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.community-stats-compact .stat-label {
    font-size: 0.75rem;
    color: #64748b;
    display: none;
}

/* 큰 화면에서는 라벨 표시 */
@media (min-width: 1400px) {
    .community-stats-compact .stat-label {
        display: inline;
    }
}

/* Tab Navigation */
.community-tabs {
    flex: 1;
    min-width: 0;
}

.community-tabs-inner {
    display: flex;
    gap: 0.25rem;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.community-tabs-inner::-webkit-scrollbar {
    display: none;
}

.community-tab {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.community-tab:hover {
    color: #667eea;
    background: #f1f5f9;
}

.community-tab.active {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 600;
}

.community-tab .badge {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
}

.community-tab.active .badge {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content Area */
.community-main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    margin-bottom: 2rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Content Panel */
.community-content-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

/* Panel Header */
.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: #fafbfc;
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-header h3 i {
    color: #667eea;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: #667eea;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Discussion List */
.discussion-list {
    padding: 0;
}

.discussion-item {
    padding: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    cursor: pointer;
}

.discussion-item:hover {
    background: #f8fafc;
}

.discussion-item:last-child {
    border-bottom: none;
}

.discussion-item.pinned {
    background: linear-gradient(90deg, #fef3c7 0%, white 20%);
    border-left: 3px solid #f59e0b;
}

.discussion-item.hot {
    background: linear-gradient(90deg, #fee2e2 0%, white 20%);
    border-left: 3px solid #ef4444;
}

.discussion-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.discussion-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.discussion-avatar.green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.discussion-avatar.purple { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.discussion-avatar.orange { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.discussion-avatar.pink { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
.discussion-avatar.cyan { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }

.discussion-info {
    flex: 1;
    min-width: 0;
}

.discussion-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.discussion-author {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.discussion-time {
    font-size: 0.8rem;
    color: #94a3b8;
}

.discussion-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.discussion-badge.hot {
    background: #fee2e2;
    color: #dc2626;
}

.discussion-badge.pinned {
    background: #fef3c7;
    color: #d97706;
}

.discussion-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.4rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.discussion-title:hover {
    color: #667eea;
}

.discussion-excerpt {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.discussion-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.discussion-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: #ede9fe;
    color: #7c3aed;
    border-radius: 4px;
    font-weight: 500;
}

.discussion-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.discussion-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #64748b;
}

.discussion-stat i {
    font-size: 0.85rem;
}

.discussion-stat.likes i { color: #ef4444; }
.discussion-stat.comments i { color: #667eea; }
.discussion-stat.views i { color: #64748b; }

/* Category Chip */
.category-chip {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
    margin-left: auto;
}

.category-chip.strategy { background: #dbeafe; color: #1d4ed8; }
.category-chip.technical { background: #d1fae5; color: #047857; }
.category-chip.market { background: #fef3c7; color: #b45309; }
.category-chip.defi { background: #ede9fe; color: #6d28d9; }
.category-chip.development { background: #fce7f3; color: #be185d; }
.category-chip.general { background: #f1f5f9; color: #475569; }

/* Analysis Card Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

.analysis-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.analysis-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.analysis-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    color: white;
    position: relative;
}

.analysis-ticker {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.analysis-prediction {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.analysis-prediction.bullish {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.analysis-prediction.bearish {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.analysis-prediction.neutral {
    background: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
}

.analysis-card-body {
    padding: 1rem;
}

.analysis-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.analysis-excerpt {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.analysis-targets {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.analysis-target {
    flex: 1;
    text-align: center;
}

.analysis-target-label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-target-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.analysis-target-value.target { color: #10b981; }
.analysis-target-value.stop { color: #ef4444; }

.analysis-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.analysis-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

.analysis-author-name {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}

.analysis-accuracy {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background: #d1fae5;
    color: #047857;
    border-radius: 4px;
    font-weight: 600;
}

/* Sidebar */
.community-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sidebar Widget */
.sidebar-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.widget-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.widget-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-header h4 i {
    color: #667eea;
    font-size: 0.9rem;
}

.widget-header .view-all {
    font-size: 0.8rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.widget-header .view-all:hover {
    text-decoration: underline;
}

.widget-body {
    padding: 1rem 1.25rem;
}

/* Top Traders */
.top-trader-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s;
}

.top-trader-item:last-child {
    border-bottom: none;
}

.top-trader-item:hover {
    background: #f8fafc;
    margin: 0 -1.25rem;
    padding: 0.75rem 1.25rem;
}

.trader-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}

.trader-rank.gold { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); color: white; }
.trader-rank.silver { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); color: white; }
.trader-rank.bronze { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); color: white; }

.trader-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.trader-info {
    flex: 1;
    min-width: 0;
}

.trader-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trader-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
}

.trader-accuracy {
    color: #10b981;
    font-weight: 600;
}

/* AI Competition Section */
.ai-competition-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.ai-competition-widget .widget-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    background: transparent;
}

.ai-competition-widget .widget-header h4 {
    color: white;
}

.ai-competition-widget .widget-header h4 i {
    color: rgba(255, 255, 255, 0.8);
}

.ai-chart-container {
    height: 180px;
    position: relative;
}

.ai-stats-row {
    display: flex;
    gap: 0.5rem;
    padding: 0 0.5rem 0.5rem;
}

.ai-stat-item {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.ai-stat-item.chatgpt { background: rgba(16, 163, 127, 0.3); }
.ai-stat-item.gemini { background: rgba(66, 133, 244, 0.3); }
.ai-stat-item.human { background: rgba(234, 67, 53, 0.3); }

.ai-stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.ai-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.quick-action-btn i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Write Button (Floating) */
.write-button-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 1000;
}

.write-button-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Loading State */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
}

.loading-item {
    display: flex;
    gap: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e2e8f0;
}

.loading-content {
    flex: 1;
}

.loading-line {
    height: 12px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.loading-line.short { width: 60%; }
.loading-line.medium { width: 80%; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: #475569;
    margin-bottom: 0.5rem;
}

/* Pagination */
.pagination-wrapper {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 0.25rem;
}

.pagination .page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #475569;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background: #f1f5f9;
    border-color: #667eea;
    color: #667eea;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

/* Responsive Design */
@media (max-width: 992px) {
    .community-main {
        grid-template-columns: 1fr;
    }

    .community-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .community-tabs-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .community-stats-compact {
        justify-content: center;
        padding-right: 0;
        padding-bottom: 0.25rem;
    }
}

@media (max-width: 768px) {
    #community-section .section-content {
        padding: 0 12px;
    }

    .community-tabs-wrapper {
        padding: 0.4rem;
    }

    .community-tabs-inner {
        padding-bottom: 0.25rem;
    }

    .community-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .community-stats-compact {
        gap: 0.35rem;
    }

    .community-stats-compact .stat-item {
        padding: 0.4rem 0.6rem;
    }

    .community-stats-compact .stat-value {
        font-size: 0.85rem;
    }

    .community-stats-compact .stat-item i {
        font-size: 0.75rem;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-bar {
        width: 100%;
    }

    .filter-select {
        flex: 1;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .write-button-floating {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }

    .community-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .community-stats-compact .stat-label {
        display: none !important;
    }
}

/* ==========================================================================
   Phase 1: Enhanced UI - Skeleton Loading
   ========================================================================== */

/* Skeleton Animation */
@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    pointer-events: none;
}

.skeleton-avatar,
.skeleton-rank,
.skeleton-line,
.skeleton-box,
.skeleton-header {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.skeleton-line {
    height: 12px;
    margin-bottom: 8px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 90%; }

.skeleton-box {
    height: 40px;
    flex: 1;
    border-radius: 6px;
}

.skeleton-header {
    height: 80px;
    border-radius: 0;
}

.skeleton-targets {
    display: flex;
    gap: 1rem;
    margin: 0.75rem 0;
}

/* Skeleton Discussion Item */
.discussion-item.skeleton .discussion-info {
    flex: 1;
}

/* Skeleton Analysis Card */
.analysis-card.skeleton {
    border: 1px solid #e9ecef;
}

.analysis-card.skeleton .analysis-card-body {
    padding: 1rem;
}

/* ==========================================================================
   Infinite Scroll & Loading More
   ========================================================================== */

.scroll-sentinel {
    height: 1px;
    visibility: hidden;
}

.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

/* ==========================================================================
   Pull to Refresh (Mobile)
   ========================================================================== */

#pull-refresh-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: transform 0.2s, opacity 0.2s;
    z-index: 10;
}

#pull-refresh-indicator i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Bookmark Button
   ========================================================================== */

.bookmark-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.bookmark-btn:hover {
    color: #667eea;
}

.bookmark-btn.bookmarked {
    color: #667eea;
}

.bookmark-btn-card {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.bookmark-btn-card:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bookmark-btn-card.bookmarked {
    color: #fbbf24;
}

/* ==========================================================================
   Mention & Link Styling
   ========================================================================== */

.mention {
    color: #667eea;
    font-weight: 500;
    cursor: pointer;
}

.mention:hover {
    text-decoration: underline;
}

.discussion-content {
    white-space: pre-wrap;
    line-height: 1.7;
    word-break: break-word;
}

.discussion-content a {
    color: #667eea;
    word-break: break-all;
}

/* ==========================================================================
   Comment Styling
   ========================================================================== */

.comment-item {
    transition: background-color 0.2s;
}

.comment-item:hover {
    background-color: #f8fafc;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.community-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 0.75rem 1.25rem;
    background: #10b981;
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.community-toast.show {
    transform: translateX(0);
}

.community-toast.error {
    background: #ef4444;
}

.community-toast.warning {
    background: #f59e0b;
}

.community-toast.info {
    background: #3b82f6;
}

/* ==========================================================================
   Enhanced Trader Item
   ========================================================================== */

.trader-item {
    transition: all 0.2s;
}

.trader-item:hover {
    background: #f8fafc;
    transform: translateX(4px);
}

.trader-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* ==========================================================================
   Analysis Card Header Enhancement
   ========================================================================== */

.analysis-card-header {
    position: relative;
}

.analysis-card-header .d-flex {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Mobile Improvements
   ========================================================================== */

@media (max-width: 768px) {
    .bookmark-btn {
        padding: 0.5rem;
        font-size: 1rem;
    }

    .trader-badges {
        display: none;
    }

    .community-toast {
        left: 20px;
        right: 20px;
        text-align: center;
    }

    /* Improve touch targets */
    .discussion-item,
    .top-trader-item,
    .analysis-card {
        min-height: 44px;
    }
}

/* ==========================================================================
   Home Tab Styles
   ========================================================================== */

/* 홈탭 콘텐츠 */
#tab-home {
    padding: 1.5rem;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: stretch;
    padding: 1rem;
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    border-radius: 16px;
    margin: 0 0 1rem 0;
    width: 100%;
}

.home-section {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #e9ecef;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.home-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.home-section .home-post-list,
.home-section .home-analyst-list,
.home-section .home-analysis-grid {
    flex: 1;
    overflow: hidden;
}

.home-section.hot-categories {
    grid-column: 1 / -1;
    min-height: auto;
}

/* 인기분석은 최신글과 2열로 배치 */
.home-section.popular-analyses {
    min-height: auto;
}

/* 인기분석 리스트 - 최신글과 동일한 스타일 */
.home-analysis-grid {
    display: flex;
    flex-direction: column;
}

.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.home-section-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.home-section-header h3 i {
    color: #667eea;
}

.home-section-header h3 i.fa-fire {
    color: #ef4444;
}

.home-section-header h3 i.fa-crown {
    color: #f59e0b;
}

.home-section-header a {
    font-size: 0.8rem;
    color: #64748b;
    text-decoration: none;
}

.home-section-header a:hover {
    color: #667eea;
}

/* Home Post List */
.home-post-list {
    display: flex;
    flex-direction: column;
}

.home-post-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: background 0.15s;
}

.home-post-item:last-child {
    border-bottom: none;
}

.home-post-item:hover {
    background: #f8fafc;
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 6px;
}

.post-rank {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.home-post-item:nth-child(1) .post-rank { background: linear-gradient(135deg, #f59e0b, #d97706); }
.home-post-item:nth-child(2) .post-rank { background: linear-gradient(135deg, #94a3b8, #64748b); }
.home-post-item:nth-child(3) .post-rank { background: linear-gradient(135deg, #cd7c2f, #a86523); }

.post-content {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hot-badge {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-weight: 700;
}

.post-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.2rem;
    display: flex;
    gap: 0.5rem;
}

.post-category {
    color: #667eea;
    font-weight: 500;
}

.post-stats {
    display: flex;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.post-stats i {
    margin-right: 0.2rem;
}

/* Home Analyst List (주간 베스트) */
.home-analyst-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.home-analyst-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem;
    background: #f8fafc;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.home-analyst-item:hover {
    background: white;
    border-color: #667eea;
    transform: translateX(4px);
}

.home-analyst-item .analyst-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.home-analyst-item:nth-child(1) .analyst-rank {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.home-analyst-item:nth-child(2) .analyst-rank {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: white;
}

.home-analyst-item:nth-child(3) .analyst-rank {
    background: linear-gradient(135deg, #cd7c2f 0%, #a86523 100%);
    color: white;
}

.home-analyst-item:nth-child(n+4) .analyst-rank {
    background: #e2e8f0;
    color: #64748b;
}

.home-analyst-item .analyst-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.home-analyst-item .analyst-info {
    flex: 1;
    min-width: 0;
}

.home-analyst-item .analyst-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-analyst-item .analyst-stats {
    display: flex;
    gap: 0.6rem;
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.home-analyst-item .analyst-stats .accuracy {
    color: #10b981;
    font-weight: 600;
}

.home-analyst-item .analyst-stats .predictions {
    color: #667eea;
}

.home-analyst-item .analyst-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

.home-analyst-item .analyst-badge.top {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.home-analyst-item .analyst-badge.rising {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

/* Home Analysis Card - 리스트 스타일 (최신글과 동일한 높이) */

/* 인기분석 카드 - 정돈된 리스트 스타일 */
.home-analysis-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 6px;
}

.home-analysis-card:last-child {
    border-bottom: none;
}

.home-analysis-card:hover {
    background: #f1f5f9;
}

/* 티커 뱃지 */
.home-analysis-card .analysis-ticker-badge {
    background: #3b82f6;
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 36px;
    text-align: center;
}

/* 예측 방향 아이콘 */
.home-analysis-card .analysis-prediction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.home-analysis-card .analysis-prediction.up {
    background: #dcfce7;
    color: #16a34a;
}

.home-analysis-card .analysis-prediction.down {
    background: #fee2e2;
    color: #dc2626;
}

.home-analysis-card .analysis-prediction.neutral {
    background: #fef3c7;
    color: #d97706;
}

/* 제목 */
.home-analysis-card .analysis-title {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* 작성자 */
.home-analysis-card .analysis-author {
    font-size: 0.7rem;
    color: #94a3b8;
    flex-shrink: 0;
    text-align: right;
}

/* Category Chips */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-chip-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: #f8fafc;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e9ecef;
}

.category-chip-item:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.category-chip-item .rank {
    width: 18px;
    height: 18px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-chip-item:hover .rank {
    background: rgba(255, 255, 255, 0.3);
}

/* Home Responsive */
@media (max-width: 992px) {
    .home-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .home-section {
        min-height: auto;
    }

    .home-section.weekly-analysts,
    .home-section.popular-analyses {
        grid-column: auto;
    }

    .home-analyst-list {
        flex-direction: column;
    }

    .home-analyst-item {
        flex: none;
        min-width: 0;
    }

    .home-analysis-grid {
        grid-template-columns: 1fr;
    }

    .home-strategy-grid {
        grid-template-columns: 1fr;
    }
}

    .post-stats {
        display: none;
    }

    .home-analyst-item .analyst-badge {
        display: none;
    }
}

/* ==========================================================================
   Phase 4: Gamification Styles
   ========================================================================== */

/* Gamification Summary Card */
.gamification-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

.gami-user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gami-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.gami-user-info {
    flex: 1;
}

.gami-username {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.gami-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

.level-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.gami-points-display {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.gami-points-display i {
    color: #fbbf24;
    margin-right: 0.4rem;
}

.gami-exp-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.exp-progress {
    height: 100%;
    background: #fbbf24;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.gami-exp-text {
    text-align: right;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Gamification Sections */
.gamification-section {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.gami-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.gami-section-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gami-section-header h4 i {
    color: #667eea;
}

.streak-badge {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.view-history {
    color: #667eea;
    font-size: 0.85rem;
    text-decoration: none;
}

.view-history:hover {
    text-decoration: underline;
}

/* Check-in Grid */
.checkin-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkin-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.checkin-day .day-label {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.checkin-day .day-icon {
    font-size: 0.9rem;
    height: 1rem;
}

.checkin-day.today {
    border-color: #667eea;
    background: #f0f3ff;
}

.checkin-day.checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.checkin-day.checked .day-label {
    color: rgba(255, 255, 255, 0.8);
}

.btn-checkin {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-checkin:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-checkin:disabled,
.btn-checkin.checked {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Quest List */
.quest-progress {
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 600;
}

.quest-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quest-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s;
}

.quest-item.completed {
    background: #f0fdf4;
    opacity: 0.8;
}

.quest-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.quest-item.completed .quest-icon {
    background: #22c55e;
}

.quest-info {
    flex: 1;
    min-width: 0;
}

.quest-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.3rem;
}

.quest-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.quest-item.completed .quest-progress-fill {
    background: #22c55e;
}

.quest-progress-text {
    font-size: 0.75rem;
    color: #64748b;
}

.quest-reward {
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fbbf24;
    white-space: nowrap;
}

/* Price Prediction Game */
.prediction-game-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem;
}

.prediction-ticker {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.prediction-ticker .form-select {
    flex: 1;
    max-width: 160px;
}

.current-price {
    flex: 1;
    text-align: right;
}

.price-label {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
}

.price-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.prediction-duration {
    margin-bottom: 1rem;
}

.prediction-duration label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    display: block;
}

.duration-options {
    display: flex;
    gap: 0.5rem;
}

.duration-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.duration-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.duration-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.prediction-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.prediction-btn {
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.prediction-btn i {
    font-size: 1.5rem;
}

.prediction-btn span {
    font-size: 0.85rem;
    font-weight: 600;
}

.prediction-btn.up {
    background: #dcfce7;
    color: #16a34a;
    border-color: #bbf7d0;
}

.prediction-btn.up:hover {
    background: #16a34a;
    color: white;
    transform: translateY(-2px);
}

.prediction-btn.neutral {
    background: #fef3c7;
    color: #d97706;
    border-color: #fde68a;
}

.prediction-btn.neutral:hover {
    background: #d97706;
    color: white;
    transform: translateY(-2px);
}

.prediction-btn.down {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.prediction-btn.down:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
}

.prediction-reward {
    text-align: center;
    padding: 0.5rem;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #92400e;
}

.prediction-reward strong {
    color: #d97706;
}

/* Badges Grid */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
}

.badge-item {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.5rem;
    position: relative;
    transition: all 0.2s;
    cursor: pointer;
}

.badge-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.badge-item.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.badge-item.earned {
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
}

.badge-icon {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.badge-name {
    font-size: 0.7rem;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
}

.badge-earned {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

.badge-count {
    font-size: 0.85rem;
    color: #64748b;
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.2s;
}

.leaderboard-item:hover {
    background: #f1f5f9;
}

.leaderboard-item.gold {
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
}

.leaderboard-item.silver {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.leaderboard-item.bronze {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
}

.lb-rank {
    width: 28px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #64748b;
}

.lb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.lb-info {
    flex: 1;
    min-width: 0;
}

.lb-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.lb-level {
    font-size: 0.75rem;
    color: #64748b;
}

.lb-score {
    font-weight: 700;
    color: #d97706;
    font-size: 0.9rem;
}

/* Sidebar Gamification Widget */
.gamification-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gamification-widget .widget-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
}

.gamification-widget .widget-header h4 {
    color: white;
}

.gamification-widget .view-all {
    color: rgba(255, 255, 255, 0.8);
}

.gami-quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.gami-quick-stat {
    text-align: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.gami-stat-icon {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.gami-stat-icon .fa-coins { color: #fbbf24; }
.gami-stat-icon .fa-fire { color: #f97316; }
.gami-stat-icon .fa-medal { color: #60a5fa; }

.gami-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.gami-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.btn-checkin-quick {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-checkin-quick:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-checkin-quick:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 0.85rem 1.25rem;
    background: #1e293b;
    color: white;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateX(150%);
    transition: transform 0.3s ease;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 320px;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.toast-success {
    background: #22c55e;
}

.toast-notification.toast-error {
    background: #ef4444;
}

.toast-notification.toast-info {
    background: #3b82f6;
}

/* Gamification Mobile */
@media (max-width: 768px) {
    .gamification-summary-card {
        padding: 1rem;
    }

    .gami-user-header {
        flex-wrap: wrap;
    }

    .gami-points-display {
        width: 100%;
        margin-top: 0.75rem;
    }

    .prediction-buttons {
        grid-template-columns: 1fr;
    }

    .badges-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .toast-notification {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

/* ==========================================================================
   Phase 5: Real-time Chat Styles
   ========================================================================== */

/* Online Dot */
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
    margin-left: 4px;
}

.online-dot.online {
    background: #22c55e;
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Chat Container */
.chat-container {
    display: flex;
    height: calc(100vh - 350px);
    min-height: 500px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

/* Chat Rooms Sidebar */
.chat-rooms-sidebar {
    width: 260px;
    background: #f8fafc;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.chat-rooms-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.chat-rooms-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-rooms-header h4 i {
    color: #667eea;
}

.chat-room-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.chat-room-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.chat-room-item:hover {
    background: #e2e8f0;
}

.chat-room-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chat-room-item.active .chat-room-meta {
    color: rgba(255, 255, 255, 0.8);
}

.chat-room-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
}

.chat-room-item.active .chat-room-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.chat-room-info {
    flex: 1;
    min-width: 0;
}

.chat-room-name {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ticker-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    background: #fbbf24;
    color: #1e293b;
    border-radius: 3px;
    font-weight: 700;
}

.chat-room-meta {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    gap: 0.75rem;
    margin-top: 0.2rem;
}

/* Chat Main Area */
.chat-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Chat Header */
.chat-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-room-info h4 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}

.online-indicator {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.online-indicator .online-dot {
    background: #22c55e;
}

/* Chat Messages Area */
.chat-messages-area {
    flex: 1;
    display: flex;
    position: relative;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-placeholder,
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.chat-placeholder i,
.chat-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-messages {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* Chat Message */
.chat-message {
    display: flex;
    gap: 0.5rem;
    max-width: 80%;
}

.chat-message.me {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.message-username {
    font-weight: 600;
    color: #1e293b;
}

.message-header .level-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    background: #667eea;
    color: white;
    border-radius: 3px;
}

.message-bubble {
    background: #f1f5f9;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    border-top-left-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-message.me .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    color: #94a3b8;
}

.chat-message.me .message-time {
    text-align: right;
}

/* System Message */
.chat-system-message {
    text-align: center;
    padding: 0.5rem;
}

.chat-system-message span {
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #64748b;
}

/* Online Users Panel */
.online-users-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 200px;
    background: white;
    border-left: 1px solid #e9ecef;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.online-users-header {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.online-users-header h5 {
    margin: 0;
    font-size: 0.9rem;
}

.online-users-list {
    padding: 0.5rem;
    overflow-y: auto;
    max-height: calc(100% - 50px);
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
}

.online-user-item:hover {
    background: #f8fafc;
}

.online-user-item .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}

.online-user-item .user-name {
    font-size: 0.85rem;
    color: #1e293b;
}

/* Chat Input Area */
.chat-input-area {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e9ecef;
    background: #f8fafc;
}

.typing-indicator {
    font-size: 0.8rem;
    color: #64748b;
    padding-bottom: 0.5rem;
    font-style: italic;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.chat-input-wrapper .form-control {
    flex: 1;
    border-radius: 20px;
    padding: 0.5rem 1rem;
}

.chat-input-wrapper .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Mobile */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: calc(100vh - 300px);
    }

    .chat-rooms-sidebar {
        width: 100%;
        max-height: 150px;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }

    .chat-room-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .chat-room-item {
        flex: 0 0 auto;
        min-width: 140px;
        margin-bottom: 0;
    }

    .chat-message {
        max-width: 90%;
    }

    .online-users-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 50%;
        border-left: none;
        border-top: 1px solid #e9ecef;
        border-radius: 16px 16px 0 0;
    }
}

/* ==========================================================================
   Home Tab Additional Styles
   ========================================================================== */

/* Empty message */
.empty-message {
    text-align: center;
    padding: 2rem 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Skeleton loading for home posts */
.home-post-item.skeleton {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f8fafc;
}

.home-post-item.skeleton .skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    height: 14px;
}

.home-post-item.skeleton .skeleton-line.short {
    width: 60%;
    height: 16px;
    margin-bottom: 0.3rem;
}

.home-post-item.skeleton .skeleton-line.medium {
    width: 40%;
    height: 12px;
}

/* Skeleton loading for home analysis cards */
.home-analysis-card.skeleton {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.75rem;
    min-height: 100px;
}

.home-analysis-card.skeleton .skeleton-header {
    width: 60px;
    height: 24px;
    background: linear-gradient(90deg, #e8e8e8 25%, #d8d8d8 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.home-analysis-card.skeleton .skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    height: 14px;
    margin-bottom: 0.3rem;
}

.home-analysis-card.skeleton .skeleton-line.medium {
    width: 80%;
}

.home-analysis-card.skeleton .skeleton-line.short {
    width: 50%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Home analysis card header styles */
.home-analysis-card .analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.home-analysis-card .analysis-ticker {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

.home-analysis-card .analysis-prediction {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.home-analysis-card .analysis-prediction.bullish {
    background: #dcfce7;
    color: #16a34a;
}

.home-analysis-card .analysis-prediction.bearish {
    background: #fee2e2;
    color: #dc2626;
}

.home-analysis-card .analysis-prediction.neutral {
    background: #fef3c7;
    color: #d97706;
}

.home-analysis-card .analysis-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.home-analysis-card .analysis-accuracy {
    font-size: 0.75rem;
    color: #16a34a;
    font-weight: 500;
}

/* Post category badge in home tab */
.home-post-item .post-category {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
}

.home-post-item .post-category.strategy { background: #dbeafe; color: #2563eb; }
.home-post-item .post-category.technical { background: #dcfce7; color: #16a34a; }
.home-post-item .post-category.market { background: #fef3c7; color: #d97706; }
.home-post-item .post-category.defi { background: #f3e8ff; color: #9333ea; }
.home-post-item .post-category.development { background: #fce7f3; color: #db2777; }
.home-post-item .post-category.general { background: #f1f5f9; color: #64748b; }
.home-post-item .post-category.tools { background: #e0e7ff; color: #4f46e5; }

/* ==========================================================================
   Home Strategy Cards (매매전략 섹션 연동)
   ========================================================================== */

/* 하단 그리드 (최근 공유된 전략) */
.home-grid-bottom {
    width: 100%;
    margin: 0;
    padding: 1rem;
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    border-radius: 16px;
}

.home-grid-bottom .home-section.recent-strategies {
    grid-column: 1 / -1;
    min-height: auto;
}

.home-strategy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.home-strategy-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e9ecef;
}

.home-strategy-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #667eea;
}

.home-strategy-card .strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.home-strategy-card .strategy-category {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #e0e7ff;
    color: #4f46e5;
}

.home-strategy-card .strategy-category.momentum { background: #fee2e2; color: #dc2626; }
.home-strategy-card .strategy-category.trend { background: #dcfce7; color: #16a34a; }
.home-strategy-card .strategy-category.mean_reversion { background: #fef3c7; color: #d97706; }
.home-strategy-card .strategy-category.volatility { background: #f3e8ff; color: #9333ea; }
.home-strategy-card .strategy-category.volume { background: #dbeafe; color: #2563eb; }
.home-strategy-card .strategy-category.pattern { background: #fce7f3; color: #db2777; }
.home-strategy-card .strategy-category.oscillator { background: #ccfbf1; color: #0d9488; }

.home-strategy-card .strategy-return {
    font-size: 0.8rem;
    font-weight: 700;
}

.home-strategy-card .strategy-return.positive {
    color: #16a34a;
}

.home-strategy-card .strategy-return.negative {
    color: #dc2626;
}

.home-strategy-card .strategy-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.4rem;
}

.home-strategy-card .strategy-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #64748b;
}

.home-strategy-card .strategy-author {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.home-strategy-card .strategy-stats {
    display: flex;
    gap: 0.5rem;
}

.home-strategy-card .strategy-stats i {
    margin-right: 0.15rem;
}

.home-strategy-card .strategy-stats i.fa-heart {
    color: #ef4444;
}

/* Skeleton for strategy cards */
.home-strategy-card.skeleton {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.85rem;
    min-height: 90px;
}

.home-strategy-card.skeleton .skeleton-header {
    width: 60px;
    height: 20px;
    background: linear-gradient(90deg, #e8e8e8 25%, #d8d8d8 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.home-strategy-card.skeleton .skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    height: 14px;
    margin-bottom: 0.3rem;
}

.home-strategy-card.skeleton .skeleton-line.medium {
    width: 80%;
}

.home-strategy-card.skeleton .skeleton-line.short {
    width: 50%;
}

/* Responsive for strategy grid */
@media (max-width: 1200px) {
    .home-strategy-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .home-strategy-grid {
        grid-template-columns: 1fr;
    }
}
