/* EMH (Efficient Market Hypothesis) 페이지 전용 스타일 - PSAR과 동일 구조 */

.emh-container {
    max-width: 1000px;
    margin: auto;
    background-color: #fff;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.input-card {
    background-color: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.card-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e4e8;
}

.card-header h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.card-header h2 i {
    margin-right: 10px;
    color: #003366;
}

.section-title {
    font-weight: 600;
    color: #003366;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 8px;
}

form {
    padding: 20px;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 15px;
    width: 100%;
    box-sizing: border-box;
}

.form-row .form-group {
    flex: 1;
    padding: 0 10px;
    min-width: 200px;
    margin-bottom: 15px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
}

label i {
    margin-right: 5px;
    color: #003366;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
    border: 1px solid #cfd7e6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: #007acc;
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.15);
    outline: none;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 30px;
}

.input-with-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip {
    position: absolute;
    top: -40px;
    left: 0;
    background-color: #003366;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    width: 200px;
}

.tooltip:after {
    content: "";
    position: absolute;
    top: 100%;
    left: 15px;
    border-width: 5px;
    border-style: solid;
    border-color: #003366 transparent transparent transparent;
}

.ticker-lookup {
    margin-top: 5px;
    font-size: 12px;
}

.ticker-lookup a {
    color: #007acc;
    text-decoration: none;
}

.ticker-lookup a:hover {
    text-decoration: underline;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #003366;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-weight: 600;
    margin-top: 20px;
}

.submit-btn:hover {
    background-color: #004080;
}

.submit-btn i {
    margin-right: 8px;
}

#loading {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 15px;
    display: block;
}

#loading p {
    margin: 0;
    color: #555;
    font-size: 14px;
}

/* === EMH: PSAR .step / .explanation-box 사용, EMH 전용 보조만 === */

/* Step 1: 데이터 스트립 (explanation-box 내부) */
.emh-step1-data-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}
@media (max-width: 640px) {
    .emh-step1-data-strip { grid-template-columns: 1fr; }
}
.emh-strip-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border: 1px solid #bae6fd;
    border-radius: 8px;
}
.emh-strip-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 4px;
}
.emh-strip-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

