/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
  line-height: 1.2;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  background: var(--green-primary);
  color: var(--white);
}

.btn--secondary {
  background: var(--green-light);
  color: var(--text-dark);
}

.btn--save {
  background: var(--yellow);
  color: var(--text-dark);
}

.btn--danger {
  background: #D94444;
  color: var(--white);
}

.btn--danger-subtle {
  background: none;
  color: #D94444;
  padding: var(--sp-xs) var(--sp-sm);
}

.btn--outline {
  background: none;
  border: 1.5px solid var(--border-light);
  color: var(--text-medium);
}

.btn--small {
  font-size: 0.8rem;
  padding: var(--sp-xs) var(--sp-sm);
}

.btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.2rem;
  border-radius: var(--radius-sm);
}

.btn--leaf {
  border-radius: var(--radius-lg) var(--radius-sm) var(--radius-lg) var(--radius-sm);
  padding: var(--sp-sm) var(--sp-lg);
  font-size: 1rem;
  box-shadow: var(--shadow-button);
}

/* ===== Panels ===== */

.panel {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  box-shadow: var(--shadow-card);
}

/* Gradient border panel */
.panel--bordered {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
}

.panel--bordered::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-md) + 2px);
  background: var(--gradient-border);
  z-index: -1;
}

/* ===== Form Inputs ===== */

.form-group {
  margin-bottom: var(--sp-md);
}

.form-group > label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: var(--sp-xs);
}

.form-input {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--green-primary);
  outline: none;
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.4;
}

.form-input--error {
  border-color: #D94444;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ===== Search Bar ===== */

.search-bar {
  margin-bottom: var(--sp-md);
}

.search-bar__input {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--green-light);
}

.search-bar__input:focus {
  border-color: var(--green-primary);
  outline: none;
  background: var(--white);
}

.search-bar__input::placeholder {
  color: var(--text-light);
}

/* ===== Tag Badge ===== */

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--tag-color, var(--green-primary));
  color: var(--white);
  white-space: nowrap;
}

.tag-badge--sm {
  font-size: 0.7rem;
  padding: 2px 8px;
}

.tag-badge__remove {
  background: none;
  border: none;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.8;
}

.tag-badge__remove:hover {
  opacity: 1;
}

/* ===== Tag Checkbox (edit form) ===== */

.tag-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.tag-checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.tag-checkbox input[type="checkbox"] {
  display: none;
}

.tag-checkbox__label {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  border: 2px solid var(--tag-color, var(--green-primary));
  color: var(--tag-color, var(--green-primary));
  background: var(--white);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.tag-checkbox input:checked + .tag-checkbox__label {
  background: var(--tag-color, var(--green-primary));
  color: var(--white);
}

/* ===== Filter Chip ===== */

.filter-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  border: 2px solid var(--tag-color, var(--green-primary));
  color: var(--tag-color, var(--green-primary));
  background: var(--white);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.filter-chip--active {
  background: var(--tag-color, var(--green-primary));
  color: var(--white);
}

/* ===== Dialog ===== */

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--sp-md);
}

.dialog {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--sp-lg);
  max-width: 320px;
  width: 100%;
  box-shadow: var(--shadow-panel);
}

.dialog__message {
  font-size: 1rem;
  margin-bottom: var(--sp-lg);
  text-align: center;
  color: var(--text-dark);
}

.dialog__actions {
  display: flex;
  gap: var(--sp-sm);
  justify-content: center;
}

/* ===== Dish Card ===== */

.dish-card {
  display: flex;
  align-items: center;
  padding: var(--sp-md);
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--sp-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-fast);
}

.dish-card:active {
  box-shadow: var(--shadow-panel);
}

.dish-card__info {
  flex: 1;
  min-width: 0;
}

.dish-card__name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dish-card__desc {
  display: block;
  font-size: 0.82rem;
  color: var(--text-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.dish-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.dish-card__arrow {
  font-size: 1.5rem;
  color: var(--text-light);
  margin-left: var(--sp-sm);
  flex-shrink: 0;
}

/* ===== Color Input ===== */

.color-input {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  background: none;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input::-webkit-color-swatch {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
}

/* ===== Photo Upload ===== */

.photo-upload {
  margin-top: var(--sp-xs);
}

.photo-upload__preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-sm);
}

.photo-upload__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-upload__placeholder {
  color: var(--text-light);
  font-size: 0.9rem;
}

.photo-upload__actions {
  display: flex;
  gap: var(--sp-sm);
}

/* Photo choice menu (Camera / Gallery) */
.photo-choice-menu {
  display: none;
  flex-direction: column;
  gap: 1px;
  background: var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--sp-sm);
  box-shadow: var(--shadow-card);
}

.photo-choice-menu--open {
  display: flex;
}

.photo-choice-menu__option {
  padding: var(--sp-sm) var(--sp-md);
  background: var(--white);
  border: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--green-dark);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background var(--transition-fast);
}

.photo-choice-menu__option:active {
  background: var(--green-light);
}

.photo-choice-menu__cancel {
  color: var(--text-light);
  font-weight: 400;
}

/* ===== Empty State ===== */

.empty-state {
  text-align: center;
  padding: var(--sp-xl) var(--sp-md);
  color: var(--text-light);
}

.empty-state p {
  margin-bottom: var(--sp-sm);
}
