/* meal-input.css — 食事入力UI共通スタイル
   index.html と dashboard.html で共有される
   アコーディオン、スライダー、ドリンク、砂糖入力等 */

.accordion-section {
  background: linear-gradient(180deg, #0b1221, #0c1220);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: all 0.3s;
}

.accordion-header,
.accordion-section.empty .accordion-header,
.accordion-section.filled .accordion-header {
  padding: 14px 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 211, 238, 0.15));
  border-bottom: 1px solid rgba(34, 211, 238, 0.3);
  transition: all 0.3s;
  user-select: none;
}

.accordion-header:hover,
.accordion-section.empty .accordion-header:hover,
.accordion-section.filled .accordion-header:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 211, 238, 0.2));
}

.accordion-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.accordion-section.filled .accordion-badge {
  background: rgba(34, 197, 94, 0.3);
  color: var(--green);
}

.accordion-icon {
  font-size: 18px;
  transition: transform 0.3s;
  color: var(--muted);
}

.accordion-section.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 18px;
}

.accordion-section.open .accordion-body {
  max-height: 3000px;
  padding: 18px;
}

.consumed-slider-container {
  position: relative;
  padding: 16px 10px;
}

.consumed-slider {
  width: 100%;
  height: 8px;
  background: linear-gradient(to right,
      rgba(239, 68, 68, 0.3) 0%,
      rgba(245, 158, 11, 0.3) 25%,
      rgba(34, 197, 94, 0.3) 47%,
      rgba(59, 130, 246, 0.3) 100%);
  border-radius: 4px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.consumed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--acc);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34, 211, 238, 0.4);
  transition: all 0.2s;
}

.consumed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.consumed-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--acc);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(34, 211, 238, 0.4);
}

.consumed-value {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--acc);
  margin-bottom: 6px;
}

.consumed-label {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.consumed-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 10px;
}

.consumed-mark {
  font-size: 10px;
  color: var(--muted);
}

.drinks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.drink-item {
  background: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
}

.drink-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.drink-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--acc);
}

.drink-remove-btn {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.drink-remove-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.drink-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.drink-group-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.drink-group-label:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.drink-type-item {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 7px 3px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  user-select: none;
}

.drink-type-item:hover {
  border-color: rgba(34, 211, 238, 0.3);
}

.drink-type-item.selected {
  border-color: var(--acc);
  background: rgba(34, 211, 238, 0.1);
}

.drink-emoji {
  font-size: 20px;
  margin-bottom: 2px;
}

.drink-name {
  font-size: 9px;
  color: var(--fg);
}

.drink-volumes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.drink-volume-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 7px 3px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-size: 11px;
  color: var(--fg);
  user-select: none;
}

.drink-volume-btn:hover {
  border-color: rgba(34, 211, 238, 0.3);
}

.drink-volume-btn.selected {
  border-color: var(--acc);
  background: rgba(34, 211, 238, 0.1);
  color: var(--acc);
}

.custom-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px;
  color: var(--fg);
  font-size: 12px;
  margin-top: 6px;
}

.custom-input:focus {
  outline: none;
  border-color: var(--acc);
}

.add-drink-btn {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.add-drink-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(6, 182, 212, 0.3);
}

.juice-subtype-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.juice-subtype-btn:hover {
  border-color: var(--acc);
  background: rgba(34, 211, 238, 0.1);
}

.juice-subtype-btn.selected {
  border-color: var(--acc);
  background: rgba(34, 211, 238, 0.15);
  color: var(--acc);
  font-weight: 600;
}

.sugar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--acc), #06b6d4);
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.sugar-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.4);
}

.sugar-btn:active {
  transform: scale(0.95);
}

.sugar-value {
  min-width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.dairy-presence-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.dairy-presence-btn:hover {
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.05);
}

.dairy-presence-btn.selected[data-value="yes"] {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.dairy-presence-btn.selected[data-value="no"] {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.dairy-presence-btn.selected[data-value="unknown"] {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.dairy-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.dairy-product-item {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 5px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  user-select: none;
}

.dairy-product-item:hover {
  border-color: rgba(34, 211, 238, 0.3);
}

.dairy-product-item.selected {
  border-color: var(--acc);
  background: rgba(34, 211, 238, 0.1);
}

.dairy-product-emoji {
  font-size: 20px;
  margin-bottom: 3px;
}

.dairy-product-name {
  font-size: 10px;
  color: var(--fg);
}

.usage-reason-item {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.usage-reason-item:hover {
  border-color: rgba(34, 211, 238, 0.3);
}

.usage-reason-item.selected {
  border-color: var(--acc);
  background: rgba(34, 211, 238, 0.1);
}

.usage-reason-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.usage-reason-item.selected .usage-reason-checkbox {
  background: var(--acc);
  border-color: var(--acc);
}

.usage-reason-checkbox::after {
  content: '✓';
  color: #0f172a;
  font-weight: bold;
  font-size: 11px;
  display: none;
}

.usage-reason-item.selected .usage-reason-checkbox::after {
  display: block;
}

.usage-reason-label {
  font-size: 12px;
  color: var(--fg);
  flex: 1;
}

[data-theme="light"] .meal-type-btn:hover,
[data-theme="light"] .meal-type-btn.active {
  background: rgba(255, 136, 0, 0.12);
}

[data-theme="light"] .accordion-header,
[data-theme="light"] .accordion-section.empty .accordion-header,
[data-theme="light"] .accordion-section.filled .accordion-header {
  background: var(--heading-bg) !important;
  border-bottom: 2px solid var(--heading-border) !important;
  color: var(--fg) !important;
}

[data-theme="light"] .accordion-header:hover,
[data-theme="light"] .accordion-section.empty .accordion-header:hover,
[data-theme="light"] .accordion-section.filled .accordion-header:hover {
  background: #e6f0c8 !important;
}

[data-theme="light"] .consumed-display {
  background: rgba(255, 136, 0, 0.1);
}

[data-theme="light"] .add-drink-btn,
[data-theme="light"] .add-drink-btn:hover {
  box-shadow: 0 2px 8px rgba(255, 136, 0, 0.3);
}

[data-theme="light"] .drink-item:focus-within {
  box-shadow: 0 0 0 2px rgba(255, 136, 0, 0.15);
}

[data-theme="light"] .dairy-product-item:focus-within {
  box-shadow: 0 0 0 2px rgba(255, 136, 0, 0.15);
}

[data-theme="light"] .juice-subtype-btn.selected {
  background: rgba(255, 136, 0, 0.15);
}

[data-theme="light"] .juice-subtype-btn:hover {
  background: rgba(255, 136, 0, 0.1);
}