/* Step 1: EMH 3형태 카드 (explanation-box 내부) */
.emh-onboarding-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}
@media (max-width: 900px) {
    .emh-onboarding-cards { grid-template-columns: 1fr; }
}
.emh-card {
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0369a1;
    background: white;
}
.emh-card.weak { border-left-color: #64748b; }
.emh-card.semi { border-left-color: #2563eb; }
.emh-card.strong { border-left-color: #059669; }
.emh-card h5 {
    color: #0369a1;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.emh-card h5 i { color: #3b82f6; }
.emh-card.weak h5 { color: #475569; }
.emh-card.weak h5 i { color: #64748b; }
.emh-card.strong h5 { color: #047857; }
.emh-card.strong h5 i { color: #059669; }
.emh-card p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
}
.emh-card-stat {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0;
}
.emh-card-stat strong { color: #1e3a8a; }
.emh-card-mini-chart {
    width: 100%;
    height: 36px;
    margin-top: 10px;
    border-radius: 6px;
}

/* Step 4: 차트 아래 상세 패널 (모달 아님) */
.emh-step4-detail {
    margin-top: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.emh-step4-dashboard-inner {
    background: #fff;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.emh-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.emh-popup-header h5 { margin: 0; color: #003366; font-size: 1.1rem; }
.emh-popup-return {
    font-weight: 700;
    font-size: 1rem;
}
.emh-popup-return.positive { color: #0d9488; }
.emh-popup-return.negative { color: #dc2626; }

.emh-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.emh-dash-section h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.emh-dash-section h6 i { color: #003366; }

.emh-headlines-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 140px;
    overflow-y: auto;
}

.emh-headlines-list li {
    margin-bottom: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.emh-headlines-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.emh-headlines-list a { color: #0d6efd; text-decoration: none; }
.emh-headlines-list a:hover { text-decoration: underline; }
.emh-headline-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

.emh-sentiment-gauge-wrap {
    padding: 0.25rem 0;
}
.emh-sentiment-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 4px;
}
.emh-sentiment-track {
    height: 12px;
    background: linear-gradient(to right, #dc2626 0%, #e5e7eb 50%, #0d9488 100%);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.emh-sentiment-fill {
    position: absolute;
    top: 0;
    height: 100%;
    width: 6px;
    background: #1e293b;
    border-radius: 3px;
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.3s ease;
}
.emh-sentiment-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-top: 4px;
}
.emh-volume-copy {
    font-size: 0.9rem;
    color: #334155;
    margin: 0 0 0.5rem 0;
}
.emh-volume-bar-wrap {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}
.emh-volume-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd, #003366);
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s ease;
    max-width: 100%;
}
.emh-context-copy {
    font-size: 0.85rem;
    color: #475569;
    margin: 0 0 0.5rem 0;
}
.emh-mini-chart {
    min-height: 80px;
    margin-bottom: 0.5rem;
}
.emh-sector-badge-wrap { margin-top: 0.25rem; }
.emh-sector-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}
.emh-sector-badge.systemic {
    background: #dbeafe;
    color: #1d4ed8;
}
.emh-sector-badge.idiosyncratic {
    background: #fef3c7;
    color: #b45309;
}

#emh-step4-detail-close { margin-top: 0.75rem; }
.emh-step4-dashboard-inner .emh-headlines-list + * { margin-top: 0; }

/* Step 5: 시장 효율성 판정 라벨 */
.emh-step5-verdict {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #0c4a6e;
}
.emh-verdict-label {
    font-weight: 700;
    margin-right: 0.5rem;
}

/* Step 5: 해석 가이드 (현대적 카드) */
.emh-step5-guide {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.emh-step5-guide-data {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.emh-step5-guide-data-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.emh-step5-guide-data-item .emh-guide-data-value {
    color: #0f172a;
}

.emh-step5-guide-data-item.emh-data-positive .emh-guide-data-value { color: #0d9488; }
.emh-step5-guide-data-item.emh-data-negative .emh-guide-data-value { color: #dc2626; }

.emh-step5-guide-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emh-step5-guide-title i {
    color: #003366;
}

.emh-step5-guide-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
}

.emh-step5-guide-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #334155;
}

.emh-step5-guide-item:last-child { margin-bottom: 0; }

.emh-guide-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.4rem;
}

.emh-dot-baseline {
    background: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.3);
}

.emh-dot-positive {
    background: #0d9488;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.3);
}

.emh-dot-negative {
    background: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
}

.emh-step5-emh-link {
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.emh-step5-emh-link .emh-step5-guide-title { margin-bottom: 0.5rem; }

.emh-step5-emh-link-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #475569;
}

/* Step 8 summary (inside .explanation-box) */
.emh-insight {
    font-size: 1.05rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #333;
}

.emh-bullets {
    margin: 0;
    padding-left: 1.25rem;
    color: #555;
    line-height: 1.7;
}

.emh-gauge-guide {
    margin-top: 1rem;
    font-weight: 600;
    text-align: center;
}

/* Heatmap table */
.emh-heatmap-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.emh-heatmap-table th,
.emh-heatmap-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: right;
}

.emh-heatmap-table th { background: #f8f9fa; }
.emh-heatmap-table .positive { color: #198754; }
.emh-heatmap-table .negative { color: #dc3545; }

.emh-no-data {
    padding: 1.5rem;
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

/* Step 6: 비정상 수익률 + 히트맵 + 변동의 근원 */
.emh-step6-ar-section {
    margin-bottom: 1.5rem;
}
.emh-step6-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.emh-step6-section-title i { color: #003366; }
.emh-step6-ar-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.5rem 0;
}
.emh-step6-ar-chart {
    min-height: 180px;
    margin-bottom: 0.5rem;
}
.emh-step6-heatmap-section {
    margin-bottom: 1.25rem;
}
.emh-heatmap-table-enhanced.emh-heatmap-table th,
.emh-heatmap-table-enhanced.emh-heatmap-table td {
    padding: 8px 10px;
}
.emh-row-systemic {
    background: rgba(148, 163, 184, 0.08);
}
.emh-row-pure-alpha {
    background: rgba(255, 193, 7, 0.12);
}
.emh-cell-label {
    font-size: 0.8rem;
    font-weight: 600;
}
.emh-focus-icon {
    color: #0d6efd;
    margin-left: 4px;
    font-size: 0.85rem;
}
.emh-step6-summary-card {
    padding: 1rem 1.25rem;
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    margin-top: 1rem;
}
.emh-step6-summary-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0c4a6e;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.emh-step6-summary-title i { color: #0284c7; }
.emh-step6-summary-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #0c4a6e;
}

/* Step 7: 게이지 + 레이더 + 전략 카드 */
.emh-step7-charts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}
.emh-gauge-box {
    flex: 1;
    min-width: 260px;
}
.emh-radar-box {
    flex: 1;
    min-width: 260px;
}
.emh-radar-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}
.emh-radar-wrap {
    min-height: 260px;
}
.emh-step7-strategy-card {
    padding: 1rem 1.25rem;
    background: linear-gradient(145deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde047;
    border-radius: 10px;
    margin-top: 1rem;
}
.emh-step7-strategy-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #713f12;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.emh-step7-strategy-title i { color: #a16207; }
.emh-step7-strategy-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #713f12;
}

/* Step 3: Major Shocks – Event Gallery */
.emh-major-shocks-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}
.emh-shocks-hint {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 1rem 0;
}
.emh-shock-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.emh-shock-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.emh-shock-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}
.emh-shock-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.emh-shock-date {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}
.emh-shock-return {
    font-weight: 700;
    font-size: 1rem;
}
.emh-ret-up { color: #0d9488; }
.emh-ret-down { color: #dc2626; }
.emh-shock-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}
.emh-shock-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.5rem;
}
.emh-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}
.emh-badge-quality {
    background: #e0f2fe;
    color: #0369a1;
}
.emh-badge-eff {
    background: #f0fdf4;
    color: #047857;
}
.emh-shock-sparkline {
    margin-top: 0.5rem;
    min-height: 36px;
}
.emh-sparkline-svg {
    display: block;
    width: 100%;
    max-width: 120px;
    height: 36px;
}

/* === Step 8: FACCTing 전략 리포트 대시보드 === */
.emh-step8-dashboard {
    margin-top: 1rem;
}
.emh-step8-report-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #003366;
    margin-bottom: 1rem;
}
.emh-step8-warning-box {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #92400e;
}
.emh-step8-warning-box i { flex-shrink: 0; }
.emh-step8-chart-wrap {
    margin-bottom: 1.25rem;
}
.emh-step8-chart-caption {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}
.emh-step8-bar-chart {
    min-height: 220px;
}
.emh-step8-confidence-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.emh-step8-confidence-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.95rem;
}
.emh-step8-stars {
    display: flex;
    gap: 2px;
}
.emh-step8-stars .fa-star {
    color: #e2e8f0;
    font-size: 1.2rem;
}
.emh-step8-stars .fa-star.filled {
    color: #f59e0b;
}
.emh-step8-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.emh-step8-badge-high {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}
.emh-step8-matrix-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.emh-step8-matrix-label {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    margin-bottom: 0.35rem;
}
.emh-step8-matrix-desc {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}
.emh-step8-action-guide {
    margin-bottom: 1.25rem;
}
.emh-step8-action-caption {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.emh-step8-action-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.emh-step8-action-table th,
.emh-step8-action-table td {
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.75rem;
    text-align: left;
}
.emh-step8-action-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}
.emh-step8-action-table tr.current-scenario {
    background: #eff6ff;
    border-left: 3px solid #2563eb;
}
.emh-step8-legacy {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}
.emh-step8-legacy .emh-insight { margin-bottom: 0.75rem; }
.emh-step8-legacy .emh-bullets { margin-bottom: 0; }
