/* food_explorer.css - 사료 탐색기 통합 스타일 */

/* ==========================================================================
   1. 검색 헤더
   ========================================================================== */
.search-header-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-bar-styled {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 14px;
    height: 48px;
    transition: all 0.2s;
}

.search-bar-styled:focus-within {
    border-color: #406CB4;
    box-shadow: 0 0 0 3px rgba(64, 108, 180, 0.1);
}

.search-input-reset {
    border: none;
    outline: none;
    width: 100%;
    font-size: 15px;
    background: transparent;
}

.filter-toggle-btn {
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.filter-toggle-btn.active {
    background: #406CB4 !important;
    color: #fff !important;
    border-color: #406CB4 !important;
}

/* ==========================================================================
   2. 필터 패널
   ========================================================================== */
#advancedFilterPanel {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    display: none;
    animation: slideDown 0.3s ease;
}

#advancedFilterPanel.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media(max-width:600px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

.drawer-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
}

.disease-select {
    border-color: #406CB4 !important;
    color: #406CB4 !important;
    font-weight: 600 !important;
}

.range-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.range-separator {
    color: #999;
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 0;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #406CB4;
}

.checkbox-text {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.filter-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.filter-actions .btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-primary {
    background: #406CB4;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: #355a96;
}

/* ==========================================================================
   3. 정렬 섹션
   ========================================================================== */
.sort-section {
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.sort-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sort-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.order-select {
    padding: 6px 12px;
    font-size: 13px;
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
}

/* 정렬 칩 */
.scroll-chip-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 8px 2px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-chip-container::-webkit-scrollbar {
    display: none;
}

.sort-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 99px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sort-chip:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

.sort-chip.active {
    background: #406CB4;
    border-color: #406CB4;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(64, 108, 180, 0.3);
}

/* ==========================================================================
   4. 결과 영역
   ========================================================================== */
.result-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 0 4px;
}

#resultCount {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.current-metric {
    font-size: 12px;
    color: #406CB4;
    font-weight: 600;
    background: #eff6ff;
    padding: 4px 10px;
    border-radius: 6px;
}

@media(max-width:768px) {
    .result-meta-bar {
        margin-left: 15px;
        margin-right: 15px;
    }
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #e2e8f0;
}

.empty-state p {
    font-size: 15px;
    font-weight: 500;
}

/* ==========================================================================
   5. 결과 카드 (랭킹 스타일)
   ========================================================================== */
.result-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    gap: 16px;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

@media(max-width:768px) {
    .result-card {
        margin-left: 15px;
        margin-right: 15px;
    }
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #406CB4;
}

/* 썸네일 */
.result-thumb {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    background: #f1f5f9;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f1f5f9;
}

.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-thumb .no-img {
    font-size: 24px;
    color: #cbd5e1;
}

/* 정보 영역 */
.result-info {
    flex: 1;
    min-width: 0;
}

.result-brand {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 2px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-name {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 뱃지 */
.result-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.badge-metric {
    background: #eff6ff;
    color: #406CB4;
    font-weight: 800;
    border: 1px solid #dbeafe;
}

.badge-kcal {
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.badge-verified {
    background: #dcfce7;
    color: #166534;
    font-size: 10px;
}

.badge-category {
    background: #f3f4f6;
    color: #4b5563;
}

.badge-source {
    background: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    font-size: 10px;
}

/* ==========================================================================
   6. 버튼 & 기타
   ========================================================================== */
.full-width {
    width: 100%;
}

.pagination {
    margin: 20px 0;
}

@media(max-width:768px) {
    .pagination {
        margin-left: 15px;
        margin-right: 15px;
    }
}

/* 로딩 상태 */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.loading-state i {
    font-size: 32px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}