:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --primary: #111827;
  --primary-contrast: #ffffff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Nunito", "TT Norms", Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

/* TT Norms local/hooks (place font at /static/fonts/TTNorms.woff2 to use) */
@font-face {
  font-family: "TT Norms";
  src: local("TT Norms"), local("TT Norms Pro"), url("/static/fonts/TTNorms.woff2") format("woff2");
  font-display: swap;
}

[hidden] { display: none !important; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}
/* Shift header content slightly left to match reference */
.site-header .container { padding-left: 8px; padding-right: 8px; }

.site-header {
  position: sticky;
  top: 8px;
  background: var(--bg);
  z-index: 50;
}
.header-inner { padding: 8px 0; }
.header-inner-grid { display:grid; grid-template-columns: 1fr auto 1fr; align-items:center; column-gap: 80px; }
.main-nav { justify-self: center; transform: translateX(-24px); }
.header-actions { justify-self: end; display:flex; gap:2px; transform: translateX(30px); }
.logo-slot { display: flex; align-items: center; gap: 10px; min-height: 36px; justify-self: start; transform: translateX(-110px); }
.logo-link { 
  display: block; 
  border-radius: 8px;
  padding: 2px;
}
.logo-link:hover { 
  background: transparent;
}
.logo { height: 100px; width: auto; display: block; }
.brand-title { font-weight: 700; letter-spacing: 0.2px; }
.header-nav { display: flex; gap: 9px; }
.nav-link { 
  color: var(--text); 
  text-decoration: none; 
  padding: 8px 12px; 
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  transition: color 0.4s ease-in-out;
  position: relative;
  overflow: hidden;
}
.nav-link:hover { 
  color: #a869f6;
}
.nav-btn {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-weight: 500;
}
.social-icon { width:43px; height:43px; display:block; }
.nav-btn:hover { opacity: .9; }
.nav-icon-btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  text-decoration: none; 
  border: none; 
  background: transparent; 
  box-shadow: none; 
  padding: 4px;
  border-radius: 8px;
}
.nav-icon-btn:hover { 
  background: transparent;
}
.social-icon { width:43px; height:43px; display:block; border: none; }
.header-divider { height: 1px; background: var(--border); }

.title { margin: 0 0 6px; font-size: 28px; display: block; }
.badge-img { width:40px; height:40px; border-radius:12px; object-fit:cover; box-shadow: var(--shadow); }
.subtitle { margin: 0; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.search-row { padding: 18px; margin: 16px 0 20px; }
.search-wrap { display: grid; gap: 12px; }
.search-head { display:flex; align-items:center; gap:12px; }
.search-controls { display:grid; grid-template-columns: 1fr auto; gap: 12px; }
.search-group { display: flex; align-items: center; gap: 8px; }
.search-with-icon { position: relative; }
.search-icon { position:absolute; left: 12px; color:#6b7280; }
.search-with-icon .search-input { padding-left: 38px; }
.search-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-size: 16px;
}
.search-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
  opacity: 0.7;
}

