/* ═══════════════════════════════════════════
   WRITE-REVIEW.CSS — Write a Review page
   Vietnam City Breaks
   ═══════════════════════════════════════════ */

/* ── Breadcrumb ── */
.wr-breadcrumb {
  background: white;
  border-bottom: 1px solid var(--border);
}
.wr-breadcrumb .breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: .65rem 0;
  font-size: .82rem;
  color: var(--text-m);
}
.wr-breadcrumb .breadcrumb-list li:not(:last-child)::after {
  content: '/';
  margin: 0 .45rem;
  color: var(--border);
}
.wr-breadcrumb .breadcrumb-list a {
  color: var(--text-m);
  text-decoration: none;
}
.wr-breadcrumb .breadcrumb-list a:hover { color: var(--primary); }
.wr-breadcrumb .breadcrumb-list li:last-child { color: var(--text-h); font-weight: 600; }

/* ── Page wrap ── */
.wr-wrap {
  background: var(--bg-soft);
  padding: 2.5rem 0 4rem;
  min-height: 60vh;
}

/* ── Layout: form + sidebar ── */
.wr-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .wr-layout { grid-template-columns: 1fr; }
  .wr-sidebar { order: -1; }
}

/* ── Form panel ── */
.wr-form-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

/* ── Page heading ── */
.wr-page-head { margin-bottom: 1.5rem; }
.wr-title {
  font-family: var(--fh);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-h);
  margin: 0 0 .35rem;
}
.wr-subtitle {
  font-size: .92rem;
  color: var(--text-m);
  margin: 0;
}

/* ── Tour badge ── */
.wr-tour-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  padding: .45rem .85rem;
  font-family: var(--fh);
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
}

/* ── Form fields ── */
.wr-form { display: flex; flex-direction: column; gap: 1.25rem; }
.wr-field { display: flex; flex-direction: column; gap: .35rem; position: relative; }
.wr-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) { .wr-field-row { grid-template-columns: 1fr; } }

.wr-label {
  font-family: var(--fh);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-h);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.wr-req { color: var(--primary); }
.wr-opt { font-weight: 400; color: var(--text-m); text-transform: none; letter-spacing: 0; font-size: .75rem; }

.wr-input,
.wr-select,
.wr-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .65rem .9rem;
  font-family: var(--fb);
  font-size: .9rem;
  color: var(--text-h);
  background: white;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.wr-input:focus,
.wr-select:focus,
.wr-textarea:focus { border-color: var(--primary); }
.wr-input.invalid,
.wr-select.invalid,
.wr-textarea.invalid { border-color: #dc2626; }
.wr-textarea { resize: vertical; line-height: 1.6; }
.wr-textarea-sm { min-height: 80px; }

.wr-counter {
  font-size: .72rem;
  color: var(--text-m);
  text-align: right;
  margin-top: .15rem;
}
.wr-hint {
  font-size: .78rem;
  color: var(--text-m);
  margin: .2rem 0 0;
  line-height: 1.5;
}

/* ── Star rating selector ── */
.wr-field-rating { gap: .5rem; }
.wr-stars {
  display: flex;
  gap: .2rem;
}
.wr-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 2.4rem;
  color: var(--border);
  padding: 0 .1rem;
  line-height: 1;
  transition: color .15s, transform .15s;
}
.wr-star:hover,
.wr-star.active { color: var(--star); }
.wr-star:hover { transform: scale(1.15); }
.wr-stars-invalid .wr-star { color: #dc2626; animation: wrStarShake .35s ease; }
@keyframes wrStarShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.wr-star-label {
  font-size: .82rem;
  color: var(--text-m);
  font-style: italic;
  margin-top: .1rem;
}

/* ── Divider ── */
.wr-divider {
  font-family: var(--fh);
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-m);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  margin-top: .25rem;
}

/* ── Error ── */
.wr-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .88rem;
  color: #dc2626;
}

/* ── Submit button ── */
.wr-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  padding: .9rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: var(--fh);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, opacity .2s;
  margin-top: .25rem;
}
.wr-submit:hover { background: var(--primary-dark); }
.wr-submit:disabled { opacity: .6; cursor: not-allowed; }

.wr-policy {
  font-size: .76rem;
  color: var(--text-m);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

/* ── Thank you panel ── */
.wr-thankyou {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
}
.wr-ty-icon { margin-bottom: 1.25rem; }
.wr-ty-title {
  font-family: var(--fh);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-h);
  margin: 0 0 .75rem;
}
.wr-ty-body {
  font-size: .95rem;
  color: var(--text-b);
  line-height: 1.65;
  max-width: 460px;
  margin: 0 auto 1.75rem;
}
.wr-ty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.wr-ty-btn {
  padding: .7rem 1.5rem;
  font-size: .95rem;
}
.wr-ty-link {
  color: var(--primary);
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
}
.wr-ty-link:hover { text-decoration: underline; }

/* ── Sidebar ── */
.wr-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.wr-tip-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.wr-tip-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--fh);
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-h);
  margin-bottom: .9rem;
}
.wr-tip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.wr-tip-list li {
  font-size: .82rem;
  color: var(--text-b);
  line-height: 1.5;
  padding-left: 1rem;
  position: relative;
}
.wr-tip-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.wr-trust-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.wr-trust-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .82rem;
  color: var(--text-b);
  font-weight: 600;
}

