/* Chart Tab Styles */

/* 시장 운영 신호등 */
.market-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00b894;
    margin-left: 4px;
    animation: marketPulse 1.5s ease-in-out infinite;
}

.market-status-dot.closed {
    background: #dc3545;
    animation: none;
}

@keyframes marketPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.6);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 8px 2px rgba(0, 184, 148, 0.4);
    }
}

.chart-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background: var(--bg-secondary); }
.symbol-name { font-size: 16px; font-weight: bold; }

/* 기존 타임프레임 버튼 (호환성 유지) */
.timeframe-buttons { display: flex; gap: 5px; }
.tf-btn { background: #1e2127; border: 1px solid var(--border-color); color: var(--text-muted); padding: 5px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.tf-btn.active { background: var(--accent-cyan); color: #0d1421; border-color: var(--accent-cyan); }

/* ========== 차트 툴 버튼 v2 (세련된 버전) ========== */
.chart-tool-btn-v2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(180deg, rgba(30, 40, 55, 0.9) 0%, rgba(15, 20, 30, 0.95) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #00d4ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chart-tool-btn-v2:hover {
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.15) 0%, rgba(0, 150, 200, 0.1) 100%);
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.chart-tool-btn-v2:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.chart-tool-btn-v2 svg {
    stroke: #00d4ff;
}

/* 드롭다운 메뉴 v2 */
.chart-tool-menu-v2 {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: linear-gradient(180deg, #1e2530 0%, #151a22 100%);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 12px;
    padding: 14px;
    min-width: 200px;
    z-index: 150;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 212, 255, 0.15);
}

.chart-tool-menu-v2.show {
    display: block;
    animation: menuFadeInV2 0.2s ease;
}

@keyframes menuFadeInV2 {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-menu-title-v2 {
    font-size: 11px;
    font-weight: 700;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

/* 타임프레임 그리드 v2 */
.tf-grid-v2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.tf-item-v2 {
    padding: 10px 6px;
    background: rgba(30, 40, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.tf-item-v2:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: #ffffff;
}

.tf-item-v2.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border-color: #00d4ff;
    color: #000;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.4);
}

/* ========== 타임프레임 모달 팝업 (글래스모피즘) ========== */
.tf-popup-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-popup-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.tf-popup-btn:active {
    transform: scale(0.98);
}

.tf-popup-btn svg {
    stroke: #00d4ff;
}

/* 모달 오버레이 */
.tf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 모달 박스 */
.tf-modal {
    background: linear-gradient(180deg, #1a2535 0%, #0d1421 100%);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 320px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(0, 212, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 모달 헤더 */
.tf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.15) 0%, transparent 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.tf-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #00d4ff;
    letter-spacing: 0.5px;
}

.tf-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #9ca3af;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tf-modal-close:hover {
    background: rgba(255, 82, 82, 0.3);
    color: #dc3545;
}

/* 모달 그리드 (2열 4행) */
.tf-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px;
}

.tf-modal-item {
    padding: 16px 20px;
    background: rgba(30, 40, 55, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #9ca3af;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.tf-modal-item:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.tf-modal-item.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border-color: #00d4ff;
    color: #000;
    font-weight: 700;
    box-shadow: 0 5px 25px rgba(0, 212, 255, 0.5);
}

.tf-modal-item.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.6);
}

/* 보조지표 메뉴 v2 */
.indicator-menu-v2 {
    min-width: 220px;
}

.indicator-options-v2 {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ind-option-v2 {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(30, 40, 55, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ind-option-v2:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.2);
}

.ind-option-v2 input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00d4ff;
    cursor: pointer;
}

.ind-color-v2 {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ind-option-v2 span:last-child {
    font-size: 13px;
    color: #e5e7eb;
    font-weight: 500;
}

.ind-apply-btn-v2 {
    width: 100%;
    margin-top: 12px;
    padding: 11px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ind-apply-btn-v2:hover {
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

.ind-apply-btn-v2:active {
    transform: translateY(0);
}

/* ========== 차트 컨테이너 ========== */
#chart-container {
    width: 100%;
    background: #000000;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    margin: 0;
}

/* 시간축 구분선 오른쪽 끝까지 연장 */
#chart-container .tv-lightweight-charts {
    position: relative;
}

#chart-container table {
    border-collapse: collapse;
}

/* 시간축 상단에 가로선 추가 (호가 영역까지 연장) */
#chart-wrapper::after {
    content: '';
    position: absolute;
    bottom: 22px;  /* 시간축 높이에 맞춤 */
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 50;
}

