/* ============================================================================
   DAJAVATA ALPHA LOUNGE & COLLECTIVE INTELLIGENCE NETWORK (community_hub.css)
   - 다자바타 고유의 다크 핀테크 터미널 아이덴티티 (블룸버그/트레이딩뷰 감성)
   - 기존 레이아웃과 100% 격리된 전용 네임스페이스 (.al-*)
   ============================================================================ */

.community-hub-container {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-width: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 26px 56px;
    background: var(--bg-dark, #0a0b10);
    color: var(--text-main, #f1f2f5);
    gap: 16px;
}

.community-hub-container > * {
    flex-shrink: 0;
}

/* 상단 헤더 & 카카오 프로필/지갑 바 */
.al-top-banner {
    background: linear-gradient(135deg, rgba(19, 24, 38, 0.96) 0%, rgba(13, 17, 28, 0.98) 100%);
    border: 1px solid rgba(59, 130, 246, 0.24);
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.35);
}

.al-title-area {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.al-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 3px 9px;
    border-radius: 999px;
    width: fit-content;
}

.al-title-area h1 {
    font-size: 21px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
    margin: 0;
}

.al-title-area p {
    font-size: 12.5px;
    color: #94a3b8;
    margin: 0;
}

/* 우측 사용자 지갑 & 카카오 로그인 박스 */
.al-wallet-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(10, 12, 20, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.16);
    padding: 8px 14px;
    border-radius: 12px;
}

.al-kakao-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #FEE500;
    color: #191919;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 3px 10px rgba(254, 229, 0, 0.22);
}

.al-kakao-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(254, 229, 0, 0.35);
}

.al-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
}

.al-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.32);
    color: #93c5fd;
    font-variant-numeric: tabular-nums;
}

.al-stat-pill.pass {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.38);
    color: #fcd34d;
}

.al-ghost-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #cbd5e1;
    padding: 5px 11px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.al-ghost-btn:hover {
    background: rgba(59, 130, 246, 0.16);
    border-color: #3b82f6;
    color: #fff;
}

/* 4대 모듈 네비게이션 탭 바 */
.al-nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    padding-bottom: 12px;
    align-items: center;
    justify-content: space-between;
}

.al-nav-left {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.al-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    background: rgba(21, 22, 30, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.al-tab-btn:hover {
    color: #f8fafc;
    border-color: rgba(59, 130, 246, 0.45);
}

.al-tab-btn.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* 필터 & 검색 컨트롤 바 */
.al-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: var(--bg-card, #15161e);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    padding: 12px 16px;
    border-radius: 12px;
}

.al-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.al-pill-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.al-pill-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
}

.al-pill-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #60a5fa;
}

.al-search-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #f8fafc;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 12.5px;
    min-width: 220px;
    font-family: inherit;
}

.al-primary-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: transform 0.15s ease;
}

.al-primary-btn:hover {
    transform: translateY(-1px);
}

/* [모듈 1] 알파 차트·시나리오 볼트 그리드 (다자바타 오리지널 금융 터미널 카드) */
.al-vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.al-vault-card {
    background: linear-gradient(180deg, #161925 0%, #12151f 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 22px rgba(0, 0, 0, 0.28);
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.al-vault-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.48);
}

