/* 모바일 UX 최적화 공통 CSS */

/* 0️⃣ 모바일 최적화 기본 원칙 */

/* 툴바: 1줄 유지 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: white;
    border-bottom: 1px solid var(--border);
}

/* 칩 컨테이너: 가로 스크롤 */
.chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 4px 8px;  /* 6px 12px → 4px 8px (공간 절약) */
    border: 1px solid var(--border);
    border-radius: 6px;  /* 16px → 6px (모던 + 효율) */
    white-space: nowrap;
    cursor: pointer;
    background: white;
    font-size: 0.85rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chip:hover {
    background: var(--bg-hover);
}

.chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 모바일에서 텍스트 라벨 숨김 */
.hide-xs {
    display: inline;
}

@media (max-width: 420px) {
    .hide-xs {
        display: none !important;
    }
    
    /* 토글 버튼 모바일 최적화 */
    .toggle-btn {
        min-width: 44px !important;
        padding: 0.5rem 0.75rem !important;
    }
}

/* 폼 레이아웃: 모바일 1열, PC 2열 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* 터치 영역: 최소 44px */
.btn, .chip, .nav-item {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 모바일 Fullscreen 모달 */
@media (max-width: 768px) {
    .modal-overlay {
        z-index: 2000;
    }
    
    .modal-content.fullscreen-mobile {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
}

/* 하단 고정 바 */
.bottom-fixed-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 12px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    z-index: 100;
}

@media (max-width: 768px) {
    .bottom-fixed-bar {
        position: fixed;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* 카드 목록: 모바일 1열 */
.card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
}

@media (min-width: 900px) {
    .card-list.two-column {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 아이콘 버튼 */
.btn-icon-only {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
}

/* 검색 바 */
.search-bar {
    flex: 1;
    position: relative;
    min-width: 0;
}

.search-bar input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* 더보기 메뉴 */
.more-menu {
    position: relative;
}

.more-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 1000;
    display: none;
}

.more-menu-dropdown.show {
    display: block;
}

.more-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.more-menu-item:hover {
    background: var(--bg-hover);
}

.more-menu-item.danger {
    color: var(--danger);
}

.more-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}