.price-bar { display: flex; padding: 10px 15px; gap: 10px; }

/* Chart Symbol Selector */
.chart-symbol-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px;
    margin-top: -2px;
    background: #000000;
    border-bottom: none;
    position: relative;
}
.chart-symbol-info { display: flex; align-items: center; gap: 8px; }
.chart-symbol-info .material-icons-round { display: flex; align-items: center; }
.chart-symbol-icon { font-size: 20px; }
.chart-symbol-name { font-size: 25px; font-weight: 700; }
.chart-symbol-id { display: none; }  /* 심볼 ID 숨김 - 한 줄로 단순화 */
.chart-symbol-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-secondary); border: 1px solid var(--accent-cyan); border-radius: 8px; margin-top: 5px; z-index: 50; max-height: 300px; overflow-y: auto; display: none; }
.chart-symbol-option { display: flex; align-items: center; gap: 10px; padding: 12px 15px; cursor: pointer; border-bottom: 1px solid var(--border-color); }
.chart-symbol-option:hover { background: rgba(255,255,255,0.1); }
.chart-symbol-option:last-child { border-bottom: none; }
.chart-symbol-option.favorite { background: rgba(0,212,255,0.1); }
.favorite-star { color: #00b894; margin-left: auto; }

/* Chart Signal Section */
.chart-signal-section { padding: 15px; background: var(--bg-primary); }
.chart-signal-title { font-size: 16px; font-weight: 700; color: var(--accent-cyan); margin-bottom: 15px; letter-spacing: 0.5px; }
.chart-gauge-container { text-align: center; padding: 10px 0; }
.chart-gauge-status { font-size: clamp(18px, 5.5vw, 24px); font-weight: 900; letter-spacing: clamp(1px, 0.5vw, 2px); margin-top: 5px; transition: color 0.5s ease, text-shadow 0.5s ease; }
.chart-indicator-summary { display: flex; background: var(--bg-secondary); border-radius: 10px; overflow: hidden; margin-top: 15px; border: 1px solid var(--border-color); }
.chart-indicator-item { flex: 1; text-align: center; padding: 10px; }
.chart-indicator-item:not(:last-child) { border-right: 1px solid var(--border-color); }
.chart-indicator-count { font-size: clamp(18px, 5.5vw, 24px); font-weight: bold; }
.chart-indicator-label { font-size: 10px; color: var(--text-muted); }
.price-box { flex: 1; text-align: center; padding: 10px 15px; border-radius: 8px; }
.price-box.sell { background: linear-gradient(180deg, #dc3545, #c82333); }
.price-box.buy { background: linear-gradient(180deg, #00b894, #00a383); }
.price-label { font-size: 10px; opacity: 0.9; }
.price-value { font-size: clamp(14px, 4vw, 18px); font-weight: bold; }

/* 차트 상세 컨테이너 */
.chart-detail-container {
    display: none;
    margin: 0;
    padding: 0;
}

.chart-detail-container.active {
    display: block;
}

/* 차트 글로우 박스 (헤더 + 차트 + 호가) */
.chart-glow-box {
    margin: 0;
    padding: 0;
    background: #000000;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* 종목 검색 모달 */
.search-category-btn {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.search-category-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: #000;
}
.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}
.search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.search-result-item:active {
    background: rgba(0, 212, 255, 0.1);
}
.search-result-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-right: 12px;
}
.search-result-info {
    flex: 1;
}
.search-result-symbol {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.search-result-name {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.search-result-category {
    font-size: 10px;
    padding: 3px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-muted);
}

/* ========== 차트 툴 드롭다운 (기존 클래스) ========== */
.chart-tools-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.chart-tool-dropdown {
    position: relative;
    display: inline-flex;
    vertical-align: top;
}

.chart-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(180deg, rgba(30, 40, 55, 0.9) 0%, rgba(15, 20, 30, 0.95) 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #00d4ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chart-tool-btn:hover {
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.15) 0%, rgba(0, 150, 200, 0.1) 100%);
    border-color: rgba(0, 212, 255, 0.6);
    transform: translateY(-1px);
}

.chart-tool-btn svg {
    stroke: #00d4ff;
}

/* 드롭다운 메뉴 */
.chart-tool-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    background: linear-gradient(180deg, #1e2530 0%, #151a22 100%);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 12px;
    padding: 14px;
    min-width: 140px;
    z-index: 1000;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 212, 255, 0.15);
    white-space: nowrap;
}

.tool-menu-title {
    font-size: 11px;
    font-weight: 700;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

/* 타임프레임 그리드 (2열 4행) */
.tf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.tf-item {
    padding: 10px 6px;
    background: rgba(30, 40, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.tf-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: #ffffff;
}

.tf-item.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border-color: #00d4ff;
    color: #000;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.4);
}

/* 보조지표 옵션 */
.indicator-menu {
    min-width: 220px;
}

.indicator-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ind-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(30, 40, 55, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ind-option:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.2);
}

.ind-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00d4ff;
    cursor: pointer;
}

.ind-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ind-option span:last-child {
    font-size: 13px;
    color: #e5e7eb;
    font-weight: 500;
}

.ind-apply-btn {
    width: 100%;
    margin-top: 12px;
    padding: 11px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ind-apply-btn:hover {
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

/* ========== 타임프레임 드롭다운 (새 버전) ========== */
.tf-dropdown-wrapper {
    position: relative;
}

.tf-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.15) 0%, rgba(0, 150, 200, 0.08) 100%);
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 10px;
    color: #00d4ff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 212, 255, 0.1);
}

