/* ==========================================================================
   Search & Palette Styles
   - 검색 입력 래퍼
   - 팔레트 윈도우
   - 코인 정보 표시
   - OHLCV 표시
   ========================================================================== */

/* 검색 입력 래퍼 */
.search-input-wrapper { 
    position: relative; 
}

#clear-search-btn { 
    position: absolute; 
    right: 0.5rem; 
    top: 50%; 
    transform: translateY(-50%); 
    display: none; 
    background: transparent; 
    border: none; 
    cursor: pointer; 
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.2s;
    width: 24px;
    height: 24px;
    font-size: 12px;
    color: #6c757d;
}

#clear-search-btn:hover {
    background-color: rgba(0,0,0,0.1);
}

#clear-search-btn::before {
    content: "✕";
    display: block;
    line-height: 1;
}

/* 팔레트 윈도우 */
.palette-window {
    position: fixed; 
    background-color: white; 
    border: 1px solid #dee2e6;
    border-radius: 0.5rem; 
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    width: min(500px, 92vw);
    display: none;
    flex-direction: column;
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: calc(100vh - 96px);
}

.palette-window.visible { 
    display: flex; 
}

.palette-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1rem; 
    border-bottom: 1px solid #dee2e6; 
    cursor: move; 
    flex: 0 0 auto;
}

.palette-header h5 { 
    margin-bottom: 0; 
    font-size: 1.25rem; 
}

.palette-content { 
    padding: 1rem; 
    max-height: none; 
    min-height: 0; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
}

.palette-footer { 
    padding: 0.75rem 1rem; 
    border-top: 1px solid #dee2e6; 
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 0 0 auto;
    /* iOS safe-area + 모바일 하단 영역 여유 */
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

/* 모바일: 화면에 맞게 팔레트 크기/위치 안정화 */
@media (max-width: 991.98px) {
    .palette-window {
        width: 94vw;
        max-height: calc(100vh - 72px);
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .palette-content {
        padding: 0.75rem 1rem;
    }
}

/* 코인 정보 표시 */
#coin-info-display { 
    line-height: 1.2; 
    width: 200px; 
    min-width: 200px; 
    flex-shrink: 0; 
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
}

#coin-info-display .coin-korean-name { 
    font-size: 1.5em; 
    font-weight: 700; 
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#coin-info-display .coin-market-symbol { 
    font-size: 0.9em; 
    font-weight: 500; 
    color: #555; 
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#coin-info-display .news-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

/* OHLCV 표시 */
#ohlcv-display { 
    font-size: 0.9em; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    min-height: 21px;
}

#ohlcv-display .ohlcv-item { 
    display: inline-flex; 
    align-items: center; 
    gap: 4px; 
    min-width: 100px;
}

#ohlcv-display .ohlcv-label { 
    font-weight: 600; 
    color: #555; 
}

