@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* 컨테이너 및 폰트 정의 */
.wsta-telegram-container {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 25px;
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

/* 기본 카드 레이아웃 (Glassmorphism & Shadows) */
.wsta-telegram-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.wsta-telegram-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* 카드 우측 상단 블러 서클 효과 */
.wsta-telegram-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    filter: blur(45px);
    opacity: 0.15;
    z-index: 0;
    transition: all 0.35s ease;
}

/* 종합 투자 의견 테마에 따른 좌측 선 및 배경 서클 지정 */
.wsta-opinion-buy {
    border-left: 6px solid #10b981;
}
.wsta-opinion-buy::before {
    background: #10b981;
}
.wsta-opinion-buy .wsta-tg-opinion-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.wsta-opinion-buy .wsta-sentiment-bar-fill {
    background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.wsta-opinion-sell {
    border-left: 6px solid #ef4444;
}
.wsta-opinion-sell::before {
    background: #ef4444;
}
.wsta-opinion-sell .wsta-tg-opinion-badge {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.wsta-opinion-sell .wsta-sentiment-bar-fill {
    background: linear-gradient(90deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.wsta-opinion-hold {
    border-left: 6px solid #6b7280;
}
.wsta-opinion-hold::before {
    background: #6b7280;
}
.wsta-opinion-hold .wsta-tg-opinion-badge {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
    border: 1px solid rgba(107, 114, 128, 0.2);
}
.wsta-opinion-hold .wsta-sentiment-bar-fill {
    background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%);
}

/* 카드 헤더 */
.wsta-tg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 18px;
    margin-bottom: 20px;
    z-index: 1;
    position: relative;
    gap: 10px;
}

.wsta-tg-title-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wsta-tg-badge {
    align-self: flex-start;
    background: #24a1de; /* 텔레그램 스카이블루 */
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.5px;
}

.wsta-main-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0;
}

.wsta-tg-opinion-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.wsta-tg-opinion-badge .wsta-arrow {
    margin-right: 5px;
    font-size: 0.8rem;
}

/* 카드 본문 */
.wsta-tg-body {
    flex-grow: 1;
}

/* 감성 지수 및 파급력 섹션 */
.wsta-tg-sentiment-box {
    margin-bottom: 18px;
}

.wsta-tg-sentiment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wsta-meta-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #4b5563;
}

.wsta-meta-val {
    font-size: 0.9rem;
    font-weight: 800;
    color: #111827;
}

.wsta-sentiment-bar-bg {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.wsta-sentiment-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.1, 0.8, 0.3, 1);
}

/* 2. 시장 파급력 오렌지 테마 바 */
.wsta-impact-bar-bg {
    background: #ffedd5;
}

.wsta-impact-bar-fill {
    background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.3);
}

/* 3. 시계열 타임라인 차트 */
.wsta-timeline-section {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 22px;
}

.wsta-timeline-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin: 20px 0 15px 0;
    padding: 0 10px;
}

.wsta-timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    text-align: center;
}

.wsta-node-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #4b5563;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.wsta-node-active .wsta-node-dot {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.wsta-node-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.wsta-node-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.wsta-node-op-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 20px;
    letter-spacing: -0.2px;
}

/* 타임라인 노드용 서브 의견 뱃지 */
.wsta-sub-buy {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 0.5px solid rgba(16, 185, 129, 0.2);
}
.wsta-sub-sell {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 0.5px solid rgba(239, 68, 68, 0.2);
}
.wsta-sub-hold {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
    border: 0.5px solid rgba(107, 114, 128, 0.2);
}

.wsta-timeline-connector {
    flex-grow: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 -5px;
    position: relative;
    z-index: 1;
    transform: translateY(-24px); /* 커넥터를 점선 중앙 높이로 올림 */
    text-align: center;
}

