/* ============================================
   LISTE DE COURSES - Organise-Moi
   ============================================ */

.courses-container {
  padding: 0;
}

.description {
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ============================================
   INPUT GROUP & SUGGESTIONS
   ============================================ */

.input-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.input-group {
  display: flex;
  gap: 0.75rem;
}

.input-group input {
  flex: 1;
}

.input-group button {
  white-space: nowrap;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-top: 0.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 10;
  display: none;
  max-height: 200px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  color: #1f2937;
  font-size: 0.95rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: #f9fafb;
}

/* ============================================
   CONTRÔLES (Mode magasin + Compteur)
   ============================================ */

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  background-color: #f9fafb;
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 2px solid #e5e7eb;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
  font-size: 0.875rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.toggle-btn:hover {
  border-color: #2563eb;
  background-color: #eff6ff;
}

.toggle-btn.active {
  border-color: #2563eb;
  background-color: #2563eb;
  color: #ffffff;
}

.toggle-icon {
  font-size: 1.125rem;
}

.toggle-text {
  font-weight: 500;
}

.counter {
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ============================================
   LISTE D'ITEMS
   ============================================ */

.items-container {
  margin-bottom: 1.5rem;
}

#itemsList {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.category-section {
  display: flex;
  flex-direction: column;
}

.category-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.category-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0;
  background-color: transparent;
  border-radius: 0;
  gap: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s;
}

.item-item:last-child {
  border-bottom: none;
}

.item-item:hover {
  background-color: #f9fafb;
}

.item-item.completed {
  opacity: 0.6;
}

.item-item.completed .item-text {
  text-decoration: line-through;
  color: #94a3b8;
}

.item-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.item-text {
  flex: 1;
  color: #1f2937;
  word-break: break-word;
  font-size: 1rem;
}

.item-category-select {
  padding: 0.375rem 0.5rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #1f2937;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 120px;
  opacity: 0;
  transition: opacity 0.2s;
}

.item-item:hover .item-category-select {
  opacity: 1;
}

.item-category-select:focus {
  opacity: 1;
  outline: none;
  border-color: #2563eb;
}

.item-delete {
  display: none;
}

.item-item:hover .item-delete {
  display: block;
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.item-item:hover .item-delete:hover {
  opacity: 1;
}

/* ============================================
   MODE MAGASIN
   ============================================ */

body.store-mode .item-item {
  padding: 1.25rem;
  gap: 1rem;
}

body.store-mode .item-checkbox {
  width: 28px;
  height: 28px;
}

body.store-mode .item-text {
  font-size: 1.125rem;
  font-weight: 500;
}

body.store-mode .item-category-select {
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  min-width: 140px;
}

body.store-mode .category-title {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
}

body.store-mode .category-items {
  gap: 0.75rem;
}

/* ============================================
   FOOTER ACTIONS
   ============================================ */

.footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 1rem;
}

.filters {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.875rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.filter-btn:hover {
  background-color: #f3f4f6;
}

.filter-btn.active {
  background-color: #2563eb;
  color: #ffffff;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.button-clear {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  color: #64748b;
  cursor: pointer;
  font-size: 0.875rem;
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.button-clear:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

.button-clear.button-danger {
  color: #dc2626;
}

.button-clear.button-danger:hover {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #e5e7eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 0.5rem 0;
}

.empty-message {
  font-size: 0.875rem;
  color: #9ca3af;
  margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .toggle-btn {
    width: 100%;
    justify-content: center;
  }

  .counter {
    text-align: center;
  }

  .footer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    width: 100%;
    justify-content: center;
  }

  .action-buttons {
    width: 100%;
    flex-direction: column;
  }

  .button-clear {
    width: 100%;
  }

  .item-category-select {
    min-width: 100px;
    font-size: 0.7rem;
  }

  body.store-mode .item-category-select {
    min-width: 120px;
  }
}

@media (max-width: 480px) {
  .description {
    font-size: 0.875rem;
  }

  .item-item {
    flex-wrap: wrap;
  }

  .item-category-select {
    width: 100%;
    opacity: 1;
    margin-top: 0.5rem;
  }

  .item-delete {
    position: absolute;
    right: 0.75rem;
  }
}
