/* === Farm 14 Kiosk Reference UI - Mobile Optimized === */
:root {
  --vh: 1vh;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', Arial, sans-serif;
  min-height: 100vh;
  background: #f5e7c0;
  overflow-x: hidden;
  overflow-y: visible;
  touch-action: pan-y;
  -webkit-tap-highlight-color: rgba(255, 224, 130, 0.3);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-overflow-scrolling: touch;
}

/* Prevent zoom on input focus for iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

.background-blur {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(40, 30, 10, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 0;
}
.background {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  object-fit: cover;
  z-index: -1;
}
.corner-icons { position: fixed; top: 0; left: 0; width: 100vw; z-index: 2; }
.corner-icon.logo { position: absolute; left: 2vw; top: 2vw; width: 48px; opacity: 0.18; }
.screen {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  display: none; align-items: flex-start; justify-content: center; z-index: 10;
  padding: 1rem;
  padding-top: max(1rem, var(--safe-area-top));
  padding-bottom: max(1rem, var(--safe-area-bottom));
  padding-left: max(1rem, var(--safe-area-left));
  padding-right: max(1rem, var(--safe-area-right));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.screen.active { display: flex; }
.card {
  background: rgba(40, 30, 10, 0.88);
  border-radius: 24px;
  box-shadow: 0 8px 40px #0007;
  padding: 2.5rem 2.5rem 2rem 2.5rem;
  min-width: 340px; max-width: 420px; width: 90vw;
  text-align: center; color: #fffbe9; position: relative;
  animation: fadeIn 0.7s;
  margin: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.title { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.7rem; text-shadow: 0 2px 8px #0008; }
.subtitle { font-size: 1.1rem; font-weight: 400; margin-bottom: 2.2rem; opacity: 0.92; }
.big-btn {
  background: #fffbe9; color: #4b3c1a; border: none; border-radius: 50px;
  font-size: 1.1rem; font-weight: 600; padding: 1.1rem 2.5rem; margin: 1.2rem 0 0.7rem 0;
  cursor: pointer; box-shadow: 0 2px 12px #0003; display: flex; align-items: center; gap: 0.7rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  min-height: 48px; /* Minimum touch target size */
  touch-action: manipulation;
}
.big-btn:hover, .big-btn:active { background: #ffe082; color: #2d230a; transform: translateY(-2px); }
.btn-icon { font-size: 1.5rem; }
.lang-btn, .lang-option {
  background: none; border: 2px solid #fffbe9; color: #fffbe9; border-radius: 18px;
  font-size: 1rem; font-weight: 600; padding: 0.3rem 1.2rem; cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-height: 44px; /* Minimum touch target size */
  touch-action: manipulation;
}
.lang-btn.active, .lang-btn:hover, .lang-option.active, .lang-option:hover {
  background: #fffbe9; color: #4b3c1a;
}
.detection-card video {
  width: 180px; height: 140px; border-radius: 16px; margin: 1.2rem 0 1.2rem 0;
  box-shadow: 0 2px 16px #0005; background: #222;
}
.countdown { margin-bottom: 1.2rem; }
#countdownNumber { font-size: 2.2rem; font-weight: 700; color: #ffe082; margin-right: 0.5rem; }
#countdownLabel { font-size: 1rem; color: #fffbe9; }
.detection-actions { display: flex; justify-content: center; gap: 1.2rem; margin-top: 1.2rem; }
.green-btn {
  background: #4CAF50; color: #fff; border: none; border-radius: 18px;
  font-size: 1.1rem; font-weight: 600; padding: 0.7rem 2.2rem; cursor: pointer;
  box-shadow: 0 2px 12px #0003; transition: background 0.2s, transform 0.2s;
  min-height: 44px; /* Minimum touch target size */
  touch-action: manipulation;
}
.green-btn:hover, .green-btn:active { background: #388e3c; transform: translateY(-2px); }
.outline-btn {
  background: none; color: #fffbe9; border: 2px solid #fffbe9; border-radius: 18px;
  font-size: 1.1rem; font-weight: 600; padding: 0.7rem 2.2rem; cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-height: 44px; /* Minimum touch target size */
  touch-action: manipulation;
}
.outline-btn:hover, .outline-btn:active { background: #fffbe9; color: #4b3c1a; }
.message-card .logo-row {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem; margin-bottom: 1.2rem;
}
.logo { width: 48px; height: 48px; border-radius: 12px; box-shadow: 0 2px 8px #0002; }
.farm14-title { font-size: 1.3rem; font-weight: 700; color: #ffe082; letter-spacing: 1px; }
.welcome-message-box {
  background: #fff; color: #388e3c; border-radius: 14px; box-shadow: 0 2px 12px #0002;
  padding: 1.1rem 1.5rem; margin: 1.2rem 0 1.2rem 0; display: flex; align-items: center; gap: 1rem;
  font-size: 1.1rem; font-weight: 600; justify-content: center;
}
.speaker-icon { width: 32px; height: 32px; }
.playing-indicator {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; color: #ffe082;
  font-size: 1.1rem; margin-bottom: 1.2rem;
}
.music-note { font-size: 1.3rem; }
.next-step { margin-top: 1.2rem; font-size: 0.95rem; color: #ffe082; opacity: 0.85; }

/* Enhanced Mobile Responsive Design */
@media (max-width: 600px) {
  body {
    overflow: visible !important;
    touch-action: auto !important;
    height: auto !important;
    min-height: 100vh !important;
  }
  
  .screen {
    position: relative !important;
    width: 100vw !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    touch-action: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1rem !important;
  }
  
  .screen.active {
    display: block !important;
  }
  
  .card { 
    padding: 1.5rem 1rem 1rem 1rem; 
    min-width: 0; 
    max-width: 95vw; 
    margin: 0.5rem auto;
    border-radius: 20px;
  }
  .title { font-size: 1.8rem; }
  .subtitle { font-size: 1rem; margin-bottom: 1.5rem; }
  .big-btn { 
    font-size: 1rem; 
    padding: 1rem 2rem; 
    min-height: 48px;
    width: 100%;
    max-width: 280px;
    margin: 1rem auto;
  }
  .logo { width: 40px; height: 40px; }
  .corner-icon { width: 36px !important; }
  .detection-card video { 
    width: 90vw; 
    height: 120px; 
    max-width: 300px;
  }
  .detection-actions { 
    flex-direction: column; 
    gap: 0.8rem; 
    width: 100%;
    max-width: 280px;
    margin: 1rem auto;
  }
  .green-btn, .outline-btn { 
    width: 100%; 
    font-size: 1rem; 
    padding: 0.8rem 1.5rem;
    min-height: 48px;
  }
}

.lang-card { padding-top: 2.2rem; padding-bottom: 2.2rem; }
.lang-emoji { font-size: 2.2rem; margin-bottom: 1.2rem; }
.lang-title { font-size: 2rem; font-weight: 700; color: #fffbe9; margin-bottom: 0.2rem; text-shadow: 0 2px 8px #0008; }
.lang-title-ar { font-size: 1.3rem; font-weight: 600; color: #ffe082; margin-bottom: 1.5rem; letter-spacing: 1px; }
.lang-options { display: flex; gap: 2rem; justify-content: center; margin-bottom: 1.5rem; }
.lang-option {
  background: #fff; color: #4b3c1a; border: none; border-radius: 18px; box-shadow: 0 2px 12px #0002;
  padding: 1.5rem 2.2rem; min-width: 160px; display: flex; flex-direction: column; align-items: center;
  cursor: pointer; transition: box-shadow 0.2s, transform 0.2s, background 0.2s; font-size: 1.1rem; position: relative;
  min-height: 120px; /* Minimum touch target size */
  touch-action: manipulation;
}
.lang-option:hover, .lang-option:active {
  background: #ffe082; color: #2d230a; transform: translateY(-2px) scale(1.04); box-shadow: 0 4px 24px #ffe08255;
}
.lang-flag { width: 38px; height: 28px; margin-bottom: 0.7rem; border-radius: 6px; box-shadow: 0 1px 4px #0002; }
.lang-label-main { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; }
.lang-label-sub { font-size: 0.95rem; color: #4b3c1a; opacity: 0.8; margin-bottom: 0.7rem; }
.lang-arrow { font-size: 1.3rem; color: #4CAF50; position: absolute; bottom: 1.1rem; right: 1.2rem; }
.lang-note { font-size: 0.95rem; color: #ffe082; opacity: 0.85; margin-top: 1.2rem; text-align: center; }

@media (max-width: 600px) {
  .lang-card { padding: 1.5rem 1rem; }
  .lang-title { font-size: 1.6rem; }
  .lang-title-ar { font-size: 1.1rem; }
  .lang-options { 
    flex-direction: column; 
    gap: 1rem; 
    width: 100%;
    max-width: 280px;
    margin: 1rem auto;
  }
  .lang-option { 
    min-width: 0; 
    width: 100%; 
    padding: 1.2rem 1.5rem;
    min-height: 100px;
  }
  .lang-emoji { font-size: 1.8rem; }
}

.assistant-card { 
  padding: 0; 
  max-width: 600px; 
  min-width: 320px; 
  width: 95vw; 
  height: 90vh;
  display: flex; 
  flex-direction: column; 
  background: rgba(40, 30, 10, 0.96);
  border-radius: 20px;
  overflow: hidden;
}
.assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 3rem 1.2rem 3rem;
  border-bottom: 1px solid #ffe08233;
  background: rgba(40, 30, 10, 0.98);
  position: relative;
  min-height: 60px;
}
.assistant-title { font-size: 1.2rem; font-weight: 700; color: #ffe082; letter-spacing: 1px; }
.assistant-clock { font-size: 1rem; color: #ffe082; font-family: monospace; }
.assistant-main { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  padding: 1.5rem 1.2rem 0.5rem 1.2rem; 
  gap: 1.2rem; 
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.avatar-area { display: flex; flex-direction: column; align-items: center; margin-bottom: 0.5rem; }
.assistant-avatar { 
  width: 110px; 
  height: 110px; 
  border-radius: 50%; 
  object-fit: cover; 
  box-shadow: 0 4px 24px #0007; 
  background: #fffbe9; 
  border: 4px solid #ffe082; 
  transition: box-shadow 0.3s, border 0.3s; 
}
.assistant-avatar.speaking, .assistant-avatar.listening { 
  box-shadow: 0 0 32px 8px #ffe082, 0 8px 32px #0007; 
  border: 4px solid #ffd54f; 
  animation: avatarGlow 1.2s infinite alternate; 
}
@keyframes avatarGlow { 
  0% { box-shadow: 0 0 32px 8px #ffe082, 0 8px 32px #0007; } 
  100% { box-shadow: 0 0 48px 16px #ffe082, 0 8px 32px #0007; } 
}
.avatar-status { 
  width: 18px; 
  height: 18px; 
  border-radius: 50%; 
  background: #4CAF50; 
  border: 3px solid #fff; 
  margin-top: -18px; 
  margin-left: 80px; 
  box-shadow: 0 2px 8px #0002; 
}
.chat-area {
  width: 100%;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  background: #fffbe9;
  border-radius: 18px;
  padding: 1.7rem 1.7rem;
  margin-bottom: 0.7rem;
  box-shadow: 0 4px 24px #0003, 0 2px 12px #ffe08255;
  color: #4b3c1a;
  font-size: 1.18rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  border: 2px solid #ffe082;
  -webkit-overflow-scrolling: touch;
}
.message { display: flex; align-items: flex-start; gap: 0.7rem; }
.message.user { justify-content: flex-end; }
.message.assistant { justify-content: flex-start; flex-direction: column; align-items: flex-start; }
.bubble {
  padding: 1.2rem 1.5rem;
  border-radius: 20px;
  max-width: 90%;
  box-shadow: 0 2px 12px #0001;
  font-size: 1.18rem;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.bubble.user { background: #ffe082; color: #4b3c1a; align-self: flex-end; }
.bubble.assistant { background: #fff; color: #388e3c; align-self: flex-start; }
.image-carousel { 
  display: flex; 
  gap: 1rem; 
  margin-top: 1rem; 
  overflow-x: auto; 
  max-width: 100%; 
  min-height: 40px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  justify-content: flex-start;
}
.image-carousel::-webkit-scrollbar { display: none; }
.image-carousel img { 
  width: 160px; 
  height: 120px; 
  object-fit: cover; 
  border-radius: 12px; 
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
  background: #fffbe9; 
  border: 2px solid #ffe082; 
  transition: transform 0.2s;
  flex-shrink: 0;
}
.image-carousel img:hover, .image-carousel img:active { 
  transform: scale(1.04); 
  box-shadow: 0 8px 32px #ffe08299; 
}
.assistant-footer { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  padding: 1.2rem 0.5rem 1.2rem 0.5rem; 
  background: rgba(40, 30, 10, 0.98); 
  border-top: 1px solid #ffe08233;
  min-height: 120px;
}
.mic-btn {
  background: linear-gradient(135deg, #ffe082 60%, #ffd54f 100%);
  border: none;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  box-shadow: 0 4px 24px #0004, 0 0 32px #ffe08255;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.7rem;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s, background 0.2s;
  position: relative;
  touch-action: manipulation;
  min-height: 80px; /* Minimum touch target size */
}
.mic-btn:active {
  transform: scale(0.93);
  box-shadow: 0 2px 12px #0002, 0 0 24px #ffe08299;
}
.mic-btn.listening {
  box-shadow: 0 0 0 0 #ffe082, 0 0 32px #ffe08299, 0 4px 24px #0004;
  animation: micPulse 1.2s infinite alternate;
  background: linear-gradient(135deg, #fffbe9 60%, #ffe082 100%);
}
.mic-btn.speaking {
  background: linear-gradient(135deg, #ffd54f 60%, #ffe082 100%);
  box-shadow: 0 0 24px 8px #ffd54f99, 0 4px 24px #0004;
}
.mic-btn.processing {
  background: linear-gradient(135deg, #ffe082 60%, #bdbdbd 100%);
  box-shadow: 0 0 16px 4px #bdbdbd99, 0 4px 24px #0004;
}
.mic-btn.disabled {
  background: #e0e0e0;
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}
@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 #ffe082, 0 0 32px #ffe08299, 0 4px 24px #0004; }
  100% { box-shadow: 0 0 32px 16px #ffe082, 0 0 48px #ffe08299, 0 4px 24px #0004; }
}
.mic-btn img {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 8px #ffe08255);
  background: #fffbe9;
  border-radius: 50%;
  padding: 3px;
  transition: filter 0.2s;
}
.mic-status { 
  font-size: 1.05rem; 
  color: #ffe082; 
  margin-top: 0.2rem; 
  text-shadow: 1px 1px 6px #fffbe9;
  text-align: center;
  padding: 0 1rem;
}

/* Enhanced Mobile Responsive Design for Assistant */
@media (max-width: 600px) {
  .assistant-card { 
    max-width: 100vw; 
    min-width: 0; 
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  .assistant-header { 
    padding: 1rem 2.5rem; 
    min-height: 50px;
  }
  .assistant-title { font-size: 1rem; }
  .assistant-clock { font-size: 0.9rem; }
  .back-btn {
    left: 0.3rem;
    font-size: 1.3rem;
    min-height: 36px;
    min-width: 36px;
  }
  .assistant-main { 
    padding: 1rem 0.8rem 0.5rem 0.8rem; 
    gap: 0.8rem;
  }
  .assistant-avatar { 
    width: 80px; 
    height: 80px; 
    border: 3px solid #ffe082;
  }
  .avatar-status { 
    width: 16px; 
    height: 16px; 
    margin-top: -16px; 
    margin-left: 60px; 
  }
  .chat-area { 
    font-size: 1rem; 
    padding: 1.2rem 1rem; 
    min-height: 250px; 
    max-height: 60vh; 
    border-radius: 16px;
  }
  .bubble { 
    font-size: 1rem; 
    padding: 1rem 1.2rem; 
    max-width: 85%;
  }
  .image-carousel { 
    gap: 0.8rem; 
    margin-top: 0.8rem;
    width: 100%;
  }
  .image-carousel img { 
    width: 120px; 
    height: 90px; 
    border-radius: 10px;
  }
  .assistant-footer { 
    padding: 1rem 0.5rem 1rem 0.5rem; 
    min-height: 100px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    z-index: 99;
  }
  .mic-btn { 
    width: 70px; 
    height: 70px; 
    min-height: 70px;
  }
  .mic-btn img { 
    width: 36px; 
    height: 36px; 
  }
  .mic-status { 
    font-size: 0.95rem; 
    margin-top: 0.3rem;
  }
}

.lang-detect-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.2rem 1.5rem; background: rgba(40,30,10,0.97); border-radius: 18px; box-shadow: 0 2px 16px #0005;
  min-width: 320px; max-width: 420px; margin: 0 auto; gap: 1.2rem;
}
.mic-anim-area { display: flex; justify-content: center; align-items: center; margin-bottom: 1.2rem; }
.mic-anim { width: 64px; height: 64px; animation: micPulse 1.2s infinite alternate; }
@keyframes micPulse { 0% { filter: drop-shadow(0 0 0 #ffe082); } 100% { filter: drop-shadow(0 0 16px #ffe082); } }
.lang-detect-title, .lang-detect-title-ar {
  font-size: 1.3rem; font-weight: 700; color: #ffe082; text-align: center;
}
.lang-detect-desc, .lang-detect-desc-ar {
  font-size: 1rem; color: #fffbe9; text-align: center; margin-bottom: 0.5rem;
}
.lang-detect-status {
  font-size: 1.1rem; color: #4CAF50; font-weight: 600; margin: 0.7rem 0 0.7rem 0; text-align: center;
}
.lang-detect-note {
  font-size: 0.95rem; color: #ffe082; text-align: center; margin-top: 0.7rem;
}
.lang-detect-manual {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1.5rem;
  text-align: center;
}

.lang-detect-manual-text {
  margin-bottom: 1rem;
}

.lang-detect-manual-text p {
  font-size: 1rem;
  color: #ffe082;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.lang-detect-manual-text p[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

.lang-detect-manual-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  justify-content: center;
  max-width: 400px;
  margin: 0 auto;
}

.lang-detect-btn {
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 2px solid rgba(255, 224, 130, 0.4);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  min-height: 120px;
  transform: scale(1);
}

.lang-detect-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  border-color: rgba(255, 224, 130, 0.8);
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(255, 224, 130, 0.3);
}

/* Clean up - removed custom CSS in favor of Tailwind classes */

.lang-detect-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fffbe9;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 600px) {
  .lang-detect-card { 
    padding: 1.5rem 1rem; 
    min-width: 0; 
    max-width: 95vw;
    margin: 0.5rem;
  }
  .lang-detect-title, .lang-detect-title-ar { font-size: 1.1rem; }
  .lang-detect-desc, .lang-detect-desc-ar { font-size: 0.9rem; }
  .lang-detect-status { font-size: 1rem; }
  .lang-detect-note { font-size: 0.85rem; }
  .lang-detect-manual { 
    gap: 1.2rem; 
    margin-top: 1.2rem;
  }
  
  .lang-detect-manual-buttons {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 280px;
  }
  
  .lang-detect-btn {
    padding: 1.2rem 0.8rem;
    min-height: 100px;
  }
  
  .lang-detect-flag {
    width: 40px;
    height: 28px;
    font-size: 1.2rem;
  }
  
  .lang-detect-label {
    font-size: 1rem;
  }
  .mic-anim { width: 56px; height: 56px; }
}

.chat-image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.2rem 0 1.2rem 0;
  animation: fadeIn 0.7s;
}
.chat-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px #0003;
  background: #fffbe9;
  border: 2px solid #ffe082;
  transition: transform 0.2s;
  cursor: pointer;
}
.chat-image:hover, .chat-image:active {
  transform: scale(1.02);
  box-shadow: 0 8px 32px #ffe08299;
}
.chat-image-caption {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  color: #ffe082;
  text-align: center;
  font-weight: 600;
  text-shadow: 1px 1px 4px #0004;
}

.example-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1.2rem;
}
.example-question-btn {
  background: rgba(255, 224, 130, 0.15);
  color: #ffe082;
  border: 1px solid #ffe082;
  border-radius: 20px;
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  min-height: 44px; /* Minimum touch target size */
  touch-action: manipulation;
}
.example-question-btn:hover, .example-question-btn:active {
  background: #ffe082;
  color: #4b3c1a;
}

.back-btn {
  background: none;
  border: none;
  color: #ffe082;
  font-size: 1.5rem;
  cursor: pointer;
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  transition: color 0.2s;
  min-height: 40px; /* Minimum touch target size */
  min-width: 40px;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.back-btn:hover, .back-btn:active {
  color: #ffd54f;
}

.please-wait-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(40, 30, 10, 0.95);
  color: #ffe082;
  padding: 1.5rem 2rem;
  border-radius: 16px;
  box-shadow: 0 8px 32px #0008;
  z-index: 1000;
  display: none;
  align-items: center;
  gap: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.mic-tooltip {
  position: fixed;
  background: rgba(40, 30, 10, 0.95);
  color: #ffe082;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px #0006;
  z-index: 1000;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  animation: fadeIn 0.3s;
  max-width: 200px;
}

/* Modern Avatar Animations */
.assistant-avatar.listening {
  border-color: #f59e0b !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5), 0 8px 32px rgba(0, 0, 0, 0.3) !important;
  animation: avatarGlow 1.2s infinite alternate, pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.assistant-avatar.speaking {
  border-color: #10b981 !important;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.8), 0 12px 40px rgba(0, 0, 0, 0.4) !important;
  animation: avatarGlow 1.2s infinite alternate;
}

@keyframes avatarGlow {
  0% { 
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5), 0 8px 32px rgba(0, 0, 0, 0.3); 
  }
  100% { 
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.8), 0 12px 40px rgba(0, 0, 0, 0.4); 
  }
}

/* Modern Image Carousel */
.modern-image-item {
  @apply flex-shrink-0 w-32 h-24 rounded-xl overflow-hidden shadow-lg border-2 border-amber-200 transition-all duration-300 hover:scale-105 hover:shadow-xl cursor-pointer;
}

/* Modern Image Gallery Overlay */
.image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.image-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.image-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
}

.image-container {
  position: relative;
  max-width: 85vw;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-overlay-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(0.9);
}

.image-overlay.visible .image-overlay-img {
  transform: scale(1);
}

.image-overlay-img:hover {
  transform: scale(1.02);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Gallery Navigation */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  transition: all 0.3s ease;
  z-index: 10;
}

.gallery-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
  left: 2rem;
}

.gallery-nav.next {
  right: 2rem;
}

.gallery-nav.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Close Button */
.image-close-btn {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  transition: all 0.3s ease;
  z-index: 10;
}

.image-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Image Caption */
.image-overlay-caption {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem 2rem;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 80%;
  opacity: 0;
  animation: slideUpFade 0.6s ease 0.3s forwards;
}

/* Image Counter */
.image-counter {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Farm-Themed Loading Animations */

/* Growing Plant Loader */
.loading-plant {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto;
}

.plant-stem {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 0;
  background: linear-gradient(to top, #4CAF50, #8BC34A);
  border-radius: 2px;
  animation: growStem 2s ease-in-out infinite;
}

.plant-leaf {
  position: absolute;
  width: 16px;
  height: 12px;
  background: #4CAF50;
  border-radius: 50% 10px;
  transform-origin: bottom left;
}

.plant-leaf.left {
  bottom: 20px;
  left: 18px;
  transform: rotate(-45deg) scale(0);
  animation: growLeaf 2s ease-in-out 0.5s infinite;
}

.plant-leaf.right {
  bottom: 30px;
  right: 18px;
  transform: rotate(45deg) scale(0);
  animation: growLeaf 2s ease-in-out 0.8s infinite;
}

@keyframes growStem {
  0%, 100% { height: 0; }
  50% { height: 40px; }
}

@keyframes growLeaf {
  0%, 100% { transform: rotate(-45deg) scale(0); }
  50% { transform: rotate(-45deg) scale(1); }
}

@keyframes growLeaf {
  0%, 100% { 
    transform: scale(0);
    opacity: 0;
  }
  50% { 
    transform: scale(1);
    opacity: 1;
  }
}

/* Water Droplets Loader */
.loading-water {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto;
}

.water-drop {
  position: absolute;
  width: 12px;
  height: 16px;
  background: linear-gradient(135deg, #2196F3, #03A9F4);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  animation: dropFall 1.5s ease-in-out infinite;
}

.water-drop:nth-child(1) {
  left: 10px;
  animation-delay: 0s;
}

.water-drop:nth-child(2) {
  left: 24px;
  animation-delay: 0.3s;
}

.water-drop:nth-child(3) {
  left: 38px;
  animation-delay: 0.6s;
}

@keyframes dropFall {
  0% {
    top: -10px;
    opacity: 0;
    transform: rotate(-45deg) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: rotate(-45deg) scale(1);
  }
  100% {
    top: 50px;
    opacity: 0;
    transform: rotate(-45deg) scale(0.8);
  }
}

/* Organic Pulse Loader */
.loading-pulse {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto;
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #4CAF50;
  border-radius: 50%;
  animation: organicPulse 2s ease-in-out infinite;
}

.pulse-ring:nth-child(2) {
  animation-delay: 0.5s;
  border-color: #8BC34A;
}

.pulse-ring:nth-child(3) {
  animation-delay: 1s;
  border-color: #CDDC39;
}

@keyframes organicPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* Spinning Farm Elements */
.loading-farm {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto;
}

.farm-element {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  animation: farmSpin 3s linear infinite;
}

.farm-element:nth-child(1) { animation-delay: 0s; }
.farm-element:nth-child(2) { animation-delay: 1s; }
.farm-element:nth-child(3) { animation-delay: 2s; }

@keyframes farmSpin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translateX(20px) rotate(0deg);
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg) translateX(20px) rotate(-360deg);
    opacity: 1;
  }
}

/* Breathing Loader */
.loading-breathe {
  position: relative;
  width: 50px;
  height: 50px;
  margin: 0 auto;
  background: linear-gradient(45deg, #4CAF50, #8BC34A);
  border-radius: 50%;
  animation: breathe 2s ease-in-out infinite;
}

.loading-breathe::before {
  content: '🌱';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
  }
}

/* Generic Image Loading */
.image-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
}

.image-loading .loading-plant {
  width: 100%;
  height: 100%;
}

/* Loading States for Different Contexts */
.loading-tts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #4CAF50;
  font-weight: 500;
}

.loading-agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: #4CAF50;
  font-weight: 500;
}

.loading-voice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: #4CAF50;
  font-weight: 500;
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 2.5rem;
}

.typing-text {
  color: #388e3c;
  opacity: 0.8;
  font-style: italic;
}

.typing-dots {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #4CAF50;
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite both;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Custom animations for Tailwind */
@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes avatarGlow {
  0% { 
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5), 0 8px 32px rgba(0, 0, 0, 0.3); 
  }
  100% { 
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.8), 0 12px 40px rgba(0, 0, 0, 0.4); 
  }
}

/* Tailwind utility classes */
.animate-typing-bounce {
  animation: typing-bounce 1.4s ease-in-out infinite both;
}

.animate-slide-up {
  animation: slide-up 0.4s ease-out;
}

.animate-avatar-glow {
  animation: avatarGlow 1.2s infinite alternate;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Message entrance animations */
.message {
  animation: messageSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.message.user {
  animation: messageSlideInRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.message.assistant {
  animation: messageSlideInLeft 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messageSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px) translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes messageSlideInRight {
  from {
    opacity: 0;
    transform: translateX(20px) translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

/* Bubble hover effects for interactivity */
.bubble {
  transition: all 0.2s ease;
  cursor: pointer;
}

.bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.bubble.user:hover {
  box-shadow: 0 4px 20px rgba(255, 224, 130, 0.3);
}

.bubble.assistant:hover {
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.2);
}

/* Pulse animation for emphasis */
.bubble.emphasis {
  animation: bubblePulse 0.6s ease-in-out;
}

@keyframes bubblePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Smooth scroll animation for chat area */
.chat-area {
  scroll-behavior: smooth;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 600px) {
  .image-container {
    max-width: 95vw;
    max-height: 70vh;
  }
  
  .gallery-nav {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  .gallery-nav.prev {
    left: 1rem;
  }
  
  .gallery-nav.next {
    right: 1rem;
  }
  
  .image-close-btn {
    top: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  .image-overlay-caption {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    bottom: 2rem;
    max-width: 90%;
  }
  
  .image-counter {
    top: 1rem;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Modern Inline Image Display System */
.inline-image-container {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
  margin-left: 0;
}

.inline-image-wrapper {
  position: relative;
  background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
  border: 2px solid #e0e0e0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  max-width: 200px;
  animation: slideInUp 0.5s ease-out;
}

.inline-image-wrapper:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  border-color: #4CAF50;
}

.inline-image-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #f0f0f0;
  transition: transform 0.3s ease;
}

.inline-image-wrapper:hover .inline-image-thumb {
  transform: scale(1.05);
}

.inline-image-info {
  padding: 0.75rem 0.5rem;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
}

.image-emoji {
  font-size: 1.2rem;
  margin-right: 0.5rem;
  display: inline-block;
}

.image-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2c3e50;
  display: block;
  margin-top: 0.25rem;
  line-height: 1.2;
}

/* Modern Image Modal */
.modern-image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 2rem;
}

.modern-image-modal.visible {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 80vh;
}

.modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.modal-close-btn {
  position: absolute;
  top: -3rem;
  right: -1rem;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.modal-nav-btn.prev {
  left: -4rem;
}

.modal-nav-btn.next {
  right: -4rem;
}

.modal-counter {
  position: absolute;
  top: -3rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-caption {
  position: absolute;
  bottom: -6rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem 2rem;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-thumbnails {
  position: absolute;
  bottom: -4rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 0.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 80vw;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-thumbnails::-webkit-scrollbar {
  display: none;
}

.modal-thumbnail {
  width: 60px;
  height: 45px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  object-fit: cover;
  flex-shrink: 0;
  opacity: 0.7;
}

.modal-thumbnail:hover {
  opacity: 1;
  transform: scale(1.05);
}

.modal-thumbnail.active {
  border-color: #4CAF50;
  opacity: 1;
  transform: scale(1.1);
}

/* Mobile Responsive for Modern Image System */
@media (max-width: 600px) {
  .inline-image-container {
    gap: 0.75rem;
    margin-top: 0.5rem;
    margin-left: 0;
  }
  
.inline-image-wrapper {
    max-width: 160px;
    border-radius: 12px;
  }
  
  .inline-image-thumb {
    height: 120px;
  }
  
  .inline-image-info {
    padding: 0.5rem 0.4rem;
  }
  
  .image-title {
    font-size: 0.75rem;
  }
  
  .modern-image-modal {
    padding: 1rem;
  }
  
  .modal-nav-btn {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  
  .modal-nav-btn.prev {
    left: -2.5rem;
  }
  
  .modal-nav-btn.next {
    right: -2.5rem;
  }
  
  .modal-close-btn {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    top: -2.5rem;
  }
  
  .modal-caption {
    bottom: -5rem;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    max-width: 90vw;
  }
  
  .modal-thumbnails {
    bottom: -3rem;
    max-width: 90vw;
    padding: 0.4rem;
    gap: 0.4rem;
  }
  
  .modal-thumbnail {
    width: 50px;
    height: 37px;
  }
    right: -0.5rem;
  }
  
  .modal-counter {
    top: -2.5rem;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
  
  .modal-caption {
    bottom: -3rem;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    max-width: 90vw;
  }
}

/* Animation for inline images */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Enhance chat area for inline images */
.chat-area .message.assistant {
  margin-bottom: 1rem;
}

.chat-area .message.assistant:last-child {
  margin-bottom: 0.5rem;
}

/* Ensure proper text direction for image containers */
.inline-image-container {
  direction: ltr;
}

/* Loading state for images */
.inline-image-thumb {
  background: linear-gradient(90deg, #f0f0f0 25%, rgba(255,255,255,0.8) 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.inline-image-thumb[src] {
  background: none;
  animation: none;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.suggestion-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1rem;
  padding: 0 0.5rem;
}

/* Welcome Carousel Overlay Styles */
.carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    transparent 0%,
    rgba(139, 100, 69, 0.3) 40%,
    rgba(101, 67, 33, 0.8) 80%,
    rgba(91, 58, 35, 0.95) 100%
  );
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  z-index: 20;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-top: 1px solid rgba(245, 222, 179, 0.2);
}

.carousel-info {
  text-align: center;
  position: relative;
}

.carousel-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #F5DEB3;
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 8px rgba(91, 58, 35, 0.8);
  letter-spacing: 0.5px;
}

.carousel-description {
  font-size: 1rem;
  color: rgba(245, 222, 179, 0.9);
  opacity: 0.95;
  text-shadow: 0 2px 6px rgba(91, 58, 35, 0.7);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.welcome-carousel-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.welcome-carousel-img.active {
  opacity: 1;
}

/* Mobile responsive for carousel */
@media (max-width: 600px) {
  .carousel-overlay {
    padding: 1.5rem 1rem 1rem 1rem;
  }
  
  .carousel-title {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
  }
  
  .carousel-description {
    font-size: 0.9rem;
  }
}

