/* ========================================================================
   SkipIntro Recipe Crawler – Shopping List Addon CSS
   @since 1.4.0
   ======================================================================== */

/* ---------- Shopping Mode Button (reuses sitc-btn-grocery) ------------- */

/* Grocery button active state: Yellow background, icon stays black */
.sitc-btn-grocery.active {
  background-color: rgb(227, 158, 0);
}

.sitc-btn-grocery.active::before {
  background-color: #000; /* Icon bleibt schwarz */
}

/* ---------- Ingredient States (Shopping Mode) -------------------------- */

/* Ingredient on shopping list: Green background */
.sitc-ingredient.on-list {
  background-color: #d4edda;
  border-radius: 4px;
  padding: 2px 4px;
  margin: 2px 0;
}

/* Shopping mode active: Show pointer cursor on ingredients */
.sitc-shopping-mode-active .sitc-ingredient label {
  cursor: pointer;
}

/* Shopping mode active: Hide checkboxes for better clarity */
.sitc-shopping-mode-active .sitc-ingredient .sitc-chk {
  display: none;
}

/* ---------- Shopping List Page ----------------------------------------- */

.sitc-shopping-list-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  text-align: left;
}

.sitc-shopping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.sitc-shopping-header h1 {
  margin: 0;
  font-size: 2rem;
}

.sitc-shopping-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.sitc-shopping-stats {
  font-size: 0.9rem;
  color: #666;
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border-radius: 999px;
}

.sitc-shopping-sort {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.sitc-btn-clear-list {
  padding: 0.5rem 1rem;
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.sitc-btn-clear-list:hover {
  background: #c82333;
}

/* Manual Input */
.sitc-manual-input {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.sitc-manual-input input {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.sitc-manual-input button {
  padding: 0.75rem 1.5rem;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.sitc-manual-input button:hover {
  background: #333;
}

/* ---------- Suggestions (Word Cloud) ------------------------------------ */

.sitc-suggestions {
  margin-bottom: 2rem;
}

.sitc-suggestions-label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.sitc-suggestions-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sitc-suggestion-tag {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.sitc-suggestion-tag:hover:not(:disabled) {
  background: rgb(227, 158, 0);
  border-color: rgb(227, 158, 0);
  color: #fff;
}

/* Disabled state: Already on list - DEUTLICH ausgegraut */
.sitc-suggestion-tag.disabled,
.sitc-suggestion-tag:disabled {
  background: #f8f8f8;
  color: #ccc;
  cursor: not-allowed;
  border-color: #eee;
  text-decoration: line-through;
  opacity: 0.5;
}

/* Shopping List Items - alle Container ohne Padding für korrekte Icon-Positionierung */
.sitc-shopping-items {
  list-style: none;
  padding: 0 !important;
  margin: 0;
}

.sitc-shopping-group {
  list-style: none;
  margin-bottom: 2rem;
  padding: 0 !important;
}

.sitc-shopping-items-container {
  padding: 0 !important;
}

.sitc-shopping-group-title {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #000;
  text-align: left;
}

/* Recipe title link: Nur Dekoration entfernen */
.sitc-shopping-group-title a {
  color: inherit !important;
  text-decoration: none !important;
}

.sitc-shopping-group-title a:hover {
  opacity: 0.7;
}

/* Item: Simple flexbox row */
.sitc-shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.35rem 0;
  list-style: none;
}

/* Label as 2-column grid: [Checkbox][Text] (same as recipe .sitc-ingredient) */
.sitc-shopping-item > label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 0.5rem;
  margin: 0;
  flex: 1;
  cursor: pointer;
}

/* Checkbox aligned like recipe ingredients */
.sitc-shopping-item .sitc-chk {
  margin: 0;
  transform: translateY(1px);
  margin-top: 6px;
}

/* Text block wraps cleanly, forced left-align (override theme centering) */
.sitc-shopping-item .sitc-line {
  display: block;
  text-align: left;
}

/* Checked = strikethrough + dimmed (same as recipe) */
.sitc-shopping-item.checked .sitc-name {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Actions: Am rechten Rand */
.sitc-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.sitc-btn-edit,
.sitc-btn-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.sitc-btn-edit::before,
.sitc-btn-delete::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background-color: #000;
}

.sitc-btn-edit::before {
  -webkit-mask: url('../../../../frontend/assets/img/edit_square_48dp_000_FILL0_wght200_GRAD0_opsz48.svg') no-repeat center / contain;
          mask: url('../../../../frontend/assets/img/edit_square_48dp_000_FILL0_wght200_GRAD0_opsz48.svg') no-repeat center / contain;
}

.sitc-btn-delete::before {
  -webkit-mask: url('../../../../frontend/assets/img/delete_48dp_000_FILL0_wght200_GRAD0_opsz48.svg') no-repeat center / contain;
          mask: url('../../../../frontend/assets/img/delete_48dp_000_FILL0_wght200_GRAD0_opsz48.svg') no-repeat center / contain;
  background-color: #dc3545;
}

.sitc-btn-edit:hover,
.sitc-btn-delete:hover {
  opacity: 1;
}

/* Footer Actions */
.sitc-shopping-footer {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px dashed #ccc;
}

.sitc-shopping-footer button {
  padding: 0.75rem 1.5rem;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.sitc-shopping-footer button:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* Empty State */
.sitc-shopping-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #666;
  font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .sitc-shopping-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sitc-manual-input {
    flex-direction: column;
  }

  .sitc-shopping-footer {
    flex-direction: column;
  }

  .sitc-shopping-footer button {
    width: 100%;
  }
}