.al-vault-chart-box {
    position: relative;
    height: 156px;
    background: radial-gradient(circle at 50% 20%, rgba(37, 99, 235, 0.14), rgba(10, 12, 18, 0.95));
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.al-vault-top-tags {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.al-stance-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.al-stance-BULL {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.al-stance-BEAR {
    background: rgba(244, 63, 94, 0.18);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.4);
}

.al-stance-NEUTRAL {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.al-vault-body {
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.al-vault-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.4;
    margin: 0;
}

.al-vault-summary {
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.al-target-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: rgba(10, 12, 18, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 8px;
    padding: 8px 10px;
    font-variant-numeric: tabular-nums;
}

.al-target-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.al-target-cell .lbl {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
}

.al-target-cell .val {
    font-size: 12.5px;
    font-weight: 800;
}

.al-vault-footer {
    padding: 11px 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(10, 12, 18, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* [모듈 2] 마켓 라운지 (투자자 피드 & 베스트 인사이트) */
.al-best-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(19, 24, 38, 0.9) 100%);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 12px;
    padding: 14px 18px;
}

.al-feed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.al-feed-table th {
    background: rgba(15, 23, 42, 0.65);
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 700;
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.al-feed-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    vertical-align: middle;
}

.al-feed-table tbody tr {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.al-feed-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

/* 모달 다이얼로그 */
.al-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 12, 0.78);
    backdrop-filter: blur(5px);
    z-index: 12200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.al-modal-box {
    background: #141824;
    border: 1px solid rgba(59, 130, 246, 0.32);
    border-radius: 16px;
    width: min(740px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.al-modal-box.wide {
    width: min(1040px, 100%);
}

.al-modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 12, 18, 0.55);
}

.al-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 5단계 알파 티어 카드 그리드 */
.al-tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 10px;
}

.al-tier-card {
    background: rgba(15, 20, 32, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.al-tier-card.master {
    border-color: rgba(245, 158, 11, 0.55);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 20, 32, 0.95) 100%);
}

@media (max-width: 768px) {
    .community-hub-container {
        padding: 14px 12px 48px;
    }
    .al-vault-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================================
   🏠 DAJAVATA MAIN HOME (심플 2단 구성: ① 글로벌·국내 증시 상황판 + ② 대형 실시간 시총 히트맵)
   ============================================================================ */
.main-home-dashboard {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 22px 72px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
    font-variant-numeric: tabular-nums;
    scroll-behavior: smooth;
}

.main-home-dashboard > * {
    flex-shrink: 0;
}

.mh-section-block {
    background: linear-gradient(180deg, #151924 0%, #10131c 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 26px rgba(0, 0, 0, 0.32);
}

.mh-sec-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mh-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    color: #f8fafc;
    letter-spacing: -0.2px;
}

/* [1단] 주요 증시 상황판 (참고 이미지 2 스타일: 상단 4대 미니차트 카드 + 하단 1대 미니차트 & 3대 2x2 페어 카드) */
.mh-idx-top-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.mh-idx-bottom-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.mh-idx-card {
    background: #171b27;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.mh-idx-card:hover {
    border-color: rgba(56, 189, 248, 0.45);
}

.mh-idx-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 800;
    color: #e2e8f0;
}

.mh-idx-status {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.mh-idx-val-row {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

.mh-idx-price {
    font-size: 20px;
    font-weight: 900;
    color: #f8fafc;
    letter-spacing: -0.4px;
}

.mh-idx-chg {
    font-size: 12px;
    font-weight: 800;
}

.mh-idx-chg.up { color: #f43f5e; }
.mh-idx-chg.down { color: #3b82f6; }

.mh-idx-chart-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    height: 68px;
    margin: 2px 0;
}

.mh-idx-svg-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mh-idx-time-ticks {
    display: flex;
    justify-content: space-around;
    font-size: 9.5px;
    color: #64748b;
    margin-top: 2px;
}

.mh-idx-yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 9.5px;
    color: #64748b;
    text-align: right;
    min-width: 44px;
    padding-bottom: 12px;
}

.mh-idx-meta-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 11px;
}

.mh-idx-meta-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mh-idx-meta-line {
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
}

.mh-idx-meta-line b {
    font-weight: 700;
    color: #e2e8f0;
}

.mh-idx-meta-line b.up { color: #f43f5e; }
.mh-idx-meta-line b.down { color: #38bdf8; }

/* 하단 2x2 페어 미니 지수 카드 */
.mh-idx-pair-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    height: 100%;
}

.mh-idx-mini-cell {
    background: rgba(10, 13, 20, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 9px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3px;
}

/* [2단] 당일 실시간 업종별 시가총액 히트맵 (참고 이미지 1 스타일: 대형 Treemap · 마우스 스크롤 지원) */
.mh-treemap-viewport {
    position: relative;
    width: 100%;
    height: 1280px;
    min-height: 920px;
    background: #0d0f17;
    border: 2px solid #262b3d;
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
    transition: height 0.2s ease;
}

.mh-tm-sector {
    position: absolute;
    box-sizing: border-box;
    border: 1.5px solid #141824;
    background: #141824;
    overflow: hidden;
}

.mh-tm-sector-label {
    height: 16px;
    line-height: 16px;
    background: rgba(15, 19, 30, 0.92);
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    letter-spacing: -0.2px;
}

.mh-tm-sector-body {
    position: relative;
    width: 100%;
    height: calc(100% - 16px);
}

.mh-tm-tile {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid rgba(12, 15, 23, 0.72);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2px;
    cursor: pointer;
    overflow: hidden;
    color: #ffffff;
    transition: filter 0.12s ease, transform 0.1s ease;
}

.mh-tm-tile:hover {
    filter: brightness(1.18);
    z-index: 15;
    box-shadow: inset 0 0 0 1.5px #ffffff;
}

.mh-tm-tile .tm-name {
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 96%;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.mh-tm-tile .tm-chg {
    font-weight: 700;
    line-height: 1.15;
    margin-top: 1px;
    opacity: 0.96;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.mh-legend-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
}

.mh-legend-chip {
    padding: 2px 7px;
    border-radius: 3px;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
}

@media (max-width: 1200px) {
    .mh-idx-top-grid, .mh-idx-bottom-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .mh-treemap-viewport {
        height: 580px;
    }
}

@media (max-width: 768px) {
    .main-home-dashboard {
        padding: 12px 10px 44px;
    }
    .mh-idx-top-grid, .mh-idx-bottom-grid {
        grid-template-columns: 1fr;
    }
    .mh-treemap-viewport {
        height: 520px;
    }
}
