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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Header */
.header {
  background: #ff6b35;
  color: #fff;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
}

.header .btn-publish {
  background: #fff;
  color: #ff6b35;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.header .btn-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}

/* Snack list */
.snack-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.snack-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.15s;
}

.snack-card:active {
  transform: scale(0.98);
}

.snack-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.snack-card-info {
  padding: 12px;
}

.snack-card-info .snack-id {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.snack-card-info .snack-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.snack-card-info .snack-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.snack-card-info .snack-price {
  color: #ff6b35;
  font-weight: 600;
}

.snack-card-info .snack-location {
  color: #666;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 16px;
}

/* Form page */
.form-container {
  padding: 16px;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #ff6b35;
}

.form-group .image-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 30px;
  cursor: pointer;
  color: #999;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group .image-upload:active {
  border-color: #ff6b35;
}

.form-group .image-upload img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: #ff6b35;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-submit:active {
  opacity: 0.8;
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Detail page */
.detail-container {
  padding-bottom: 80px;
}

.detail-image {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
}

.detail-info {
  padding: 16px;
}

.detail-info .detail-id {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.detail-info .detail-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.detail-info .detail-price {
  font-size: 20px;
  color: #ff6b35;
  font-weight: 700;
  margin-bottom: 16px;
}

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
}

.detail-row .detail-label {
  color: #999;
  width: 80px;
  flex-shrink: 0;
}

.detail-row .detail-value {
  color: #333;
  flex: 1;
}

.detail-actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  gap: 12px;
}

.btn-edit,
.btn-delete {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-edit {
  background: #ff6b35;
  color: #fff;
}

.btn-delete {
  background: #f5f5f5;
  color: #e53935;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 85%;
  max-width: 360px;
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 12px;
  text-align: center;
}

.modal input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 16px;
  outline: none;
}

.modal input:focus {
  border-color: #ff6b35;
}

.modal-buttons {
  display: flex;
  gap: 12px;
}

.modal-buttons button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.modal-buttons .btn-confirm {
  background: #ff6b35;
  color: #fff;
}

.modal-buttons .btn-cancel {
  background: #f5f5f5;
  color: #666;
}

/* Toast notification */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
}
