:root {
  --primary: #1a7a4c;
  --primary-dark: #145e3a;
  --primary-light: #e8f5ee;
  --bg: #ffffff;
  --bg-secondary: #f7f8fa;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --border-dark: #d1d5db;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --green: #16a34a;
  --yellow: #d97706;
  --red: #dc2626;
  --gray: #9ca3af;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 6px 14px;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-link:hover { background: var(--bg-secondary); }
.nav-link.active { color: var(--primary); background: var(--primary-light); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px 0;
  text-align: center;
}

.hero-title {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.hero-subtitle {
  opacity: 0.9;
  font-size: 1rem;
}

/* Search Section */
.search-section {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
}

.search-input:focus { border-color: var(--primary); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 140px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.filter-select:focus { border-color: var(--primary); }

/* Buttons */
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--bg-secondary); color: var(--text); border: 1px solid var(--border); }
.btn-success { background: var(--green); color: white; }
.btn-warning { background: var(--yellow); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-small { padding: 6px 12px; font-size: 0.8rem; }

/* Content */
.content-section { padding: 16px 0; }

.results-info {
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.split-view {
  display: flex;
  gap: 16px;
  height: calc(100vh - 350px);
  min-height: 400px;
}

.list-panel {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.map-panel {
  flex: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.map {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

/* Restaurant List */
.restaurant-list { padding: 8px; }

.restaurant-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.restaurant-card:last-child { border-bottom: none; }
.restaurant-card:hover { background: var(--bg-secondary); }

.card-info { flex: 1; min-width: 0; }

.card-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.card-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.halal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.halal-badge.fully_halal { background: #dcfce7; color: #166534; }
.halal-badge.halal_options { background: #fef9c3; color: #854d0e; }
.halal-badge.unknown { background: #f3f4f6; color: #374151; }
.halal-badge.not_halal { background: #fef2f2; color: #991b1b; }

.halal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.halal-dot.fully_halal { background: #16a34a; }
.halal-dot.halal_options { background: #d97706; }
.halal-dot.unknown { background: #9ca3af; }
.halal-dot.not_halal { background: #dc2626; }

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

.card-rating .count {
  font-weight: 400;
  color: var(--text-secondary);
}

.card-address {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Loading & Empty */
.loading, .empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

/* Restaurant Profile */
.restaurant-profile { padding: 20px 0; }

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.profile-header { margin-bottom: 24px; }

.profile-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-halal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.profile-meta .rating {
  color: var(--text);
  font-weight: 600;
}

.profile-map {
  height: 250px;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
  border: 1px solid var(--border);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.profile-section {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.profile-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.profile-section .info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.profile-section .info-row:last-child { border-bottom: none; }
.profile-section .info-label { color: var(--text-secondary); }
.profile-section .info-value { font-weight: 500; }

.profile-section a {
  color: var(--primary);
  text-decoration: none;
}

.profile-section a:hover { text-decoration: underline; }

/* Reviews */
.reviews-list { display: flex; flex-direction: column; gap: 12px; }

.review-item {
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.review-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.review-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.review-stars {
  color: #f59e0b;
  margin-bottom: 4px;
}

.review-comment { font-size: 0.9rem; }

/* Verification History */
.verification-list { display: flex; flex-direction: column; gap: 6px; }

.verification-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.verification-item:last-child { border-bottom: none; }

.verification-result {
  font-weight: 600;
}

.verification-result.confirmed { color: var(--green); }
.verification-result.partial { color: var(--yellow); }
.verification-result.denied { color: var(--red); }

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 40px;
}

.footer p { margin-bottom: 4px; }
.footer a { color: var(--primary); text-decoration: none; }

/* Submit page */
.submit-container {
  max-width: 720px;
}

.submit-header {
  text-align: center;
  padding: 28px 0 16px;
}

.submit-title {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.submit-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto;
}

.submit-form { margin-top: 8px; }

.submit-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.section-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.field { margin-bottom: 14px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.req { color: var(--red); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  background: var(--bg);
}

.field textarea { resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---- Cuisine multi-select picker ---- */
.cuisine-picker {
  position: relative;
  width: 100%;
}

.cuisine-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.cuisine-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.cuisine-tag button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  font-weight: 700;
}

.cuisine-tag button:hover { color: var(--red); }

.cuisine-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.cuisine-toggle:hover { border-color: var(--border-dark); }
.cuisine-toggle[aria-expanded="true"] { border-color: var(--primary); }
.cuisine-toggle .cuisine-caret { color: var(--text-secondary); font-size: 0.8rem; }

.cuisine-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  background: var(--bg);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.cuisine-options {
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 0;
}

.cuisine-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.9rem;
}

.cuisine-option:hover { background: var(--bg-secondary); }

.cuisine-option input {
  accent-color: var(--primary);
  width: auto;
}

.cuisine-custom {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.cuisine-custom input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg);
  outline: none;
}

.cuisine-custom input:focus { border-color: var(--primary); }
.cuisine-custom .btn { white-space: nowrap; }

@media (max-width: 480px) {
  .cuisine-custom { flex-wrap: wrap; }
  .cuisine-custom .btn { flex: 1; }
}

.maps-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.maps-fetch-status {
  font-size: 0.8rem;
  color: var(--primary);
}

.maps-fetch-status.error {
  color: var(--red);
}

.form-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.submit-actions {
  text-align: center;
  margin: 8px 0 24px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

/* Success message */
.success-message {
  text-align: center;
  padding: 60px 20px;
}

.success-icon {
  font-size: 3rem;
  color: var(--green);
  margin-bottom: 12px;
}

.success-title {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.success-body {
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 24px;
}

.success-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .field-row { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 768px) {
  .split-view {
    flex-direction: column;
    height: auto;
  }

  .map-panel {
    order: -1;
  }

  .map { min-height: 300px; }

  .list-panel { max-height: 500px; }

  .filters {
    flex-direction: column;
  }

  .filter-group { min-width: 100%; }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .search-bar { flex-direction: column; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.4rem; }
  .hero { padding: 24px 0; }
  .header .container { padding: 0 12px; }
}
