/* ========== 인기템 탭 v2 ========== */

.trend-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; padding: 20px 16px 12px; text-align: center;
}
.trend-header h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; text-align: center; }
.trend-header p { font-size: 13px; opacity: 0.85; }

/* TOP3 캐러셀 */
.trend-top3 {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px; padding: 0 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.trend-top-card {
    background: rgba(255,255,255,0.15); backdrop-filter: blur(10px);
    border-radius: 16px; padding: 16px 14px; text-align: center;
    cursor: pointer; transition: transform 0.2s; color: white;
    border: 1px solid rgba(255,255,255,0.2);
}
.trend-top-card:active { transform: scale(0.96); }
.trend-top-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(255,255,255,0.3); font-size: 12px; font-weight: 800;
    margin-bottom: 8px;
}
.trend-top-emoji { font-size: 36px; margin-bottom: 6px; }
.trend-top-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.trend-top-meta { font-size: 11px; opacity: 0.8; }

/* 섹션 타이틀 */
.trend-section {
    padding: 20px 16px 8px;
    font-size: 16px; font-weight: 800; color: var(--text);
    display: flex; align-items: center; gap: 6px;
}

/* 리스트 카드 */
.trend-card-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 8px; padding: 0 12px;
}
.trend-card {
    display: flex; align-items: center;
    padding: 10px 12px; margin: 0 0 4px;
    background: var(--card); border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    cursor: pointer; transition: all 0.15s;
}
.trend-card:active { transform: scale(0.98); }
.trend-card-rank {
    width: 22px; height: 22px; border-radius: 50%;
    font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin-right: 10px; flex-shrink: 0; color: white;
}
.trend-card-rank.r1 { background: linear-gradient(135deg, #FFD700, #FFA500); }
.trend-card-rank.r2 { background: linear-gradient(135deg, #C0C0C0, #A0A0A0); }
.trend-card-rank.r3 { background: linear-gradient(135deg, #CD7F32, #A0522D); }
.trend-card-rank.r4 { background: var(--border); color: var(--text2); }
.trend-card-emoji { font-size: 22px; margin-right: 10px; flex-shrink: 0; }
.trend-card-info { flex: 1; min-width: 0; }
.trend-card-name { font-size: 13px; font-weight: 700; margin-bottom: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-card-desc { font-size: 11px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-card-meta { font-size: 10px; color: #667eea; font-weight: 600; margin-top: 1px; }
.trend-card-arrow { font-size: 16px; color: var(--text2); margin-left: 6px; }

.trend-empty {
    text-align: center; padding: 40px; color: var(--text2); font-size: 15px;
}

.trend-report-btn {
    text-align: center; padding: 14px; margin: 16px 12px;
    border-radius: 14px; border: 2px dashed var(--border);
    color: var(--text2); font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.trend-report-btn:active { border-color: #667eea; color: #667eea; }

/* 상세 페이지 */
.trend-back {
    padding: 12px 16px; font-size: 15px;
    color: #667eea; cursor: pointer; font-weight: 600;
}
.trend-detail-header { text-align: center; padding: 8px 16px 16px; }
.trend-detail-emoji { font-size: 48px; }
.trend-detail-header h2 { font-size: 22px; margin: 8px 0 4px; }
.trend-detail-header p { font-size: 14px; color: var(--text2); }
.trend-tags { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.trend-tag { padding: 3px 10px; border-radius: 12px; background: rgba(102,126,234,0.08); color: #667eea; font-size: 12px; }

.trend-map-btn {
    display: block; width: calc(100% - 32px); margin: 0 16px 16px; padding: 12px;
    border-radius: 12px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; border: none; font-size: 15px; font-weight: 600; cursor: pointer;
}
.trend-add-shop-btn {
    display: block; width: calc(100% - 32px); margin: 0 16px 12px; padding: 11px;
    border-radius: 12px; border: 2px dashed #667eea; background: rgba(102,126,234,0.05);
    color: #667eea; font-size: 14px; font-weight: 600; cursor: pointer;
}
.trend-shop-card {
    display: flex; align-items: center; padding: 14px 16px;
    margin: 0 12px 8px; background: var(--card); border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    cursor: pointer; user-select: none; -webkit-user-select: none;
}
.trend-shop-card:active { opacity: 0.7; }
.trend-shop-rank {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(102,126,234,0.08); color: #667eea;
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px; flex-shrink: 0;
}
.trend-shop-info { flex: 1; min-width: 0; }
.trend-shop-name { font-size: 15px; font-weight: 600; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-shop-addr { font-size: 12px; color: var(--text2); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-shop-price { font-size: 13px; color: var(--text); font-weight: 600; }
.trend-shop-actions { display: flex; gap: 4px; flex-shrink: 0; }
.trend-action-btn {
    width: 32px; height: 32px; border-radius: 50%;
    border: 1.5px solid var(--border); background: var(--card); cursor: pointer;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.trend-action-btn:active { border-color: #667eea; background: rgba(102,126,234,0.08); }

/* ========== 아이템 제보 모달 ========== */

.report-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2000;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: background 0.3s;
}
.report-overlay.show {
    background: rgba(0,0,0,0.5);
}

.report-sheet {
    width: 100%;
    max-width: min(92vw, 640px);
    max-height: 85vh;
    background: var(--card);
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 16px);
}
.report-overlay.show .report-sheet {
    transform: translateY(0);
}

.report-header {
    position: sticky;
    top: 0;
    background: var(--card);
    padding: 20px 20px 12px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    z-index: 1;
}
.report-header h3 {
    font-size: 20px;
    margin: 0 0 4px;
}
.report-header p {
    font-size: 13px;
    color: var(--text2);
    margin: 0;
}
.report-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text2);
    cursor: pointer;
}
.report-close:hover {
    background: #e0e0e0;
}

.report-form {
    padding: 16px 20px 20px;
}

.report-field {
    margin-bottom: 14px;
}
.report-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.report-field .required {
    color: #ff4757;
}

.report-field input[type="text"],
.report-field input[type="number"],
.report-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.report-field input:focus,
.report-field select:focus {
    border-color: #667eea;
}
.report-field input::placeholder {
    color: #bbb;
}

.report-field-row {
    display: flex;
    gap: 10px;
}
.report-field.half {
    flex: 1;
}

.report-divider {
    height: 1px;
    background: var(--input-bg);
    margin: 18px 0;
}

.report-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

/* 상품권 라디오 버튼 */
.report-voucher-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.voucher-radio {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.voucher-radio:has(input:checked) {
    border-color: #667eea;
    background: rgba(102,126,234,0.08);
}
.voucher-radio.local:has(input:checked) {
    border-color: #f0ad4e;
    background: #fef8ec;
}
.voucher-radio.onnuri:has(input:checked) {
    border-color: #5cb85c;
    background: #eef8ee;
}
.voucher-radio input[type="radio"] {
    display: none;
}

/* 제출 버튼 */
.report-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}
.report-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.report-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Store autocomplete in report */
.report-store-results { display:none; position:absolute; left:0; right:0; top:100%; background: var(--card); border:1px solid var(--border); border-radius:0 0 10px 10px; max-height:200px; overflow-y:auto; z-index:100; box-shadow:0 4px 12px rgba(0,0,0,0.1); }
.report-store-item { padding:10px 12px; font-size:13px; cursor:pointer; border-bottom:1px solid #f5f5f5; }
.report-store-item:active { background:rgba(102,126,234,0.08); }
/* ========== 트렌딩 개선 ========== */
.trend-filter-chips {
    display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.trend-filter-chips::-webkit-scrollbar { display: none; }
.trend-filter-chip {
    padding: 8px 14px; border-radius: 20px; border: 1.5px solid var(--border);
    background: var(--card); font-size: 12px; font-weight: 600; cursor: pointer;
    white-space: nowrap; flex-shrink: 0; transition: all 0.2s; color: var(--text2);
}
.trend-filter-chip.active { background: #667eea; color: white; border-color: #667eea; }

.trend-skeleton-card {
    background: var(--border); border-radius: 12px; min-width: 140px; height: 140px;
    flex-shrink: 0; animation: trendSkeletonPulse 1.5s infinite;
}
.trend-skeleton-list {
    display: flex; gap: 10px; align-items: center; padding: 12px;
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: 8px;
}
.trend-skeleton-list .sk-circle { width: 40px; height: 40px; border-radius: 10px; background: var(--border); flex-shrink: 0; animation: trendSkeletonPulse 1.5s infinite; }
.trend-skeleton-list .sk-lines { flex: 1; }
.trend-skeleton-list .sk-line { height: 12px; background: var(--border); border-radius: 4px; margin-bottom: 6px; animation: trendSkeletonPulse 1.5s infinite; }
.trend-skeleton-list .sk-line:last-child { width: 60%; margin-bottom: 0; }
@keyframes trendSkeletonPulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* 트렌딩 카드 애니메이션 */
.trend-card { animation: trendCardIn 0.3s ease; }
@keyframes trendCardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 트렌딩 검색 */
.trend-search-wrap { padding: 8px 16px; }
.trend-search-input {
    width: 100%; padding: 10px 36px 10px 14px; border: 1.5px solid var(--border);
    border-radius: 10px; background: var(--card); color: var(--text);
    font-size: 14px; outline: none; box-sizing: border-box;
}
.trend-search-input:focus { border-color: #667eea; }
.trend-search-input::placeholder { color: var(--text2); }
