/* ============================================
   mobile.css - 검색/GPS만 담당
   list.css - 매물 목록 패널 담당
   ============================================ */

/* 통합 검색창 (모바일 기본 + 자동 반응형) */
.search-bar-container {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 150px;
    z-index: 1000;
}

.search-bar {
    background: white;
    border:#dbdbdb 0.5px solid;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.unified-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.unified-search-input::placeholder {
    color: #999;
}

/* 관심목록 버튼 */
.interest-list-btn {
    /* 1. 화면 배치 */
    position: fixed;
    top: 10px;
    right: 95px;
    z-index: 1001;

    /* 2. 버튼 스타일 */
    width: 50px;
    
    /* ✅ 높이를 강제로 43px로 고정 */
    height: 43px;
    
    /* ✅ 테두리 포함해서 높이 계산 (필수) */
    box-sizing: border-box;
    
    background: white;
    border: rgb(0, 170, 130) 1px solid;
    border-radius: 6px;
    color: #333;
    
    /* ✅ 높이를 고정했으므로 패딩은 0으로 */
    padding: 0;
    
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;

    /* 3. 내부 레이아웃 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 텍스트 스타일 (기존 유지) */
.interest-btn-text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    font-size: 13px;
    font-weight: 600;
    color: rgb(0, 140, 120);
    text-align: center;
}

.interest-btn-text span {
    display: block;
}

.interest-list-btn:active {
    background: #f5f5f5;
    transform: scale(0.98);
}

/* 검색 페이지 */
.search-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.search-page.active {
    transform: translateY(0);
}

.search-page-header {
    display: flex;
    align-items: center;
    padding: clamp(10px, 3vw, 14px);
    border-bottom: 1px solid #e0e0e0;
}

.back-btn {
    background: none;
    border: none;
    font-size: clamp(20px, 6vw, 26px);
    padding: 8px;
    cursor: pointer;
    color: #333;
}

.search-page-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: clamp(6px, 2vw, 10px);
    padding: clamp(6px, 2vw, 10px) clamp(10px, 3vw, 14px);
    margin-left: 8px;
}

.search-page-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: clamp(14px, 4vw, 16px);
    margin-left: 8px;
}

.search-page-content {
    flex: 1;
    overflow-y: auto;
    padding: clamp(12px, 4vw, 20px);
}

.search-recent h3 {
    font-size: clamp(13px, 3.5vw, 15px);
    color: #666;
    margin-bottom: 12px;
}

#recentSearches {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(6px, 2vw, 10px);
    margin-bottom: 24px;
}

.recent-item {
    background: #f5f5f5;
    padding: clamp(6px, 2vw, 10px) clamp(10px, 3vw, 14px);
    border-radius: clamp(12px, 4vw, 18px);
    font-size: clamp(13px, 3.5vw, 15px);
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.recent-item:active {
    background: #e0e0e0;
}

.search-results {
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: clamp(12px, 4vw, 18px) 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.search-result-item:active {
    background: #f9f9f9;
}

.search-result-title {
    font-size: clamp(15px, 4vw, 17px);
    color: #333;
    margin-bottom: 4px;
}

.search-result-address {
    font-size: clamp(13px, 3.5vw, 15px);
    color: #666;
}

/* GPS 버튼 (모바일 기본 + 자동 반응형) */
.gps-floating-btn {
    position: fixed;
    bottom: 280px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgb(255, 255, 255);
    border: 0.5px solid #c4c4c4;
    border-radius: 15%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gps-floating-btn svg {
    width: clamp(18px, 6vw, 24px);
    height: clamp(18px, 6vw, 24px);
}

/* ✅ 매물종류 선택박스 - "무보증/단기" 크기에 맞춰 고정 */
.property-type-selector {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgb(0, 170, 140);
    border: rgb(0, 160, 130) 1px solid;
    color: white;
    border-radius: 6px;
    padding: 10px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    z-index: 1001;
    width: 80px; /* ✅ 고정 너비 (무보증/단기 크기에 맞춤) */
    justify-content: center;
    text-align: center;
}

.property-type-text {
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}

.property-type-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.property-type-selector.active .property-type-arrow {
    transform: rotate(180deg);
}

/* ✅ 매물종류 선택 모달 */
.property-type-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(0px);
}

.property-type-modal.active {
    display: flex;
}

.property-type-modal-content {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 90vw;
    animation: modalSlideIn 0.3s ease;
    position: relative;
}

/* ✅ X 버튼 추가 */
.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-close-btn:active {
    transform: scale(0.9);
}

/* ✅ 모달 제목 */
.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 0px; /* 줄임 */
    padding-bottom: 0; /* 제거 */
    border-bottom: none; /* 제거 */
}

/* ✅ 모달 부제목 (중복 선택 가능) */
.modal-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: #999;
    text-align: center;
    margin-top: 0; /* 수정 */
    margin-bottom: 14px;
    padding-bottom: 8px; /* 추가 */
    border-bottom: 1px solid #e5e7eb; /* 추가 */
}

/* ✅ 매물종류 행 */
.property-type-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    justify-content: center;
}

.property-type-row:last-child {
    margin-bottom: 0;
}

/* ✅ 매물종류 옵션 버튼 */
.property-type-option {
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    min-width: 60px;
    flex: 1;
    max-width: 80px;

    /* ✅ 완벽한 가운데 정렬을 위한 flex 속성 추가 */
    display: flex;
    justify-content: center; /* 가로 중앙 정렬 */
    align-items: center;     /* 세로 중앙 정렬 */
}

/* ✅ 선택된 옵션 스타일 */
.property-type-option.selected {
    background: linear-gradient(135deg, rgb(0,160,140), rgb(10,170,150));
    color: white;
    border-color: rgb(0,150,120);
}

.option-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;

    /* ✅ 추가 정렬 보장 */
    text-align: center;
}

.property-type-option.selected .option-text {
    color: white;
    font-weight: 600;
}

/* ✅ "무보증/단기" 텍스트만 자간 줄이기 */
.property-type-option[data-category="92"] .option-text {
    letter-spacing: -0.5px;
    font-size: 13px;
}

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

.property-type-option:last-child {
    margin-bottom: 0;
}

/* ✅ 매물 없음 안내 토스트 */
.no-properties-toast {
    position: fixed;
    top: 85%;
    left: 15%;
    right: 15%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    z-index: 2000;
    animation: toastFadeInOut 1.5s ease-in-out;
    pointer-events: none;
}

/* ✅ 매물이 없을 때 드래그 패널 비활성화 */
.list-panel.disabled {
    pointer-events: auto; /* ✅ 클릭 이벤트는 받되 */
}

.list-panel.disabled .list-header {
    cursor: not-allowed;
    background: #ffffff;
}

/* ✅ 0개 매물일 때 글자 색상 변경 */
.list-panel.disabled .list-count {
    color: #999 !important;  /* 회색으로 변경 */
    font-weight: normal;      /* 굵기 줄임 */
}

/* ✅ 0개 매물일 때 전체 텍스트 색상 변경 */
.list-panel.disabled .list-title {
    color: #999 !important;  /* 전체 텍스트 회색으로 */
}