.wsta-connector-arrow {
    font-size: 0.7rem;
    color: #cbd5e1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.wsta-trend-summary-bar {
    border-top: 1px dashed rgba(0, 0, 0, 0.05);
    padding-top: 10px;
    font-size: 0.8rem;
    color: #4b5563;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wsta-trend-tag-up {
    color: #10b981;
}
.wsta-trend-tag-down {
    color: #ef4444;
}
.wsta-trend-tag-flat {
    color: #6b7280;
}

/* 요약 박스 */
.wsta-tg-summary-box {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.wsta-tg-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 12px 0;
    letter-spacing: -0.3px;
}

.wsta-tg-summary-list {
    margin: 0;
    padding: 0 0 0 16px;
    list-style-type: square;
}

.wsta-tg-summary-list li {
    font-size: 0.86rem;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 6px;
}

.wsta-tg-summary-list li:last-child {
    margin-bottom: 0;
}

/* 아코디언 상세 분석 */
.wsta-accordion {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    padding-top: 16px;
}

.wsta-accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: #2563eb;
    transition: color 0.2s ease;
    outline: none;
}

.wsta-accordion-toggle:hover {
    color: #1d4ed8;
}

.wsta-toggle-icon {
    font-size: 0.65rem;
    transition: transform 0.3s ease;
}

.wsta-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.wsta-analysis-content {
    padding: 15px 0 5px 0;
    font-size: 0.86rem;
    color: #374151;
    line-height: 1.6;
}

.wsta-analysis-content h1, 
.wsta-analysis-content h2, 
.wsta-analysis-content h3, 
.wsta-analysis-content h4 {
    font-weight: 800;
    color: #111827;
    margin: 18px 0 8px 0;
}

.wsta-analysis-content h3 { font-size: 1rem; }
.wsta-analysis-content h4 { font-size: 0.9rem; }

.wsta-analysis-content p {
    margin: 0 0 10px 0;
}

.wsta-analysis-content ul, 
.wsta-analysis-content ol {
    margin: 0 0 10px 0;
    padding-left: 20px;
}

.wsta-analysis-content li {
    margin-bottom: 5px;
}

/* ==========================================
   신규: 이원화 수집 출처 메시지 스타일링
   ========================================== */
.wsta-sources-split-section {
    margin-top: 25px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    padding-top: 20px;
}

.wsta-sources-split-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 16px 0;
}

.wsta-source-group {
    margin-bottom: 18px;
}

.wsta-source-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.wsta-badge-direct {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 0.5px solid rgba(59, 130, 246, 0.2);
}

.wsta-badge-inferred {
    background: rgba(168, 85, 247, 0.1);
    color: #7c3aed;
    border: 0.5px solid rgba(168, 85, 247, 0.2);
}

.wsta-source-bubbles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wsta-source-bubble {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #4b5563;
    line-height: 1.5;
    position: relative;
}

.wsta-bubble-inferred {
    border-style: dashed;
    border-color: #d8b4fe;
    background: #faf5ff;
}

.wsta-inferred-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 800;
    color: #7c3aed;
    background: #ffffff;
    border: 0.5px solid #d8b4fe;
    padding: 1px 5px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

.wsta-report-date {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: right;
    margin-top: 15px;
}

/* 데이터 없음 */
.wsta-no-data {
    background: #f9fafb;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
    border: 1px dashed #d1d5db;
    grid-column: 1 / -1;
}

/* ==========================================
   카테고리 메인 차트 대시보드 숏코드용 스타일
   ========================================== */
.wsta-dashboard-wrapper {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    width: 100%;
    margin-bottom: 30px;
}

.wsta-dashboard-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
}

.wsta-dashboard-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 15px;
    margin-bottom: 10px;
}

.wsta-dashboard-badge {
    display: inline-block;
    background: #6366f1; /* 로열 퍼플 */
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.wsta-dashboard-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 6px 0;
}

.wsta-dashboard-desc {
    font-size: 0.88rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* 반응형 대응 */
@media (max-width: 600px) {
    .wsta-telegram-container {
        grid-template-columns: 1fr;
    }
}
