/* 추천 결과 모달 및 추천 카드 스타일 */

/* ── 모달 배경 ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: backdropIn 0.2s ease;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── 모달 패널 ── */
.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.25s ease;
}

.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ── 닫기 버튼 ── */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 1;
}

.modal-close:hover {
  background: var(--color-border);
}

/* ── 모달 헤더 ── */
.modal-header {
  padding: 1.5rem 1.5rem 0.75rem;
  text-align: center;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ── 모달 본문 ── */
.modal-body {
  padding: 0.5rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── 추천 카드 ── */
.rec-card {
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  border: 1.5px solid var(--color-border);
  transition: transform 0.15s, box-shadow 0.15s;
}

.rec-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 1위: 금 */
.rec-card--1 {
  border-color: #F0C040;
  background: linear-gradient(135deg, #FFFEF0 0%, #FFFAE0 100%);
}

/* 2위: 은 */
.rec-card--2 {
  border-color: #C0C0C0;
  background: linear-gradient(135deg, #FAFAFA 0%, #F4F4F4 100%);
}

/* 3위: 동 */
.rec-card--3 {
  border-color: #C87941;
  background: linear-gradient(135deg, #FDF8F4 0%, #F9F0E8 100%);
}

/* ── 순위 뱃지 ── */
.rec-card__rank {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 800;
}

.rec-card--1 .rec-card__rank { background: #F0C040; color: #6B4F00; }
.rec-card--2 .rec-card__rank { background: #C0C0C0; color: #3D3D3D; }
.rec-card--3 .rec-card__rank { background: #C87941; color: #fff; }

/* ── 카드 콘텐츠 ── */
.rec-card__content {
  flex: 1;
  min-width: 0;
}

.rec-card__name {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-card__category {
  font-size: 0.775rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.rec-card__rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 6px;
}

.rec-card__stars {
  font-size: 0.875rem;
  color: var(--color-star);
  font-weight: 700;
}

.rec-card__review-count {
  font-size: 0.775rem;
  color: var(--color-text-muted);
}

.rec-card__distance {
  font-size: 0.775rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.rec-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rec-card__link {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: white;
  font-size: 0.775rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.rec-card__link:hover {
  background: var(--color-primary-dark);
}

.rec-card__score {
  font-size: 0.7rem;
  color: #9CA3AF;
  font-style: italic;
}

/* ── 모바일 ── */
@media (max-width: 480px) {
  .modal {
    max-height: 92vh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
}