.tf-dropdown-btn:hover {
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.25) 0%, rgba(0, 150, 200, 0.15) 100%);
    border-color: rgba(0, 212, 255, 0.7);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 212, 255, 0.2);
    transform: translateY(-1px);
}

.tf-dropdown-btn:active {
    transform: translateY(0);
}

.tf-dropdown-btn svg {
    stroke: #00d4ff;
}

.tf-arrow {
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.tf-dropdown-btn.open .tf-arrow {
    transform: rotate(180deg);
}

/* 드롭다운 메뉴 */
.tf-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: linear-gradient(180deg, #1a2332 0%, #0f1419 100%);
    border: 1px solid rgba(0, 212, 255, 0.5);
    border-radius: 14px;
    padding: 16px;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(0, 212, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tf-dropdown-menu.show {
    display: block;
    animation: tfDropdownOpen 0.2s ease;
}

@keyframes tfDropdownOpen {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tf-dropdown-title {
    font-size: 11px;
    font-weight: 700;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    text-align: center;
}

/* 2열 4행 그리드 */
.tf-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.tf-dropdown-item {
    padding: 12px 16px;
    background: rgba(30, 40, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.tf-dropdown-item:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
    color: #ffffff;
    transform: translateY(-1px);
}

.tf-dropdown-item.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border-color: #00d4ff;
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* ========== 차트 버튼 그룹 ========== */
.chart-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 보조지표 버튼 (글래스모피즘) ========== */
.ind-popup-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ind-popup-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.ind-popup-btn:active {
    transform: scale(0.98);
}

.ind-popup-btn svg {
    stroke: #00d4ff;
}

/* ========== 보조지표 모달 ========== */
.ind-modal {
    background: #1a2332;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 16px;
    overflow: hidden;
    width: 90%;
    max-width: 340px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(0, 212, 255, 0.15);
    animation: indModalSlideIn 0.25s ease;
}

@keyframes indModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ind-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.ind-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.ind-modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ind-modal-close:hover {
    background: rgba(255, 82, 82, 0.3);
    color: #dc3545;
}

.ind-modal-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ind-modal-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 14px;
    outline: none;
}

.ind-modal-search input::placeholder {
    color: #6b7280;
}

.ind-modal-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 0;
}

.ind-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.ind-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ind-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.ind-checkbox.checked {
    background: #00d4ff;
    border-color: #00d4ff;
}

.ind-checkbox.checked::after {
    content: '✓';
    color: #000;
    font-size: 12px;
    font-weight: bold;
}

.ind-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.ind-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ind-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.ind-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

.ind-modal-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.ind-btn-reset {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ind-btn-reset:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.ind-btn-apply {
    flex: 2;
    padding: 12px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ind-btn-apply:hover {
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

.ind-btn-apply:active {
    transform: translateY(0);
}

/* ========== 종목 정보 섹션 (Account Overview 스타일) ========== */
.symbol-info-section {
    margin: 15px 1px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.info-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.info-section-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.info-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section-title .icon {
    color: #00d4ff;
    font-size: 18px;
}

.info-section-title .text {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.info-section-badge {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    border-radius: 6px;
    font-weight: 600;
}

.info-toggle-icon {
    color: #6b7280;
    font-size: 20px;
    transition: transform 0.3s ease;
}

.info-toggle-icon.open {
    transform: rotate(180deg);
}

.symbol-name-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin: 0 0 12px;
}

.symbol-name-icon {
    font-size: 28px;
}

.symbol-name-info {
    flex: 1;
}

.symbol-name-main {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.symbol-name-sub {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

/* 정보 그룹 (카드 스타일) */
.info-group {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 12px 15px;
    margin: 0 0 12px;
}

.info-group:last-child {
    margin-bottom: 12px;
}

.info-group-title {
    font-size: 14px;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-group-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #00d4ff;
    border-radius: 2px;
}

/* 정보 행 */
.symbol-info-section .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.symbol-info-section .info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.symbol-info-section .info-row:first-of-type {
    padding-top: 0;
}

.symbol-info-section .info-label {
    font-size: 13px;
    color: var(--text-muted);
}

.symbol-info-section .info-value {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-align: right;
}

.symbol-info-section .info-value.highlight {
    color: #00d4ff;
}

.symbol-info-section .info-value.positive {
    color: #00b450;
}

.symbol-info-section .info-value.negative {
    color: #dc3246;
}

.info-value-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 거래시간 그리드 */
.trading-hours-grid {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 6px 4px;
}

.trading-day {
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 0;
}

.trading-day.today {
    color: #00d4ff;
    font-weight: 600;
}

.trading-time {
    font-size: 12px;
    color: #ffffff;
    padding: 6px 0;
    text-align: right;
    font-weight: 600;
}

.trading-time.closed {
    color: #dc3246;
}

/* 접기/펼치기 */
.symbol-info-content.collapsed {
    display: none;
}

.symbol-info-content {
    padding-top: 4px;
}

/* ========== 차트 + 패널 지표 레이아웃 ========== */

/* 차트 래퍼 (메인 차트 + 패널 지표 포함) */
#chart-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

/* 메인 차트 - 패널 지표 개수에 따라 높이 조절 */
#chart-wrapper #chart-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#chart-wrapper #indicator-panels {
    flex-shrink: 0;
}

/* 패널 지표가 없을 때 */
#chart-wrapper.panels-0 #chart-container {
}

/* 패널 지표 1개 */
#chart-wrapper.panels-1 #chart-container {
}

/* 패널 지표 2개 */
#chart-wrapper.panels-2 #chart-container {
}

/* 패널 지표 3개 */
#chart-wrapper.panels-3 #chart-container {
}

/* ========== 패널 지표 영역 ========== */
#indicator-panels {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-primary);
}

/* 개별 패널 지표 (연속된 차트 스타일) */
.indicator-panel {
    position: relative;
    height: clamp(90px, 15vw, 120px);
    background: #000000;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    margin: 0;
    overflow: hidden;
}

/* 패널 헤더 (지표명 + 삭제버튼) */
.indicator-panel-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(180deg, rgba(13, 20, 33, 0.95) 0%, transparent 100%);
    z-index: 10;
}

.indicator-panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
}

.indicator-panel-title .color-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

/* 패널 삭제 버튼 */
.indicator-panel-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #6b7280;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0;
}

