/* Input Methods Tutorial Modal Styles */
.tutorial-slide {
  padding: 20px 10px;
}

.tutorial-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 15px;
}

.tutorial-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  margin: 0 auto 25px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  color: white;
}

.primary-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.photo-gradient {
  background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
}

.voice-gradient {
  background: linear-gradient(135deg, #dc3545 0%, #ff6b81 100%);
}

.text-gradient {
  background: linear-gradient(135deg, #2196F3 0%, #03A9F4 100%);
}

.tutorial-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 15px;
}

.tutorial-description {
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Tutorial indicators (dots) */
.tutorial-indicators {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 20px;
  z-index: 5;
  padding: 0;
  list-style: none;
}

.tutorial-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  margin: 0 5px;
  opacity: 1;
  flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  padding: 0;
  cursor: pointer;
}

.tutorial-indicators button.active {
  background-color: #F01B42;
  width: 12px;
  height: 12px;
  transform: scale(1.1);
}

/* Fix carousel container */
#tutorialCarousel {
  position: relative;
  overflow: visible;
}

/* Override Bootstrap defaults */
.carousel-indicators [data-bs-target] {
  box-sizing: content-box;
  border: 0;
  width: 10px;
  height: 10px;
  margin: 0 5px;
}

/* Navigation buttons */
.tutorial-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding: 0 20px 20px;
}

.tutorial-control {
  position: static;
  background-color: rgba(255, 255, 255, 0.1);
  width: auto;
  height: auto;
  padding: 10px 20px;
  border-radius: 30px;
  opacity: 1;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.tutorial-control:hover {
  background-color: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.tutorial-control i {
  font-size: 16px;
  margin: 0 5px;
}

.tutorial-control span {
  font-size: 14px;
  font-weight: 600;
}

/* Feature items (on intro slide) */
.tutorial-features {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px auto 30px;
  max-width: 600px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 120px;
  transition: transform 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-5px);
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 15px;
}

.photo-icon {
  background-color: rgba(76, 175, 80, 0.1);
  color: #4CAF50;
}

.voice-icon {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.text-icon {
  background-color: rgba(33, 150, 243, 0.1);
  color: #2196F3;
}

/* Enhanced feature divider */
.feature-divider {
  position: relative;
  width: 50px;
  height: 2px;
  background: linear-gradient(to right,
    rgba(255, 255, 255, 0.01),
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.01));
  margin: 0 15px;
  border-radius: 2px;
}

.feature-divider::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(240, 27, 66, 0.5);
}

/* Demo flow */
.demo-flow {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
}

.demo-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100px;
}

.step-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
}

.step-text {
  font-size: 14px;
  color: var(--text-tertiary);
}

.flow-arrow {
  margin: 0 15px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* Phone mockup (photo input) */
.demo-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.phone-mockup {
  width: 200px;
  height: 360px; /* 16:9 aspect ratio approximately */
  background-color: #111;
  border-radius: 30px;
  padding: 10px;
  position: relative;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.phone-screen {
  width: 100%;
  height: 100%;
  background-color: #333;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.camera-target {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 10px;
}

.camera-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  opacity: 0;
  z-index: 3;
  animation: flash 5s infinite;
}

@keyframes flash {
  0%, 100% { opacity: 0; }
  15% { opacity: 0.7; }
  18% { opacity: 0; }
}

.food-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.phone-button {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.preview-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 24px;
  color: var(--text-tertiary);
}

/* Voice mockup */
.voice-mockup {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.voice-recorder {
  width: 250px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.recorder-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #dc3545;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
  color: white;
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin-bottom: 20px;
  width: 100%;
}

.waveform span {
  display: block;
  width: 3px;
  margin: 0 2px;
  background-color: #dc3545;
  animation: wave 1.5s infinite ease-in-out;
}

.waveform span:nth-child(1) { animation-delay: 0s; height: 10px; }
.waveform span:nth-child(2) { animation-delay: 0.1s; height: 15px; }
.waveform span:nth-child(3) { animation-delay: 0.2s; height: 25px; }
.waveform span:nth-child(4) { animation-delay: 0.3s; height: 30px; }
.waveform span:nth-child(5) { animation-delay: 0.4s; height: 25px; }
.waveform span:nth-child(6) { animation-delay: 0.5s; height: 15px; }
.waveform span:nth-child(7) { animation-delay: 0.6s; height: 10px; }

@keyframes wave {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.5);
  }
}

.voice-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  font-style: italic;
}

