/**
 * Search Component Styles
 * 검색 컴포넌트 전용 스타일 - 테마 전반에서 사용 가능
 */

/* ===========================================
   기본 검색 박스
   =========================================== */
.search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-box .search-input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--theme-item-border);
    border-radius: var(--theme-input-radius);
    background: #fff;
    font-size: var(--theme-font-size-button);
    font-family: var(--theme-font-normal);
    color: var(--theme-text-color);
    outline: none;
    transition: all 0.2s ease;
    min-width: 180px;
}

.search-box .search-input:focus {
    border-color: var(--theme-main-color);
    box-shadow: 0 0 0 2px rgba(64, 128, 144, 0.1);
}

.search-box .search-input::placeholder {
    color: var(--theme-hint-text-color);
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme-hint-text-color);
    font-size: 14px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 검색 아이콘 SVG */
.search-box .search-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 검색 클리어 버튼 */
.search-box .search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--theme-hint-text-color);
    cursor: pointer;
    font-size: var(--theme-font-size-icon-small);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-box .search-clear:hover {
    background: #f0f0f0;
    color: var(--theme-text-color);
}

.search-box.has-value .search-clear {
    display: flex;
}

.search-box.has-value .search-input {
    padding-right: 32px;
}

/* ===========================================
   검색 박스 사이즈 변형
   =========================================== */

/* Large 검색 박스 */
.search-box-lg .search-input {
    padding: 12px 16px 12px 44px;
    font-size: var(--theme-font-size-body);
    min-width: 240px;
}

.search-box-lg .search-icon {
    left: 16px;
    font-size: 16px;
}

.search-box-lg .search-icon svg {
    width: 16px;
    height: 16px;
}

/* ===========================================
   검색 박스 스타일 변형
   =========================================== */

/* Rounded 검색 박스 */
.search-box-rounded .search-input {
    border-radius: 20px;
}

/* Borderless 검색 박스 */
.search-box-borderless .search-input {
    border: none;
    background: var(--theme-info-bg);
}

.search-box-borderless .search-input:focus {
    box-shadow: none;
    background: #e8f4f8;
}

/* Full width 검색 박스 */
.search-box-full {
    width: 100%;
}

.search-box-full .search-input {
    width: 100%;
    min-width: unset;
}

/* ===========================================
   검색 결과 하이라이트
   =========================================== */
.search-highlight {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

/* ===========================================
   검색 상태 표시
   =========================================== */
.search-box.searching .search-icon {
    animation: search-spin 1s linear infinite;
}

@keyframes search-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* 검색 결과 없음 상태 */
.search-box.no-results .search-input {
    border-color: var(--theme-warning-color, #ffc107);
}

/* ===========================================
   반응형 디자인
   =========================================== */
@media (max-width: 768px) {
    .search-box .search-input {
        min-width: 120px;
    }

    .search-box-lg .search-input {
        min-width: 180px;
    }
}