.indicator-panel:hover .indicator-panel-close {
    opacity: 1;
}

.indicator-panel-close:hover {
    background: rgba(255, 82, 82, 0.3);
    color: #dc3545;
}

/* 패널 차트 컨테이너 */
.indicator-panel-chart {
    width: 100%;
    height: 100%;
}

/* ========== 활성 지표 태그 바 ========== */
.active-indicators-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    min-height: 0;
    transition: all 0.2s ease;
}

.active-indicators-bar:empty {
    display: none;
}

/* 활성 지표 태그 */
.active-indicator-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(30, 40, 55, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #e5e7eb;
    animation: tagFadeIn 0.2s ease;
}

@keyframes tagFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.active-indicator-tag .tag-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.active-indicator-tag .tag-name {
    color: #ffffff;
}

.active-indicator-tag .tag-type {
    font-size: 9px;
    padding: 2px 5px;
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border-radius: 3px;
}

.active-indicator-tag .tag-type.panel {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
}

/* 태그 삭제 버튼 */
.active-indicator-tag .tag-remove {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s ease;
    margin-left: 2px;
}

.active-indicator-tag .tag-remove:hover {
    background: rgba(255, 82, 82, 0.3);
    color: #dc3545;
}

/* ========== 지표 모달 추가 스타일 ========== */

/* 패널 지표 개수 안내 */
.ind-panel-limit-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    font-size: 12px;
    color: #ffffff;
}

.ind-panel-limit-notice strong {
    color: #00d4ff;
}

