/* GymDiet Master — Voice Food Input & Barcode Scanner Styles */

/* --- Diary Smart Buttons --- */
.diary-smart-inputs {
  display: flex;
  gap: 10px;
  margin: 12px 0 16px;
  width: 100%;
  box-sizing: border-box;
}

.btn-smart-input {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-smart-input:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.btn-voice-input {
  border-color: rgba(0, 240, 118, 0.35);
  background: linear-gradient(135deg, rgba(0, 240, 118, 0.1), rgba(0, 240, 118, 0.05));
}

.btn-voice-input:hover {
  border-color: #00f076;
  box-shadow: 0 0 16px rgba(0, 240, 118, 0.25);
}

.btn-barcode-input {
  border-color: rgba(0, 240, 118, 0.35);
  background: linear-gradient(135deg, rgba(0, 240, 118, 0.1), rgba(0, 240, 255, 0.05));
}

.btn-barcode-input:hover {
  border-color: #00f076;
  box-shadow: 0 0 16px rgba(0, 240, 118, 0.25);
}

.smart-input-icon {
  font-size: 18px;
}

/* --- Voice Input Modal --- */
.voice-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(5, 9, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: vFadeIn 0.25s ease-out;
}

@keyframes vFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.voice-modal-box {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  background: linear-gradient(165deg, #111827 0%, #0d1424 60%, #070c16 100%);
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.15);
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  animation: vSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vSlideUp {
  from { transform: translateY(30px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.voice-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.voice-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.voice-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.voice-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  gap: 16px;
}

/* Pulsing Microphone Visualizer */
.voice-mic-container {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.voice-mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f0ff 0%, #00f076 100%);
  border: none;
  font-size: 34px;
  color: #050a12;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
  z-index: 2;
  transition: transform 0.2s;
}

.voice-mic-btn:hover {
  transform: scale(1.05);
}

.voice-mic-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.6);
  animation: vPulse 1.6s ease-out infinite;
  pointer-events: none;
}

.voice-mic-pulse:nth-child(2) {
  animation-delay: 0.5s;
}

@keyframes vPulse {
  0% { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.voice-status-text {
  font-size: 15px;
  font-weight: 700;
  color: #00f0ff;
  text-align: center;
}

.voice-transcript-box {
  width: 100%;
  min-height: 60px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 12px 16px;
  box-sizing: border-box;
  font-size: 14px;
  color: #f1f5f9;
  line-height: 1.5;
  text-align: center;
}

.voice-transcript-box.placeholder {
  color: #64748b;
  font-style: italic;
}

/* Parsed Food Items List */
.voice-parsed-items {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-item-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.voice-item-meta {
  font-size: 12px;
  color: #94a3b8;
}

.voice-item-macros {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.voice-item-cals {
  font-size: 15px;
  font-weight: 800;
  color: #00f076;
}

.voice-item-bju {
  font-size: 11px;
  color: #cbd5e1;
}

/* Meal Type Selector */
.voice-meal-select {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.voice-meal-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.voice-meal-btn.active {
  background: rgba(0, 240, 118, 0.2);
  border-color: #00f076;
  color: #00f076;
}

/* --- Barcode Scanner Styles --- */
.barcode-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10070;
  background: #000;
  display: flex;
  flex-direction: column;
}

.barcode-viewport-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.barcode-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.barcode-video.is-active {
  opacity: 1;
}

.barcode-scanner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.barcode-reticle {
  width: 280px;
  height: 180px;
  border: 2px solid #00f076;
  border-radius: 20px;
  position: relative;
  box-shadow: 0 0 25px rgba(0, 240, 118, 0.25), 0 0 0 4000px rgba(0, 0, 0, 0.85);
}

.barcode-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00f076, #00f076, transparent);
  box-shadow: 0 0 12px #00f076;
  animation: laserScan 2s ease-in-out infinite;
}

@keyframes laserScan {
  0% { top: 10%; opacity: 0.4; }
  50% { top: 90%; opacity: 1; }
  100% { top: 10%; opacity: 0.4; }
}

.barcode-top-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.barcode-action-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(11, 17, 24, 0.85);
  border: 1px solid rgba(0, 240, 118, 0.35);
  color: #00f076;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.barcode-tip {
  position: absolute;
  bottom: 84px;
  background: rgba(8, 12, 20, 0.9);
  border: 1px solid rgba(0, 240, 118, 0.4);
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

/* Product Result Sheet */
.barcode-result-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #070a10;
  border-top: 1px solid rgba(0, 240, 118, 0.35);
  border-radius: 28px 28px 0 0;
  padding: 24px;
  box-sizing: border-box;
  animation: vSlideUp 0.25s ease-out;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.barcode-prod-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.barcode-prod-thumb {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.barcode-prod-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.barcode-prod-brand {
  font-size: 13px;
  color: #00f076;
  margin-top: 2px;
  font-weight: 600;
}

.barcode-sheet-top {
  width: 100%;
}

.barcode-sheet-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.barcode-sheet-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: scale(1.05);
}

/* Result Sheet Container - Dark Neon Style */
.barcode-result-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #0d1322 0%, #060911 100%);
  border-top: 1px solid rgba(0, 240, 118, 0.3);
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 240, 118, 0.08);
  border-radius: 28px 28px 0 0;
  padding: 20px 20px 28px;
  box-sizing: border-box;
  animation: vSlideUp 0.25s ease-out;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Health Score Card */
.barcode-health-card {
  background: rgba(0, 240, 118, 0.04);
  border: 1px solid rgba(0, 240, 118, 0.22);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.barcode-health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.barcode-health-badge {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.barcode-score-num {
  font-size: 22px;
  font-weight: 900;
  color: #00f076;
  text-shadow: 0 0 10px rgba(0, 240, 118, 0.4);
}

.barcode-score-denom {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
}

.barcode-score-label {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.barcode-health-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.barcode-pill {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.barcode-pill--nova {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.barcode-health-verdict {
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 12px;
  border-left: 3px solid #00f076;
}

/* Macro & Portions Box */
.barcode-macro-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.barcode-portion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.barcode-portion-input {
  width: 76px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 118, 0.4);
  border-radius: 10px;
  color: #00f076;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  padding: 6px 8px;
  outline: none;
}

.barcode-portion-input:focus {
  border-color: #00f076;
  box-shadow: 0 0 10px rgba(0, 240, 118, 0.3);
}

.barcode-quick-portions {
  display: flex;
  gap: 6px;
}

.barcode-quick-pbtn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.barcode-quick-pbtn:hover {
  background: rgba(0, 240, 118, 0.15);
  border-color: #00f076;
  color: #00f076;
}

/* Ingredients Box */
.barcode-ingredients-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.barcode-ing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.barcode-ing-toggle {
  background: transparent;
  border: none;
  color: #00f076;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.barcode-ing-text {
  font-size: 12px;
  line-height: 1.5;
  color: #94a3b8;
  word-break: break-word;
}

.barcode-ing-text.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
