/* ============================================
   Recipes View
   ============================================ */

/* Category Tab Bar */
.recipe-categories {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.recipe-categories::-webkit-scrollbar {
  display: none;
}

.recipe-category-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 2px solid var(--border-light);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  min-width: 80px;
  flex-shrink: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
}

.recipe-category-tab:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.recipe-category-tab.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.recipe-category-icon {
  font-size: 1.5rem;
}

.recipe-category-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.recipe-category-tab.active .recipe-category-label {
  color: white;
}

/* Cuisine badge on cards */
.recipe-cuisine-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  z-index: 1;
}

.recipes-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}

/* Recipe Card */
.recipe-card {
  cursor: pointer;
  overflow: hidden;
}

.recipe-card-image {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.recipe-card-emoji {
  font-size: 3rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

.recipe-fav-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
  border: none;
  cursor: pointer;
  padding: 0;
}

.recipe-fav-btn:hover {
  background: rgba(0,0,0,0.5);
  transform: scale(1.1);
}

.recipe-card-body {
  padding: var(--space-md);
}

.recipe-card-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-xs);
  line-height: var(--leading-tight);
}

.recipe-card-meta {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

/* Recipe Detail Modal */
.recipe-detail-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.recipe-detail-header {
  margin-bottom: var(--space-md);
}

.recipe-detail-header h2 {
  margin-bottom: var(--space-xs);
}

.recipe-detail-macros {
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.recipe-ingredient-list {
  margin-bottom: var(--space-md);
}

.recipe-ingredient {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-sm);
}

.recipe-ingredient:last-child {
  border-bottom: none;
}

.recipe-ingredient-amount {
  font-weight: var(--weight-semibold);
  color: var(--accent-primary);
  min-width: 80px;
}

.recipe-instructions {
  list-style: none;
  counter-reset: step;
}

.recipe-step {
  position: relative;
  padding: var(--space-sm) 0 var(--space-sm) var(--space-xl);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-light);
  counter-increment: step;
}

.recipe-step:last-child {
  border-bottom: none;
}

.recipe-step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: var(--space-sm);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Recipe Editor */
.recipe-editor .ingredient-row {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.recipe-editor .ingredient-macros {
  display: flex;
  gap: 4px;
}

.recipe-editor .ingredient-macros .input {
  height: 40px;
  font-size: var(--text-xs);
  padding: 0 var(--space-xs);
  text-align: center;
}

.recipe-editor .instruction-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.instruction-number {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: var(--space-sm);
}

.recipe-editor .input {
  height: 40px;
}