/* 지표 카테고리 헤더 */
.ind-category-header {
    padding: 12px 16px 8px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ind-category-header .material-icons-round {
    font-size: 16px;
    opacity: 0.8;
}

.ind-category-header:first-child {
    margin-top: 0;
    border-top: none;
}

.ind-category-header .panel-count {
    font-weight: 400;
    color: #00d4ff;
}

/* 패널 지표 항목 비활성화 상태 */
.ind-item.panel-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.ind-item.panel-disabled::after {
    content: '최대 3개';
    position: absolute;
    right: 16px;
    font-size: 10px;
    color: #dc3545;
    font-weight: 600;
}

/* 지표 항목 레이아웃 */
.ind-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ind-item .ind-info {
    flex: 1;
}

/* 패널 뱃지 - 삭제됨 */

/* 선택된 지표 하이라이트 */
.ind-item.selected {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

/* ========== 차트 모바일 반응형 ========== */
@media screen and (max-width: 400px) {
    /* 심볼 행 */
    .chart-symbol-row {
        padding: 2px 10px;
        margin-top: -3px;
    }
    .chart-symbol-icon {
        font-size: 18px;
    }
    .chart-symbol-id {
        font-size: 10px;
    }

    /* 차트 글로우 박스 */
    .chart-glow-box {
        margin: 0;
        padding: 0;
        border-radius: 0;
    }

    /* 차트 컨테이너 */
    #chart-container {
        margin: 0;
        border-radius: 0;
    }

    /* 타임프레임 버튼 */
    .tf-popup-btn {
        padding: 8px 12px;
        font-size: 13px;
        gap: 6px;
    }

    /* 보조지표 버튼 */
    .ind-popup-btn {
        padding: 8px 10px;
        font-size: 12px;
        gap: 4px;
    }

    /* 가격 바 */
    .price-bar {
        padding: 8px 10px;
        gap: 8px;
    }
    .price-box {
        padding: 8px 10px;
    }
    .price-label {
        font-size: 9px;
    }

    /* 신호 섹션 */
    .chart-signal-section {
        padding: 12px;
    }
    .chart-signal-title {
        font-size: 14px;
        margin-bottom: 12px;
    }

    /* 지표 요약 */
    .chart-indicator-item {
        padding: 8px;
    }
    .chart-indicator-label {
        font-size: 9px;
    }

    /* 모달 */
    .tf-modal {
        width: 95%;
        max-width: 300px;
    }
    .tf-modal-grid {
        gap: 8px;
        padding: 15px;
    }
    .tf-modal-item {
        padding: 12px 15px;
        font-size: 14px;
    }

    /* 지표 모달 */
    .ind-modal {
        width: 95%;
        max-width: 320px;
    }

    /* 패널 지표 */
    .indicator-panel-header {
        padding: 3px 8px;
    }
    .indicator-panel-title {
        font-size: 10px;
    }

    /* 활성 지표 태그 */
    .active-indicator-tag {
        padding: 4px 8px;
        font-size: 10px;
        gap: 4px;
    }
    .active-indicator-tag .tag-color {
        width: 6px;
        height: 6px;
    }

    /* 차트 툴 버튼 */
    .chart-tool-btn,
    .chart-tool-btn-v2 {
        padding: 6px 10px;
        font-size: 12px;
        gap: 4px;
    }

    /* 드롭다운 메뉴 */
    .chart-tool-menu,
    .chart-tool-menu-v2 {
        min-width: 120px;
        padding: 10px;
    }
    .tool-menu-title,
    .tool-menu-title-v2 {
        font-size: 10px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    .tf-item,
    .tf-item-v2 {
        padding: 8px 4px;
        font-size: 11px;
    }

    /* 종목 정보 섹션 */
    .symbol-info-section {
        margin: 12px 1px;
        padding: 6px;
    }
    .info-section-header {
        padding: 12px 14px;
    }
    .info-section-title .text {
        font-size: 13px;
    }
    .info-group {
        padding: 10px 12px;
    }
    .info-group-title {
        font-size: 13px;
    }
    .symbol-info-section .info-label,
    .symbol-info-section .info-value {
        font-size: 12px;
    }
}

/* ============================================================
   차트 가격 오버레이 스타일
   ============================================================ */

#chart-price-overlay {
    max-width: calc(100% - 80px);  /* 오른쪽 아이콘 영역 확보 */
}

#chart-price-overlay > div:last-child {
    flex-wrap: nowrap;
    white-space: nowrap;
}

#overlayCategory {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 모바일에서 오버레이 조정 */
@media screen and (max-width: 400px) {
    #chart-price-overlay {
        max-width: calc(100% - 60px);
    }

    #chart-price-overlay > div:last-child {
        font-size: 11px !important;
        gap: 4px !important;
    }

    #overlayPrice {
        font-size: 20px !important;
    }

    #overlayCategory {
        max-width: 80px;
    }
}

