/* 공개 후기 전용 스타일시트 (reviews-public.css) - 배달왔삼 Teal 브랜드 테마 */

:root {
  --teal-main: #0F766E;
  --teal-light: #20B8AA;
  --teal-soft-bg: #F4F9F8;
  --teal-card-border: #E0EFEF;
  --warm-coral: #FF6B6B;
  --warm-red: #E53E3E;
  --warm-orange: #DD6B20;
  --teal: #0F766E;
  --orange: #EA6A17;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: clip;
}

.reviews-public-body {
  background-color: var(--teal-soft-bg);
  color: #172033;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  min-height: 100vh;
}

.public-reviews-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto; /* 중앙 정렬 */
  padding: 16px;
  padding-bottom: calc(112px + env(safe-area-inset-bottom)); /* 고정 풋터와 기기 안전 영역 */
  box-sizing: border-box;
}

.btn-back-link, .btn-apply-link {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.btn-back-link {
  color: #4A5568;
  background: #EDF2F7;
}

.btn-apply-link {
  color: #FFF;
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

/* 히어로 온기 마일스톤 카드 */
.warmth-hero-card {
  background: #FFFFFF;
  border: 2px solid var(--teal-card-border);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(15, 118, 110, 0.08);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  min-height: 236px; /* 로딩 흔들림 방지 */
}

.warmth-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cycle-badge-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cycle-badge {
  background: #EAF6F5;
  color: var(--teal-main);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px solid #CDE8E5;
}

.cycle-trees {
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 2px;
}

.warmth-temp-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.temp-label {
  font-size: 0.75rem;
  color: #718096;
}

/* 온도 수치 텍스트 및 구간별 자동 그래디언트 변환 */
.temp-value {
  font-size: 1.7rem;
  font-weight: 800;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 0.5s ease;
}

.temp-value.temp-level-0 {
  background: linear-gradient(135deg, #20B8AA, #DD6B20);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.temp-value.temp-level-1 {
  background: linear-gradient(135deg, #DD6B20, #D69E2E);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.temp-value.temp-level-2 {
  background: linear-gradient(135deg, #E53E3E, #FF6B6B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.temp-value.temp-level-3 {
  background: linear-gradient(135deg, #FF6B6B, #ED64A6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 달곰이 슬림 아바타 및 말풍선 캐릭터 */
.dalgom-milestone-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--teal-soft-bg);
  border: 1px solid #E2F0ED;
  padding: 10px 14px;
  border-radius: 18px;
  margin-bottom: 18px;
}

.dalgom-avatar {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dalgom-avatar-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.dalgom-speech-bubble {
  font-size: 0.9rem;
  color: #2D3748;
  font-weight: 600;
  line-height: 1.4;
}

/* 게이지 트랙 & 마일스톤 */
.warmth-gauge-container {
  margin-bottom: 4px;
}

.gauge-bar-track {
  height: 14px;
  background: #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.gauge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #20B8AA, #DD6B20);
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
}

.gauge-bar-fill.temp-level-0 {
  background: linear-gradient(90deg, #20B8AA, #DD6B20);
}

.gauge-bar-fill.temp-level-1 {
  background: linear-gradient(90deg, #DD6B20, #D69E2E);
}

.gauge-bar-fill.temp-level-2 {
  background: linear-gradient(90deg, #E53E3E, #FF6B6B);
}

.gauge-bar-fill.temp-level-3 {
  background: linear-gradient(90deg, #FF6B6B, #ED64A6);
}

.gauge-milestones {
  position: relative;
  height: 44px;
  margin-top: 8px;
}

.milestone-step {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72rem;
  color: #A0AEC0;
  transition: color 0.3s ease;
  transform: translateX(-50%);
}

.milestone-step.step-0 { left: 0; transform: none; align-items: flex-start; }
.milestone-step.step-1 { left: 36.5%; }
.milestone-step.step-2 { left: 50%; }
.milestone-step.step-3 { left: 75%; }
.milestone-step.step-4 { left: 100%; }

.milestone-step.is-reached {
  color: var(--warm-red);
  font-weight: 700;
}

.milestone-icon {
  font-size: 1.1rem;
  margin-bottom: 2px;
}

/* 후기 목록 섹션 */
.reviews-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.reviews-section-header h2 {
  font-size: 1.1rem;
  color: var(--teal-main);
  margin: 0;
  font-weight: 800;
}

.btn-refresh {
  background: #FFF;
  border: 1px solid var(--teal-card-border);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.82rem;
  color: var(--teal-main);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.reviews-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: #EAF6F5;
  border: 1px solid #CFE7E4;
  border-radius: 8px;
}

.review-filter-btn {
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  color: #60748A;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.review-filter-btn strong {
  min-width: 24px;
  padding: 2px 6px;
  color: #58706D;
  font-size: 0.72rem;
  line-height: 1.3;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
}

.review-filter-btn.active {
  color: var(--teal-main);
  background: #FFFFFF;
  box-shadow: 0 2px 7px rgba(15, 118, 110, 0.12);
}

.review-filter-btn.active strong {
  color: #FFFFFF;
  background: var(--teal-main);
}

.review-filter-btn:focus-visible,
.reviews-load-more:focus-visible {
  outline: 3px solid rgba(32, 184, 170, 0.3);
  outline-offset: 2px;
}

.reviews-visible-status {
  margin: 8px 2px 16px;
  color: #718096;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: right;
}

.state-message {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
  font-size: 0.95rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #E0EFEF;
  border-top: 3px solid var(--teal-main);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 바둑판식 2열 고정 및 반응형 그리드 레이아웃 */
.public-reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2열 고정 */
  gap: 16px;
  align-items: start;
  width: 100%;
}

/* 모바일 화면(540px 미만)에서는 1열 처리 */
@media (max-width: 540px) {
  .public-reviews-grid {
    grid-template-columns: 1fr;
  }
}

.public-review-card {
  background: #FFF;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(15, 118, 110, 0.04);
  border: 1px solid var(--teal-card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
}

.public-review-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.1);
}

.review-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.review-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-user-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #2D3748;
}

.review-stamp-tag {
  background: #FFF5F5;
  color: var(--warm-red);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 8px;
  display: inline-block;
}

/* 달곰이 이모티콘 스탬프 뱃지 */
.review-stamp-dalgom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFF0F0;
  border: 1px solid #FFD8D8;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--warm-red);
  margin-bottom: 8px;
  align-self: flex-start;
}

.review-stamp-dalgom img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.review-date {
  font-size: 0.73rem;
  color: #A0AEC0;
}

.review-tags-box {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.review-tag-badge {
  background: #EAF6F5;
  color: var(--teal-main);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
}

.review-tag-more {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  color: #68778A;
  font-size: 0.72rem;
  font-weight: 750;
  background: #F0F3F6;
  border-radius: 8px;
}

.review-content {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.review-content:empty { display: none; }

.review-image-box {
  margin-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
}

.review-image-box img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

/* 관리자 따뜻한 답글 영역 */
.review-reply-box {
  background: #FFFDF9;
  border-left: 3px solid var(--warm-orange);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 2px;
}

.reviews-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.reviews-load-more {
  min-width: 220px;
  min-height: 46px;
  padding: 10px 22px;
  color: var(--teal-main);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  background: #FFFFFF;
  border: 1.5px solid #BFDCD8;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.06);
  cursor: pointer;
}

.reviews-load-more[hidden] { display: none; }

.reply-header {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--warm-orange);
  margin-bottom: 4px;
}

.reply-content {
  font-size: 0.83rem;
  color: #4A5568;
  line-height: 1.4;
}

/* 하단 고정 풋터 (중앙 정렬 완벽 보정) */
.public-reviews-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 100%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--teal-card-border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  justify-content: center;
  box-sizing: border-box;
  z-index: 100;
}

.footer-btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 8px;
  border-radius: 14px;
  transition: all 0.2s ease;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.footer-btn.primary {
  background: linear-gradient(135deg, #FF6B6B, var(--warm-red));
  color: #FFF;
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.25);
}

.footer-btn.secondary {
  background: #FFF;
  color: var(--teal-main);
  border: 1.5px solid var(--teal-main);
}

/* 로딩 흔들림 방지 */
.reviews-grid-section {
  min-height: 480px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

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

.skeleton-card {
  height: 200px;
  background: linear-gradient(90deg, #F0F4F4 25%, #E2ECEB 50%, #F0F4F4 75%);
  background-size: 200% 100%;
  animation: loadingSkeleton 1.5s infinite;
  border-radius: 18px;
  border: 1px solid var(--teal-card-border);
}

@keyframes loadingSkeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 340px) {
  .cycle-badge {
    padding: 6px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .cycle-badge-wrapper { gap: 5px; }
  .cycle-trees { font-size: 1rem; letter-spacing: 0; }
  .milestone-step.step-1,
  .milestone-step.step-3 { display: none; }
  .review-filter-btn { gap: 4px; padding-inline: 6px; }
  .review-filter-btn strong { min-width: 21px; padding-inline: 5px; }
  .footer-btn { font-size: 0.82rem; }
}