/* Text mockup */
.text-mockup {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.text-input {
  width: 250px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-header {
  background-color: rgba(33, 150, 243, 0.2);
  padding: 15px;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.input-body {
  padding: 15px;
  min-height: 150px;
}

/* Fixed typewriter effect - removed cursor */
.typewriter {
  margin: 0;
  white-space: pre-wrap;
  height: auto;
  min-height: 120px;
  position: relative;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Result card */
.result-card {
  width: 250px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-header {
  background-color: rgba(240, 27, 66, 0.2);
  padding: 15px;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-body {
  padding: 15px;
}

.result-item {
  margin-bottom: 15px;
}

.result-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 5px;
}

.result-value {
  font-size: 15px;
  font-weight: 600;
}

.result-macros {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.macro-item {
  text-align: center;
  width: 70px;
}

.macro-value {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 5px;
}

.macro-label {
  font-size: 12px;
  color: var(--text-tertiary);
}

.protein {
  color: #4CAF50;
}

.carbs {
  color: #2196F3;
}

.fat {
  color: #FFC107;
}

/* Completion slide */
.input-methods-summary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 30px;
  margin-bottom: 30px;
}

.method-card {
  width: 150px;
  height: 150px;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.method-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.photo-card {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(139, 195, 74, 0.2) 100%);
}

.voice-card {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(255, 107, 129, 0.2) 100%);
}

.text-card {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.2) 0%, rgba(3, 169, 244, 0.2) 100%);
}

.method-icon {
  font-size: 32px;
  margin-bottom: 15px;
}

.photo-card .method-icon { color: #4CAF50; }
.voice-card .method-icon { color: #dc3545; }
.text-card .method-icon { color: #2196F3; }

.method-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}

.method-text {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

.tutorial-done-btn {
  box-shadow: 0 5px 15px rgba(240, 27, 66, 0.3);
  transition: all 0.3s ease;
}

.tutorial-done-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(240, 27, 66, 0.4);
}

/* IMPROVED RESPONSIVE DESIGN FOR MOBILE */

/* Remove arrows in flow and between components on medium and small screens */
@media (max-width: 992px) {
  /* Hide the arrows on medium screens and below */
  .flow-arrow,
  .preview-arrow {
    display: none;
  }
}

@media (max-width: 768px) {
  .tutorial-title {
    font-size: 22px;
    margin-bottom: 10px;
  }

  .tutorial-description {
    font-size: 14px;
    margin-bottom: 20px;
  }

  /* Keep the dividers visible on tablets */
  .tutorial-features {
    flex-wrap: nowrap;
    margin: 20px auto;
    padding: 0 10px;
  }

  .feature-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
    margin-bottom: 10px;
  }

  /* Make demo flow more compact for mobile */
  .demo-flow {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }

  .demo-step {
    width: 90px;
  }

  .step-icon {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  /* Stack the mockup components in a grid */
  .demo-preview, .voice-mockup, .text-mockup {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
  }

  /* Fixed phone mockup aspect ratio on medium screens */
  .phone-mockup {
    width: 180px;
    height: 320px; /* ~16:9 aspect ratio */
  }

  .tutorial-navigation {
    padding: 0 10px 10px;
  }

  .tutorial-control {
    padding: 8px 12px;
  }

  .tutorial-control i {
    font-size: 14px;
  }

  .tutorial-control span {
    font-size: 12px;
  }
}

/* Small phones */
@media (max-width: 576px) {
  .tutorial-content {
    padding: 10px 5px;
  }

  .tutorial-icon {
    width: 80px;
    height: 80px;
    font-size: 32px;
    margin-bottom: 15px;
  }

  /* Compress feature items and dividers */
  .tutorial-features {
    flex-wrap: nowrap;
    margin: 15px auto;
    padding: 0;
  }

  .feature-item {
    width: 90px;
    padding: 5px;
  }

  .feature-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-bottom: 8px;
  }

  .feature-divider {
    width: 30px;
    margin: 0 5px;
  }

  /* Remove flow arrows on small screens */
  .flow-arrow {
    display: none;
  }

  .demo-flow {
    justify-content: space-around;
    margin-bottom: 15px;
    gap: 10px;
  }

  .demo-step {
    width: 80px;
  }

  .step-text {
    font-size: 12px;
  }

  /* Stack mockup components vertically */
  .demo-preview, .voice-mockup, .text-mockup {
    flex-direction: column;
    align-items: center;
  }

  /* Hide arrows between mockup components */
  .preview-arrow {
    display: none;
  }

  /* Fixed phone mockup for small screens - maintain proper phone aspect ratio */
  .phone-mockup {
    width: 160px; /* Narrower width */
    height: 320px; /* Taller height to maintain phone aspect ratio */
    max-width: 90%;
    border-radius: 24px; /* Slightly smaller radius */
    margin: 0 auto 20px;
  }

  .voice-recorder, .text-input, .result-card {
    width: 100%;
    max-width: 280px;
    margin-bottom: 15px;
  }

  /* Make method cards smaller */
  .input-methods-summary {
    gap: 10px;
  }

  .method-card {
    width: 100px;
    height: 130px;
    padding: 15px 10px;
  }

  .method-icon {
    font-size: 24px;
    margin-bottom: 10px;
  }

  .method-name {
    font-size: 14px;
  }

  .method-text {
    font-size: 11px;
  }

  /* Make sure modals don't exceed screen height */
@media (max-width: 576px) {
  .modal-dialog {
    margin: 10px;
    width: calc(100% - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
  }

  .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal-header {
    flex-shrink: 0;
  }

  .modal-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  }

  .modal-body::-webkit-scrollbar {
    width: 6px;
  }

  .modal-body::-webkit-scrollbar-track {
    background: transparent;
  }

  .modal-body::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
  }
}

  .tutorial-control span {
    display: none;
  }

  .tutorial-navigation {
    padding: 0 5px 5px;
  }
}