/* 매우 작은 화면 */
@media screen and (max-width: 360px) {
    #chart-price-overlay > div:last-child {
        font-size: 10px !important;
    }

    #overlayCategory {
        max-width: 60px;
    }
}

/* ============================================================
   제로마켓 스타일 - Chart 탭 오버레이
   ============================================================ */

/* 제로마켓 모드 활성화 시 게이지/신호 섹션 숨김 */
#page-chart.zm-mode .chart-signal-section {
    display: none;
}

#page-chart.zm-mode .symbol-info-section {
    display: none;
}

#page-chart.zm-mode .price-bar {
    display: none;
}

#page-chart.zm-mode #chart-container {
}

/* ========== 제로마켓 하단 바 ========== */
.zm-bottom-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    margin-top: -3px;
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    /* ★ 네비바 위에 항상 고정 */
    position: fixed;
    bottom: 58px;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    z-index: 101;
}

.zm-more-btn,
.zm-tf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 56px;
    height: 40px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.zm-more-btn:active,
.zm-tf-btn:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.96);
}

.zm-more-btn .material-icons-round {
    font-size: 20px;
}

.zm-tf-btn .material-icons-round {
    font-size: 24px;
}

#zmTfText {
    font-size: 15px;
    font-weight: 700;
}

.zm-trade-buttons {
    display: flex;
    flex: 1;
    gap: 0;
    height: 44px;
    margin-left: 16px;
}

.zm-sell-btn,
.zm-buy-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    color: #ffffff;
}

.zm-sell-btn {
    background: linear-gradient(180deg, #ff4d5a 0%, #dc3545 50%, #c82333 100%);
    border-radius: 8px 2px 2px 8px;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0 100%);
}

.zm-buy-btn {
    background: linear-gradient(180deg, #00d4a4 0%, #00b894 50%, #00a383 100%);
    border-radius: 2px 8px 8px 2px;
    clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%);
}

.zm-sell-btn:active {
    background: linear-gradient(180deg, #dc3545 0%, #c82333 100%);
    transform: scale(0.98);
}

.zm-buy-btn:active {
    background: linear-gradient(180deg, #00b894 0%, #00a383 100%);
    transform: scale(0.98);
}

/* 타임프레임 바텀시트 (제로마켓 스타일 v2) */
.zm-bottomsheet-content .zm-bottomsheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    border-bottom: none;
}

.zm-close-btn {
    background: #21262d;
    border: none;
    color: #7d8590;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zm-close-btn:hover {
    background: #30363d;
    color: #ffffff;
}

.zm-tf-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 0 20px 24px;
}

.zm-tf-item {
    padding: 14px 8px;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 12px;
    color: #8b949e;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.zm-tf-item:hover {
    background: #1c2128;
    border-color: #30363d;
    color: #ffffff;
}

