/* =============================================
   RESET & CSS VARIABLES
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #e8b86d;
  --brand-dark: #1a1a2e;
  --bg: #f9f8f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.2);
  --radius: 14px;
  --radius-sm: 8px;
  --serif: 'DM Serif Display', serif;
  --sans: 'DM Sans', sans-serif;
  --success: #1d9e75;
  --info: #185fa5;
}

/* =============================================
   BASE
   ============================================= */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* =============================================
   HEADER
   ============================================= */
header {
  background: var(--brand-dark);
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.logo {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.5px;
  color: #fff;
}
.logo span { color: var(--accent); }

.btn-write {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 20px;
  background: var(--accent);
  color: #1a1a1a;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity .15s;
}
.btn-write:hover { opacity: .85; }

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* =============================================
   STATS ROW
   ============================================= */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.stat-val { font-size: 26px; font-weight: 500; line-height: 1.2; }
.stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* =============================================
   RATING BARS
   ============================================= */
.rating-bars { margin-bottom: 1.5rem; }

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .07em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.bar-track {
  flex: 1;
  height: 7px;
  background: #e8e6e0;
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .5s ease;
}
.bar-count {
  min-width: 22px;
  text-align: right;
  color: var(--text-muted);
  font-size: 12px;
}

/* =============================================
   FILTER TAGS
   ============================================= */
.filter-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.filter-tag {
  font-family: var(--sans);
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 0.5px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.filter-tag:hover { border-color: var(--text); color: var(--text); }
.filter-tag.active { background: var(--text); color: #fff; border-color: var(--text); }

/* =============================================
   CONTROLS (search + sort)
   ============================================= */
.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.controls input,
.controls select {
  font-family: var(--sans);
  font-size: 13px;
  padding: 9px 12px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.controls input { flex: 2; min-width: 160px; }
.controls select { flex: 1; min-width: 150px; }
.controls input:focus,
.controls select:focus { border-color: var(--accent); }

/* =============================================
   REVIEW CARDS
   ============================================= */
.review-list { display: flex; flex-direction: column; gap: 16px; }

.review-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  transition: box-shadow .2s, border-color .2s;
}
.review-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-color: var(--border-strong);
}

.rc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: .85rem;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 14px;
  flex-shrink: 0;
}

.rc-meta { flex: 1; min-width: 0; }

.rc-name {
  font-weight: 500;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.verified-badge {
  font-size: 11px;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 400;
}

.rc-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rc-stars { margin-top: 4px; color: var(--accent); font-size: 15px; letter-spacing: .5px; }

.cat-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  margin-left: auto;
}

.rc-title { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.rc-body { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: .85rem; }

/* =============================================
   REVIEW PHOTOS
   ============================================= */
.rc-photos {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}

.rc-photo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
  cursor: pointer;
  transition: opacity .15s, transform .15s;
}
.rc-photo:hover { opacity: .85; transform: scale(1.03); }

/* =============================================
   REVIEW FOOTER
   ============================================= */
.rc-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.like-btn {
  font-family: var(--sans);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
}
.like-btn:hover,
.like-btn.liked { border-color: var(--accent); color: var(--accent); }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 540px;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.modal-title { font-family: var(--serif); font-size: 22px; margin-bottom: 1.4rem; }

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  font-size: 13px;
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 13px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,184,109,.2);
}
textarea.form-input { resize: vertical; min-height: 100px; line-height: 1.65; }

/* Star picker */
.star-picker { display: flex; gap: 7px; margin-top: 5px; }
.star-btn {
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #ddd;
  transition: color .1s, transform .1s;
  padding: 0;
  line-height: 1;
}
.star-btn.active,
.star-btn:hover { color: var(--accent); transform: scale(1.15); }

/* Photo drop zone */
.photo-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all .15s;
  background: var(--bg);
}
.photo-drop:hover,
.photo-drop.dragover { border-color: var(--accent); background: rgba(232,184,109,.06); }
.photo-drop input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Photo previews */
.photo-previews { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.preview-wrap { position: relative; width: 76px; height: 76px; }
.preview-img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--border);
}
.preview-rm {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Submit / Cancel buttons */
.btn-submit {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 11px;
  background: var(--brand-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: .5rem;
  transition: opacity .15s;
}
.btn-submit:hover { opacity: .85; }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; }

.btn-cancel {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px;
  background: transparent;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  margin-top: 8px;
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 300;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 10px; }

/* =============================================
   TOAST
   ============================================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1a1a;
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 400;
  opacity: 0;
  transform: translateY(10px);
  transition: all .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #c0392b; }

/* =============================================
   EMPTY / LOADING STATES
   ============================================= */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 14px;
}
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 14px;
}
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row .stat-card:last-child { grid-column: span 2; }
  header { padding: .75rem 1rem; }
  .container { padding: 1.25rem .9rem; }
}