.primary-btn {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #09e17e;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}
.primary-btn:hover { 
  filter: none;
}
.btn { 
  padding: 10px 14px; 
  border-radius: 10px; 
  border: 1px solid var(--border); 
  background: var(--card); 
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.icon-btn { border: none; background: transparent; cursor: pointer; font-size: 18px; }

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 800px) {
  .grid-two { grid-template-columns: 1fr; }
}

/* Stats */
.grid-three { display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; margin: 0 0 16px; }
@media (max-width: 800px){ .grid-three { grid-template-columns: 1fr; } }
.stat-card { padding: 14px; background: #f7fbf8; }
.stat-body { display:flex; align-items:center; gap:12px; }
.stat-icon { width:44px; height:44px; border-radius:12px; object-fit:cover; box-shadow: var(--shadow); }
.stat-texts { display:grid; gap:4px; }
.stat-value { font-weight:800; font-size:22px; }
.stat-label { color: var(--muted); font-size: 14px; }

/* Unfilled purple star icon for Average Rating */
.stat-star {
  width:44px; height:44px; border-radius:12px; display:grid; place-items:center; background:#f5f3ff; box-shadow: var(--shadow);
}
.stat-star::before {
  content:"";
  width:24px; height:24px; display:block;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="%23a869f6" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"><path d="M9.05 2.64c.35-.95 1.65-.95 2 0l1.4 3.77c.14.39.5.66.92.68l4.06.2c1 .05 1.4 1.32.63 1.94l-3.17 2.55c-.32.26-.46.69-.35 1.09l1.12 3.94c.26.95-.78 1.73-1.6 1.2l-3.4-2.2a1.2 1.2 0 0 0-1.3 0l-3.4 2.2c-.82.53-1.86-.25-1.6-1.2l1.12-3.94c.1-.4-.03-.83-.35-1.09L1.94 9.23c-.77-.62-.37-1.89.63-1.94l4.05-.2c.42-.02.79-.29.94-.68l1.49-3.77Z"/></svg>') center / contain no-repeat;
}

.review-card { padding: 14px; }
.review-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 10px; overflow:hidden; display:grid; place-items:center; }
.avatar img { width:100%; height:100%; object-fit:cover; }
.review-user { font-weight: 600; word-break: break-word; }
.review-meta { color: var(--muted); font-size: 12px; }
.review-stars { font-weight: 700; }
.review-text { margin-top: 8px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.stars-row { display:flex; gap:6px; align-items:center; margin-top:4px; margin-bottom:4px; }
.stars { display:inline-flex; gap:2px; color:#e5e7eb; }
.star { width:16px; height:16px; color:#a869f6; }
.star.grey { color:#e5e7eb; }

/* Rating input 0..10 with half-step */
.rating-input { 
  display: flex; 
  width: 100%;
  justify-content: space-between;
  cursor: pointer; 
  user-select: none; 
  padding: 12px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.rating-input .star { 
  width: 32px; 
  height: 32px; 
  transition: color 0.15s ease, transform 0.1s ease; 
  cursor: pointer;
  color: #e5e7eb;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rating-input .star:hover { 
  transform: scale(1.15); 
  color: #a869f6;
}
.rating-value { 
  color: var(--primary); 
  font-size: 16px; 
  margin-top: 8px; 
  font-weight: 700; 
  text-align: center;
  background: #f3f4f6;
  padding: 8px 16px;
  border-radius: 8px;
}

.field-error { margin-top: 4px; color: #b91c1c; background:#fee2e2; border:1px solid #fecaca; padding:6px 8px; border-radius:8px; font-size: 12px; display:none; }
.field-error.show { display:block; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-backdrop.show {
  opacity: 1;
}
.modal {
  position: fixed; inset: 0; z-index: 1001;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.3s ease;
}
.modal.show {
  opacity: 1;
  transform: scale(1);
}
.modal-card {
  width: min(640px, calc(100% - 32px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; }
.modal-body { display: grid; gap: 12px; margin-top: 8px; }
.field { display: grid; gap: 6px; }
.field input, .field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.form-error { color: #b91c1c; font-size: 14px; }

.footer { color: var(--muted); font-size: 13px; padding: 24px 0 40px; }


/* Remove header bottom line */
.header-divider { display: none; height: 0; background: transparent; }

/* Mobile header layout: logo + socials in one centered row, nav below */
@media (max-width: 700px) {
  .site-header { top: 0; }
  .header-inner-grid {
    grid-template-columns: auto auto;
    column-gap: 8px;
    row-gap: 6px;
    justify-content: center;
    align-items: center;
  }
  .logo-slot {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    transform: none !important;
  }
  .header-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    transform: none !important;
  }
  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    transform: none !important;
    max-width: 100%;
  }
  .header-nav {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
  }
  .nav-link { padding: 4px 6px; font-size: 13px; }
  .logo { height: 76px; }
  .social-icon { width: 46px; height: 46px; }

  /* Stats: 3 in a row, compact */
  .grid-three { grid-template-columns: repeat(3, 1fr); }
  .stat-card { padding: 8px; }
  .stat-body { gap: 8px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-star { width: 32px; height: 32px; }
  .stat-star::before { width: 18px; height: 18px; }
  .stat-value { font-size: 16px; }
  .stat-label { font-size: 12px; }
}