.zm-tf-item.active {
    background: linear-gradient(135deg, #00bcd4 0%, #00838f 100%);
    border-color: #00bcd4;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}

/* ========== 제로마켓 상단 아이콘 ========== */
.chart-btn-group.zm-icons {
    display: flex;
    gap: 8px;
}

.zm-icon-btn {
    background: transparent;
    border: none;
    border-radius: 0;
    color: #fff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.15s;
}

.zm-icon-btn:active {
    opacity: 0.6;
}

.zm-icon-btn .material-icons-round {
    font-size: 24px;
}

/* 큰 아이콘 (검색, 즐겨찾기, 정보) */
.zm-icon-btn.zm-icon-lg {
    width: 36px;
    height: 36px;
}

.zm-icon-btn.zm-icon-lg .material-icons-round {
    font-size: 28px;
}

/* 작은 아이콘 (회전) - 기본 크기 유지 */
.zm-icon-btn.zm-icon-sm {
    width: 32px;
    height: 32px;
}

.zm-icon-btn.zm-icon-sm .material-icons-round {
    font-size: 24px;
}

/* ========== 토스트 메시지 ========== */
.zm-toast {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2332;
    color: #fff;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    z-index: 99999;
    animation: fadeIn 0.3s ease;
    border: 2px solid #00bcd4;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    text-align: center;
    min-width: 150px;
}

.zm-toast.success {
    border-color: #00d4aa;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========== 종목 정보 슬라이드 패널 ========== */
.zm-info-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 9999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.zm-info-panel.active {
    right: 0;
}

.zm-info-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #000000;
    border-bottom: 1px solid #2a2a3e;
    position: sticky;
    top: 0;
    z-index: 10;
}

.zm-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.zm-back-btn .material-icons-round {
    font-size: 24px;
}

.zm-info-body {
    padding: 16px;
}

.zm-info-body .info-group {
    background: #2D3139;
    border: 1px solid #232424;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.zm-info-body .info-group-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.zm-info-body .info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.zm-info-body .info-row:last-child {
    border-bottom: none;
}

.zm-info-body .info-label {
    color: #888;
    font-size: 13px;
}

.zm-info-body .info-value {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

/* ========== 가로보기 (Landscape Mode) 전용 스타일 ========== */

/* 기본: 가로 전용 바 숨김 */
.landscape-top-bar,
.landscape-bottom-bar {
    display: none;
}

/* 가로모드 활성 — body */
body.landscape-active {
    overflow: hidden;
}

/* 헤더 / 하단 네비 완전 숨김 */
body.landscape-active .header,
body.landscape-active .bottom-nav {
    display: none !important;
}

/* chartDetailContainer 전체화면 */
body.landscape-active #chartDetailContainer {
    position: fixed !important;
    top: 0; left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9990;
    background: #000;
    overflow: hidden;
    display: block !important;
}

/* chart-glow-box — 상단바 아래부터 화면 끝까지 */
body.landscape-active .chart-glow-box {
    display: block !important;
    position: fixed !important;
    top: 44px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 44px) !important;
    overflow: hidden;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
    padding: 0 !important;
}

/* chart-wrapper */
body.landscape-active #chart-wrapper {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    height: calc(100vh - 44px) !important;
    min-height: calc(100vh - 44px) !important;
    max-height: calc(100vh - 44px) !important;
    overflow: hidden;
}

/* chart-container — 남은 공간 전부 */
body.landscape-active #chart-container {
    flex: 1 !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 패널 지표 — 최대 33vh */
body.landscape-active #indicator-panels {
    max-height: 33vh !important;
    overflow: hidden;
    flex-shrink: 0;
}

/* 숨길 UI 요소들 */
body.landscape-active .chart-symbol-row,
body.landscape-active .zm-bottom-bar,
body.landscape-active .symbol-info-section,
body.landscape-active .chart-signal-section,
body.landscape-active .price-bar,
body.landscape-active .zm-close-landscape,
body.landscape-active .chart-positions-section,
body.landscape-active .landscape-bottom-bar,
body.landscape-active #chartLoadingOverlay {
    display: none !important;
}

/* ── 가로모드 전용 상단바 ── */
body.landscape-active .landscape-top-bar {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 44px;
    background: #000000;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 9999;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    box-sizing: border-box;
}

/* 심볼 좌측 */
.landscape-symbol-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landscape-sym-icon {
    font-size: 27px;
    line-height: 1;
}

.landscape-sym-text {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.2;
}

.landscape-sym-id {
    display: none;
}

.landscape-sym-name {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 0.5px;
}

/* 우측 버튼 그룹 */
.landscape-top-btns {
    display: flex;
    align-items: center;
    gap: 2px;
}

.landscape-icon-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.65);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.landscape-icon-btn:active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.landscape-icon-btn .material-icons-round {
    font-size: 28px;
}

.landscape-close-btn .material-icons-round {
    color: rgba(0, 212, 255, 0.9);
}

/* ── 가로모드 전용 하단바 (현재 미사용, 구조 유지) ── */
body.landscape-active .landscape-bottom-bar {
    display: none !important;
}

.landscape-tf-group { display: flex; align-items: center; gap: 0; }
.landscape-tf-btn { background: none; border: none; color: rgba(255,255,255,0.45); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-family: 'Rajdhani', sans-serif; }
.landscape-tf-btn.active { color: #00d4ff; background: rgba(0,212,255,0.1); }
.landscape-settings-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.65); width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.landscape-settings-btn .material-icons-round { font-size: 18px; }

.zm-close-landscape {
    display: none;
}

/* ========== 차트 상단 화살표 위치 조정 ========== */
#page-chart.zm-mode .chart-symbol-info > div > div:first-child {
    align-items: flex-start;
}

#page-chart.zm-mode .chart-symbol-info > div > div:first-child > span:last-child {
    margin-left: 4px;
    margin-top: 8px;
}

.zm-info-body .trading-hours-grid {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 0;
}

