@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');

:root {
  --background: #fcfcfd;
  --foreground: #09090b;
  --card: #ffffff;
  --card-foreground: #09090b;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --muted-foreground: #71717a;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 20px;
}

.hero {
  margin-bottom: 20px;
}

.title {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 10px;
}

.description {
  font-size: 14px;
  font-weight: 400;
  max-width: 560px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 20px;
}

.muted {
  color: var(--muted-foreground);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--primary);
}

.button-primary:hover {
  background: #27272a;
}

.button-outline {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--input);
}

.button-outline:hover {
  background: #f4f4f5;
}

.map-container {
  width: 100%;
  height: 348px;
  overflow: hidden;
  margin-bottom: 50px;
  padding: 0;
}

#map {
  width: 100%;
  height: 100%;
}

.cafe-list {
  display: flex;
  flex-direction: column;
}

.cafe-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  background: var(--card);
}

.cafe-item:hover {
  background-color: #f8fafc;
}

.cafe-item.active {
  background-color: #f4f4f5;
  border-color: #c4c4c8;
}

.cafe-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.cafe-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cafe-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.cafe-address {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-foreground);
}

.rating {
  display: flex;
  gap: 3px;
  align-items: center;
}

.cup {
  width: 13px;
  height: 14px;
}

.cup.filled {
  fill: #4CAF50;
}

.cup.half {
  fill: #4CAF50;
}

.cup.empty {
  fill: #ddd;
}

.order-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 491px;
}

.order-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.order-addon {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-foreground);
}

.order-review {
  font-size: 13px;
  font-weight: 400;
  color: var(--foreground);
}

/* Leaflet custom styles */
.leaflet-container {
  font-family: inherit;
}

.custom-marker {
  background: #4CAF50;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
  margin: 12px 16px;
  font-family: 'Helvetica Neue', 'Inter', sans-serif;
}

.popup-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
}

.popup-address {
  font-size: 12px;
  color: #737373;
}

/* Submission tag */
.submission-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  background: #f4f4f5;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Submit section */
.submit-section {
  margin-bottom: 40px;
}

.submit-toggle {
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.submit-toggle:hover {
  color: var(--foreground);
}

.submit-form {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top: 0.5px solid transparent;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease, border-color 0.3s ease;
}

.submit-form.open {
  max-height: 800px;
  margin-top: 20px;
  padding-top: 20px;
  border-top-color: var(--border);
  opacity: 1;
}

.form-group {
  margin-bottom: 16px;
  max-width: 491px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  color: var(--foreground);
  background: #fff;
  border: 1px solid var(--input);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px rgba(39, 39, 42, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #999;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Rating selector */
.rating-selector {
  display: flex;
  align-items: center;
  gap: 2px;
}

.rating-cup-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.rating-cup-btn:hover {
  transform: scale(1.15);
}

.rating-cup-btn svg {
  width: 24px;
  height: 26px;
  fill: #ddd;
  transition: fill 0.15s ease;
}

.rating-cup-btn.filled svg {
  fill: #4CAF50;
}

.rating-cup-btn.half svg .cup-fill {
  fill: url(#ratingHalfGradient);
}

.rating-value {
  margin-left: 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-foreground);
}

.submit-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
}

.submit-btn:hover {
  background: #27272a;
}

.submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.form-message {
  font-size: 13px;
  font-weight: 400;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 6px;
  display: none;
}

.form-message.show {
  display: block;
}

.form-message.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.form-message.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.form-message.loading {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #bfdbfe;
}

/* Responsive styles for mobile */
@media screen and (max-width: 600px) {
  .container {
    padding: 40px 16px;
  }

  .title {
    font-size: 15px;
  }

  .description {
    font-size: 12px;
    margin-bottom: 30px;
  }

  .map-container {
    height: 280px;
    border-radius: 10px;
    margin-bottom: 40px;
  }

  .cafe-header {
    flex-direction: column;
    gap: 8px;
  }

  .cafe-info {
    gap: 6px;
  }

  .cafe-name {
    font-size: 15px;
  }

  .cafe-address {
    font-size: 12px;
  }

  .rating {
    align-self: flex-start;
  }

  .order-details {
    gap: 8px;
  }

  .order-title {
    font-size: 14px;
  }

  .order-addon,
  .order-review {
    font-size: 12px;
  }

  .submission-tag {
    font-size: 12px;
    padding: 2px 6px;
    margin-left: 6px;
  }

  .submit-section {
    margin-bottom: 30px;
  }

  .submit-toggle {
    font-size: 13px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .form-label {
    font-size: 12px;
    margin-bottom: 5px;
  }

  .form-input,
  .form-textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 12px 10px;
  }

  .form-textarea {
    min-height: 100px;
  }

  .rating-selector {
    flex-wrap: wrap;
    gap: 4px;
  }

  .rating-cup-btn {
    padding: 4px;
  }

  .rating-cup-btn svg {
    width: 28px;
    height: 30px;
  }

  .rating-value {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }

  .submit-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
  }

  .form-message {
    font-size: 12px;
    padding: 10px;
  }
}

/* Extra small screens */
@media screen and (max-width: 380px) {
  .container {
    padding: 30px 12px;
  }

  .map-container {
    height: 240px;
  }

  .cafe-name {
    font-size: 14px;
  }

  .cup {
    width: 11px;
    height: 12px;
  }

  .rating-cup-btn svg {
    width: 24px;
    height: 26px;
  }
}