/* ── Mobile adjustments ── */
@media (max-width: 600px) {
  .wr-form-panel { padding: 1.25rem; }
  .wr-title { font-size: 1.4rem; }
  .wr-star { font-size: 2rem; }
  .wr-wrap { padding: 1.5rem 0 3rem; }
}

/* ══════════════════════════════════════════
   TOUR CARD
   ══════════════════════════════════════════ */
.wr-tour-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.75rem;
}
.wr-tc-img {
  width: 120px;
  height: 85px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.wr-tc-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wr-tc-info { flex: 1; min-width: 0; }
.wr-tc-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  padding: .1rem .5rem;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .4rem;
}
.wr-tc-name {
  font-family: var(--fh);
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-h);
  line-height: 1.4;
  margin-bottom: .45rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wr-tc-meta { display: flex; gap: 1rem; flex-wrap: wrap; }
.wr-tc-meta span { font-size: .75rem; color: var(--text-m); }
@media (max-width: 480px) {
  .wr-tour-card { flex-direction: column; align-items: flex-start; }
  .wr-tc-img { width: 100%; height: 150px; }
}

/* ══════════════════════════════════════════
   RATING HEADING + SUB-CRITERIA (card grid)
   ══════════════════════════════════════════ */
.wr-rating-head {
  font-family: var(--fh);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-h);
  margin: 0 0 1rem;
}

/* 2-column grid on tablet/desktop, 1-column on mobile */
.wr-criteria {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
@media (max-width: 500px) {
  .wr-criteria { grid-template-columns: 1fr; }
}

/* Each criterion card */
.wr-criterion {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transition: border-color .2s;
}
.wr-criterion:focus-within {
  border-color: var(--primary);
}

/* Label */
.wr-crit-label {
  font-family: var(--fh);
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-h);
}

/* Stars row */
.wr-crit-stars {
  display: flex;
  gap: .1rem;
}

/* Individual star — large touch target */
.wr-cstar {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 2.1rem;
  color: #dde0ea;
  padding: .15rem .1rem;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .12s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.wr-cstar:hover,
.wr-cstar.active { color: var(--star); }
.wr-cstar:hover  { transform: scale(1.2); }

/* Score label below stars */
.wr-crit-val {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-m);
  min-height: 1.1rem;
}
.wr-crit-val.rated { color: var(--primary); }

/* Mobile: slightly smaller star to fit 5 in a row cleanly */
@media (max-width: 380px) {
  .wr-cstar { font-size: 1.8rem; min-width: 38px; }
}

/* ══════════════════════════════════════════
   UPLOAD BUTTON + INLINE PREVIEW
   ══════════════════════════════════════════ */
.wr-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-b);
  font-family: var(--fb);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.wr-upload-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.wr-upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .65rem;
}
.wr-prev-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.wr-prev-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wr-prev-video-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  color: white;
  font-size: 1.4rem;
}
.wr-prev-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  border: none;
  color: white;
  font-size: .68rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ══════════════════════════════════════════
   UPLOAD MODAL
   ══════════════════════════════════════════ */
.wr-upload-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wr-upload-modal[hidden] { display: none; }
.wr-um-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
}
.wr-um-box {
  position: relative;
  background: white;
  border-radius: 16px;
  width: min(560px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--sh-modal);
  display: flex;
  flex-direction: column;
}
/* Sticky header */
.wr-um-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem .9rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.wr-um-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--fh);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-h);
  margin: 0;
}
.wr-um-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-m);
  padding: .3rem;
  display: flex;
  align-items: center;
  transition: color .2s, border-color .2s;
}
.wr-um-close:hover { color: var(--text-h); border-color: var(--text-m); }
/* Drop zone */
.wr-um-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.25rem 1.5rem;
  margin: 1.25rem 1.5rem .75rem;
  text-align: center;
  transition: border-color .2s, background .2s;
  cursor: default;
}
.wr-um-drop.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.wr-um-drop-text {
  font-family: var(--fh);
  font-size: .98rem;
  font-weight: 700;
  color: var(--text-h);
  margin: 0;
}
.wr-um-drop-hint { font-size: .76rem; color: var(--text-m); }
.wr-um-browse {
  padding: .5rem 1.35rem;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  background: white;
  color: var(--primary);
  font-family: var(--fh);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.wr-um-browse:hover { background: var(--primary); color: white; }
/* Preview grid inside modal */
.wr-um-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .25rem 1.5rem 1rem;
  min-height: 0;
}
.wr-um-prev-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.wr-um-prev-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wr-um-prev-video {
  width: 100%;
  height: 100%;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8rem;
}
.wr-um-prev-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: .58rem;
  padding: .15rem .3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wr-um-prev-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.7);
  border: none;
  color: white;
  font-size: .72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Sticky footer */
.wr-um-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.5rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: white;
}
.wr-um-count { font-size: .82rem; color: var(--text-m); }
.wr-um-done {
  padding: .6rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--fh);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.wr-um-done:hover { background: var(--primary-dark); }
.wr-um-done:disabled { background: var(--text-m); cursor: not-allowed; opacity: .65; }
.wr-um-processing { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--text-m); }
.wr-um-processing[hidden] { display: none; }
.wr-um-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--primary);
  animation: wrSpin .7s linear infinite;
}
@keyframes wrSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wr-um-spinner { animation-duration: 1.6s; } }