.zm-info-body .trading-hours-grid .trading-day,
.zm-info-body .trading-hours-grid .trading-time {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== 더보기 바텀시트 (제로마켓 스타일 v2) ========== */
.zm-more-content {
    background: #0a0a0a !important;
    border-radius: 16px !important;
    padding: 0 !important;
    max-height: 55vh !important;
}

.zm-handle-bar {
    width: 48px;
    height: 5px;
    background: #3d4450;
    border-radius: 3px;
    margin: 14px auto 24px;
}

.zm-more-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    padding: 0 24px 20px;
    letter-spacing: -0.3px;
}

.zm-more-menu-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zm-more-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.zm-more-menu-item:hover,
.zm-more-menu-item:active {
    background: #252525;
    transform: scale(0.98);
}

.zm-more-icon-box {
    width: 44px;
    height: 44px;
    background: #0d3d4d;
    border: 1px solid #00d4ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zm-more-icon-box .material-icons-round {
    font-size: 22px;
    color: #00d4ff;
}

.zm-more-menu-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.zm-more-menu-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    padding: 0;
    letter-spacing: -0.2px;
}

.zm-more-menu-sub {
    font-size: 12px;
    color: #888888;
    font-weight: 400;
}

.zm-more-arrow {
    font-size: 20px;
    color: #555555;
    transition: transform 0.2s;
}

.zm-more-menu-item:hover .zm-more-arrow {
    transform: translateX(3px);
    color: #777777;
}

/* ========== 바텀시트 기본 스타일 ========== */
.zm-bottomsheet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.zm-bottomsheet.active {
    display: flex !important;
}

.zm-bottomsheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.zm-bottomsheet-content {
    position: relative;
    width: 100%;
    max-width: 340px;
    background: #0a0a0a;
    border-radius: 16px;
    padding: 0;
    max-height: 70vh;
    animation: zmPopIn 0.2s ease-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9);
}

@keyframes zmPopIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.zm-bottomsheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.zm-close-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 6px;
    color: #888888;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.zm-close-btn:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

/* 핸들바 */
.zm-handle-bar {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    margin: 12px auto 0;
}

/* 타임프레임 그리드 */
.zm-tf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px;
}

.zm-tf-item {
    padding: 12px 8px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    color: #888888;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.zm-tf-item:active {
    background: #252525;
    transform: scale(0.97);
}

.zm-tf-item.active {
    background: #00d4ff;
    border-color: #00d4ff;
    color: #000000;
    font-weight: 700;
}

/* ========== 차트 타입 모달 ========== */
.ct-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.ct-modal {
    background: #121212;
    border-radius: 20px;
    min-width: 320px;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.ct-modal-handle {
    width: 40px;
    height: 4px;
    background: #3a3a3a;
    border-radius: 2px;
    margin: 12px auto 0;
}

.ct-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
}

.ct-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.ct-modal-close {
    width: 32px;
    height: 32px;
    background: #2a2a2a;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}

.ct-modal-close:hover {
    background: #3a3a3a;
}

.ct-modal-close .material-icons-round {
    font-size: 18px;
    color: #888888;
}

.ct-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 8px 16px 20px;
}

.ct-modal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ct-modal-item:hover {
    background: #252525;
    transform: scale(0.98);
}

.ct-modal-item.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
}

.ct-icon-box {
    width: 48px;
    height: 48px;
    background: #0d3d4d;
    border: 1px solid #00d4ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ct-icon-box .material-icons-round,
.ct-icon-box svg {
    font-size: 24px;
    color: #00d4ff;
}

.ct-item-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ct-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.ct-item-sub {
    font-size: 11px;
    color: #666666;
}

/* ★ 차트 모드: panels-X 하드코딩 높이 무력화 (JS가 직접 설정) */
body.chart-mode #chart-wrapper.panels-0 #chart-container,
body.chart-mode #chart-wrapper.panels-1 #chart-container,
body.chart-mode #chart-wrapper.panels-2 #chart-container,
body.chart-mode #chart-wrapper.panels-3 #chart-container {
    
}

body.chart-mode .chart-symbol-row {
    margin: 0 !important;
    margin-top: 3px !important;
    padding: 2px 12px !important;
}
/* ★ 차트 영역 배경 검정 통일 */
#page-chart, .chart-glow-box, #chart-wrapper, .chart-detail-container {
    background: #000000 !important;
}

/* ★ 시간축 폰트 살짝 확대 */
#chart-wrapper .tv-lightweight-charts,
#indicator-panels .tv-lightweight-charts {
    font-size: 13px !important;
}

/* ★ 차트~버튼 사이 배경 검정 */
.content, #page-chart, .chart-detail-container, .chart-glow-box, #chart-wrapper, #indicator-panels {
    background-color: #000000 !important;
}
