/* Simplified CSS - Reduced from 2553 lines to ~1200 lines */

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-blur: blur(10px);
  --text-white: #fff;
  --text-dark: #333;
  --accent-blue: #4a90e2;
  --accent-blue-hover: #357abd;
  --button-bg: #444;
  --button-hover: #666;
  --border-radius: 20px;
  --border-radius-small: 4px;
  --transition: all 0.3s ease;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  --arrow-color: rgba(11, 255, 255, 0.1);
  --arrow-glow-color: rgba(64, 160, 224, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--primary-gradient);
  color: var(--text-white);
  font-family: monospace;
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.floating-shapes-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  perspective: 800px;
  overflow: visible;
  z-index: -1;
  pointer-events: none;
}

/* Keyframe Animations - Simplified */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

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

@keyframes robotGlow {
  0% {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    transform: scale(1);
  }
  100% {
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
  }
}

@keyframes botActivePulse {
  0% {
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.5), 0 0 25px rgba(34, 197, 94, 0.2);
  }
  100% {
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInImage {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Layout Components */
.layout-container {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 50px; /* Leave space for PM footer */
  z-index: 1;
  display: flex;
  height: calc(100vh - 180px); /* Adjusted for PM footer */
  height: calc(100dvh - 180px); /* Dynamic viewport height for mobile */
  /* Safari fallback for vh issues */
  min-height: calc(100vh - 180px);
  min-height: calc(100dvh - 180px);
}

.main-container {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  margin-left: 20px;
  margin-right: 20px;
  max-width: 100%;
  z-index: 1;
}

.main-container.panel-hidden {
  margin-left: 20px;
  margin-right: 20px;
}

.glass-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur); /* Safari support */
  transition: var(--transition);
}

.glass-overlay.hidden,
.connecting-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.connecting-overlay {
  z-index: 20;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur); /* Safari support */
  background: rgba(0, 0, 0, 0.6);
}

/* Button Styles */
.btn {
  padding: 10px 25px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
  color: var(--text-white);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

/* Chat Button Styles */
.chat-button {
  display: inline-block;
  padding: 4px 10px;
  margin-left: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
  color: var(--text-white);
  font-size: 12px;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(5px);
  white-space: nowrap;
  vertical-align: middle;
}

.chat-button:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 1), rgba(118, 75, 162, 1));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.chat-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#logout-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#logout-btn:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.4);
  color: rgba(255, 150, 150, 1);
}

#logout-btn:active {
  transform: scale(0.95);
}

/* Settings Button */
.settings-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Settings Popup */
.settings-popup {
  position: fixed;
  top: 70px;
  right: 20px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  z-index: 1000;
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  min-width: 280px;
  animation: fadeInUp 0.3s ease-out;
}

.settings-popup.hidden {
  display: none;
}

.settings-content h3 {
  margin: 0 0 15px 0;
  color: white;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.setting-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.setting-group label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  min-width: 80px;
}

.setting-group input[type='range'] {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.setting-group input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #4a90e2, #357abd);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.setting-group input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.setting-group input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #4a90e2, #357abd);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.setting-group input[type='range']::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.setting-value {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 500;
  min-width: 40px;
  text-align: right;
}

.reset-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  width: 100%;
  margin-top: 10px;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.reset-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.enter-btn {
  composes: btn;
}

/* Chat Container */
#chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 600px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: visible;
  z-index: 10;
}

.chat-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  overflow: visible;
}

.help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.help-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.audio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  margin-right: 8px;
}

.audio-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.audio-btn.active {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.audio-btn.active:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.5);
  color: rgba(34, 197, 94, 1);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.audio-btn.disabled {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: rgba(239, 68, 68, 0.7);
  cursor: not-allowed;
  transform: none;
}

.audio-btn.disabled:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: rgba(239, 68, 68, 0.7);
  transform: none;
  box-shadow: none;
}

.audio-controls {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 8px;
  z-index: 1001;
}

.volume-slider-container {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  padding: 8px 12px;
  margin-right: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1001;
  white-space: nowrap;
}

.volume-slider-container::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid rgba(0, 0, 0, 0.8);
}

.audio-btn:hover + .volume-slider-container,
.volume-slider-container:hover {
  opacity: 1;
  visibility: visible;
}

.volume-slider {
  width: 80px;
  height: 8px; /* Increased height for better touch targets */
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  /* Touch-friendly improvements */
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; /* Larger for touch */
  height: 20px; /* Larger for touch */
  background: linear-gradient(135deg, #4a90e2, #357abd);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  /* Touch-friendly improvements */
  -webkit-tap-highlight-color: transparent;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.volume-slider::-moz-range-thumb {
  width: 20px; /* Larger for touch */
  height: 20px; /* Larger for touch */
  background: linear-gradient(135deg, #4a90e2, #357abd);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.volume-slider::-webkit-slider-track {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  height: 8px; /* Match the slider height */
}

.volume-slider::-moz-range-track {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  height: 8px; /* Match the slider height */
  border: none;
}

/* Volume slider container pointer events */
.volume-slider-container {
  pointer-events: none;
}

.volume-slider-container:hover {
  pointer-events: auto;
}

.volume-slider {
  pointer-events: auto;
}

/* Speed Control Styles */
.speed-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  width: 50px; /* Wider to fit icon and text */
  height: 28px; /* Match audio button height */
  border-radius: 14px; /* Rounded rectangle to fit content */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px; /* Smaller font to fit better */
  transition: all 0.3s ease;
  margin-left: 8px;
  backdrop-filter: blur(10px);
  position: relative;
  gap: 2px; /* Smaller gap */
  /* Touch-friendly improvements */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.speed-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.speed-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.speed-btn.touch-active {
  border-color: rgba(74, 144, 226, 0.8);
  box-shadow: 0 0 15px rgba(74, 144, 226, 0.6), 0 4px 12px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.speed-display {
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 500;
  min-width: 25px;
  text-align: center;
}

/* JavaScript-based tooltips for chat header buttons */
.audio-btn,
.speed-btn,
.help-btn {
  position: relative;
}

.tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
}

.tooltip.show {
  opacity: 1;
  visibility: visible;
}

/* Messages */
#messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  scroll-behavior: smooth;
  backdrop-filter: blur(20px);
}

#messages::-webkit-scrollbar {
  width: 6px;
}

#messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

#messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  transition: background 0.3s ease;
}

#messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 18px;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease-in;
  font-size: 14px;
  backdrop-filter: blur(15px);
  max-width: 80%;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.message.user {
  background: var(--primary-gradient);
  color: var(--text-white);
  margin-left: auto;
  border-bottom-right-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.message.bot {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.1));
  color: var(--text-white);
  margin-right: auto;
  border-bottom-left-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
  max-width: 85%;
  line-height: 1.5;
  font-size: 14px;
  position: relative;
}

.message.bot::before {
  content: '🤖';
  position: absolute;
  top: -2px;
  left: -2px;
  font-size: 12px;
  background: linear-gradient(135deg, #4a90e2, #357abd);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message.bot .message-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  display: block;
  margin-top: 2px;
  max-width: 100%;
  overflow-x: hidden;
}

.message.bot .user-name {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  margin-bottom: 6px;
}

.message.system {
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 8px auto;
  font-size: 12px;
  max-width: 60%;
}

.user-name {
  font-weight: bold;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
  display: block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  color: var(--text-white);
}

/* Streaming message cursor */
.cursor-blink {
  color: rgba(255, 255, 255, 0.8);
  font-weight: bold;
  animation: blink 1s infinite;
  margin-left: 2px;
}

/* Typing Indicator */
.typing-indicator {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 18px;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease-in;
  font-size: 14px;
  backdrop-filter: blur(15px);
  max-width: 85%;
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  color: var(--text-white);
  margin-right: auto;
  border-bottom-left-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}

.typing-indicator::before {
  content: '🤖';
  font-size: 12px;
  background: linear-gradient(135deg, #4a90e2, #357abd);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  animation: typingDot 1.4s infinite ease-in-out;
}

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

.typing-text {
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  font-size: 13px;
}

/* Streaming Progress Indicator */
.streaming-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2, #357abd);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 500;
  min-width: 35px;
  text-align: right;
}

.progress-details {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 400;
  margin-left: 8px;
}

/* Streaming Status Indicator */
.streaming-status {
  display: flex;
  align-items: center;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 500;
  font-family: monospace;
}

/* Clickable URL styling */
.message-text a {
  color: #007bff;
  text-decoration: underline;
  text-decoration-color: #007bff;
  transition: all 0.2s ease;
  font-weight: 600;
  text-decoration-thickness: 2px;
}

.message-text a:hover {
  color: #0056b3;
  text-decoration-color: #0056b3;
  text-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
  cursor: pointer;
  text-decoration-thickness: 2px;
}

.message-text a:active {
  color: #004085;
  transform: translateY(1px);
}

/* Chat Form */
#chat-form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(204, 0, 0, 0.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0 0 10px 10px;
  position: relative;
}

/* Bot Toggle Styling */
.bot-toggle-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.bot-robot-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  opacity: 0.6;
  position: relative;
  overflow: hidden;
}

.bot-robot-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.bot-robot-button:hover::before {
  left: 100%;
}

.bot-robot-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
  opacity: 0.8;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.bot-robot-button.active {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border-color: rgba(34, 197, 94, 0.6) !important;
  color: white !important;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3) !important;
  opacity: 1 !important;
  transform: scale(1.02) !important;
  font-weight: 600 !important;
  animation: botActivePulse 3s ease-in-out infinite !important;
}

.bot-robot-button.active:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
  transform: scale(1.03) translateY(-1px);
}

.bot-robot-button.active::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.robot-icon {
  font-size: 18px;
  transition: all 0.3s ease;
  filter: grayscale(100%) opacity(0.4);
  transform: scale(0.9);
}

.bot-robot-button.active .robot-icon {
  filter: grayscale(0%) opacity(1) brightness(1.2);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  animation: robotGlow 1.5s ease-in-out infinite alternate;
  transform: scale(1.1);
}

.robot-status {
  font-family: monospace;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.bot-robot-button.active .robot-status {
  font-weight: 600;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.robot-status {
  font-family: monospace;
  letter-spacing: 0.5px;
}

#message-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
}

#message-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

#message-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#chat-form button {
  padding: 12px 20px;
  border: none;
  background: var(--primary-gradient);
  color: var(--text-white);
  font-size: 14px;
  font-weight: 600;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

#chat-form button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

#chat-form button:hover::before {
  left: 100%;
}

#chat-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
}

#chat-form button:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Users Panel */
#users-panel {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 260px;
  height: 80vh;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0;
  padding: 18px;
  backdrop-filter: blur(20px);
  color: var(--text-white);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
  z-index: 50;
  overflow-y: auto;
  transform: translateY(-50%) translateX(0);
  transition: transform 0.3s ease;
}

#users-panel::-webkit-scrollbar {
  width: 6px;
}

#users-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

#users-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  transition: background 0.3s ease;
}

#users-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 89, 117, 0.3);
}

#users-panel.hidden {
  transform: translateY(-50%) translateX(-100%);
}

.users-toggle {
  position: fixed;
  top: 50%;
  left: 260px;
  transform: translateY(-50%);
  z-index: 60;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: none;
  border-radius: 0 12px 12px 0;
  padding: 12px 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 80vh;
  width: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20px;
}

.users-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 3px 0 20px rgba(0, 0, 0, 0.2);
}

.users-toggle.panel-hidden {
  left: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

#users-panel h3 {
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin: 0 0 12px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#users-panel:not(.hidden):not(.panel-loading) h3 {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

#online-users {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 300px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#users-panel:not(.hidden):not(.panel-loading) #online-users {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}

#online-users::-webkit-scrollbar {
  width: 4px;
}

#online-users::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

#online-users::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

#online-users::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.online-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  animation: fadeIn 0.2s ease forwards;
}

.online-user::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #4caf50;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
  animation: pulse 2s infinite;
  z-index: 1;
  pointer-events: none;
}

.online-user .user-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-white);
  flex: 1;
  margin-right: 10px;
  margin-left: 20px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.online-user:hover .user-name {
  opacity: 0.9;
}

.pm-button {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 24px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateX(100%);
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
  backdrop-filter: var(--glass-blur);
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
  z-index: 3;
  overflow: hidden;
}

.online-user:hover .pm-button {
  opacity: 1;
  transform: translateX(0);
}

.pm-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.pm-button:hover::before {
  left: 100%;
}

.pm-button:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 1), rgba(118, 75, 162, 1));
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: -6px 0 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(102, 126, 234, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateX(0) translateY(-2px) scale(1.02);
}

.pm-button:active {
  transform: translateY(0);
}

.pm-button.disabled {
  background: rgba(0, 255, 136, 0.15);
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.4);
  cursor: not-allowed;
  pointer-events: none;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.pm-button.disabled:hover {
  background: rgba(0, 255, 136, 0.2);
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.5);
  transform: none;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.4);
}

/* Private Chat */
#private-chat-container {
  position: fixed;
  bottom: 60px;
  right: 20px;
  width: 350px;
  height: 400px;
  display: none;
  flex-direction: column;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

#private-chat-container.maximized {
  width: 80vw;
  height: 80vh;
  bottom: 10vh;
  right: 10vw;
  max-width: 1000px;
  max-height: 800px;
}

#private-chat-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.chat-title-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
}

.chat-user {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

#private-chat-header .header-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-btn {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
}

.header-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.header-btn:hover::before {
  transform: translateX(100%);
}

.header-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.header-btn:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

.minimize-btn:hover {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.disconnect-btn:hover {
  color: #ff9500;
  background: rgba(255, 149, 0, 0.15);
  border-color: rgba(255, 149, 0, 0.3);
  box-shadow: 0 4px 15px rgba(255, 149, 0, 0.2);
}

.maximize-btn:hover {
  color: #00ff88;
  background: rgba(0, 255, 136, 0.15);
  border-color: rgba(0, 255, 136, 0.3);
  box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
}

.close-btn:hover {
  color: #ff4757;
  background: rgba(255, 71, 87, 0.15);
  border-color: rgba(255, 71, 87, 0.3);
  box-shadow: 0 4px 15px rgba(255, 71, 87, 0.2);
}

.header-btn svg {
  transition: all 0.3s ease;
}

.header-btn:hover svg {
  transform: scale(1.1);
}

#private-chat-box {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-size: 13px;
  background: rgba(20, 20, 20, 0.8);
  scroll-behavior: smooth;
}

#private-chat-box::-webkit-scrollbar {
  width: 6px;
}

#private-chat-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

#private-chat-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

#private-chat-box::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

#private-chat-input-container {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(25, 25, 25, 0.9);
  padding: 8px;
  gap: 8px;
}

#private-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

#private-input:focus {
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 8px rgba(74, 144, 226, 0.3);
}

#private-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#private-send-btn {
  padding: 8px 12px;
  background: var(--accent-blue);
  color: var(--text-white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: var(--transition);
  min-width: 60px;
}

#private-send-btn:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

#private-send-btn:active {
  transform: translateY(0);
}

/* PM Footer Tabs */
#pm-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  height: calc(60px + env(safe-area-inset-bottom, 0px));
}

.pm-tab {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  min-width: 90px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.pm-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pm-tab.active {
  background: var(--primary-gradient);
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
}

.pm-tab.pending {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
}

.pm-tab.accepted {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(0, 255, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

.pm-tab.disconnected {
  background: rgba(255, 0, 0, 0.1);
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 0, 0, 0.3);
  text-decoration: line-through;
}

.pm-tab.notify::after {
  content: '●';
  color: #ff4444;
  margin-left: 4px;
  font-size: 12px;
  animation: pulse 1.5s infinite;
}

/* PM Tab Status Dot Indicators */
.pm-tab .status-dot {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(25, 25, 25, 0.9);
  z-index: 10;
  /* Make sure it's visible */
  display: block !important;
  pointer-events: none;
}

/* Yellow dot for pending invitations */
.pm-tab.pending .status-dot {
  background: linear-gradient(135deg, #ffd700, #ffb000);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* Green dot for accepted conversations */
.pm-tab.accepted .status-dot {
  background: linear-gradient(135deg, #00ff88, #00cc66);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

/* Blue flashing dot for unread messages */
.pm-tab.has-unread .status-dot {
  background: linear-gradient(135deg, #00aaff, #0077cc);
  box-shadow: 0 0 12px rgba(0, 170, 255, 0.8);
  animation: pulse 1.5s ease-in-out infinite;
}

.pm-tab .unread-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #ff4444, #cc3333);
  color: white;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid rgba(25, 25, 25, 0.9);
  box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

#private-input:disabled {
  background: #333;
  color: #aaa;
  cursor: not-allowed;
}

#private-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Specific override for private chat container */
#private-chat-container.hidden {
  display: none !important;
}

/* Private Chat Messages */
#private-chat-box .message {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.3;
  max-width: 85%;
  word-wrap: break-word;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#private-chat-box .message.sent {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
  color: white;
  margin-left: 0;
  margin-right: auto;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#private-chat-box .message.received {
  background: linear-gradient(135deg, rgba(60, 60, 60, 0.95), rgba(40, 40, 40, 0.95));
  color: rgba(255, 255, 255, 0.95);
  margin-left: auto;
  margin-right: 0;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

#private-chat-box .message.system {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  text-align: center;
  font-size: 11px;
  padding: 6px 10px;
  margin: 6px auto;
  max-width: 70%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#private-chat-box .user-name {
  font-weight: 500;
  font-size: 10px;
  opacity: 0.7;
  margin-bottom: 1px;
  color: rgba(255, 255, 255, 0.8);
  display: block;
  line-height: 1.2;
}

#private-chat-box .message-text {
  color: inherit;
  word-wrap: break-word;
  display: block;
  margin-top: 2px;
}

/* Toast Notifications */
#invite-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#tooltip-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.invite-toast {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-white);
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  min-width: 300px;
  max-width: 350px;
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.invite-content {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
}

.invite-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.invite-message {
  flex: 1;
}

.invite-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 4px;
}

.invite-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.3;
}

.invite-actions {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.invite-toast .accept-btn,
.invite-toast .decline-btn {
  flex: 1;
  border: none;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.invite-toast .accept-btn {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.invite-toast .accept-btn:hover {
  background: rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.invite-toast .decline-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.invite-toast .decline-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.invite-toast .accept-btn span,
.invite-toast .decline-btn span {
  font-weight: 600;
}

.decline-notification {
  background: #d64545 !important; /* Red background for decline */
  color: white !important;
  border-left: 4px solid #ff6b6b; /* Red accent border */
}

.disconnect-notification {
  background: #f39c12 !important; /* Orange background for disconnect */
  color: white !important;
  border-left: 4px solid #e67e22; /* Orange accent border */
}

/* Login Form */
.username-form {
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  padding: 30px;
  text-align: center;
  max-width: 350px;
  width: 90%;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  backdrop-filter: var(--glass-blur);
}

.username-form h2 {
  color: var(--text-white);
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.username-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  background: var(--glass-bg);
  color: var(--text-white);
  font-size: 16px;
  outline: none;
  margin-bottom: 15px;
  transition: var(--transition);
}

.username-input:focus {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Header Bar */
.header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  height: calc(60px + env(safe-area-inset-top, 0px));
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logged-in-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 400;
}

.username-display {
  color: var(--text-white);
  font-size: 14px;
  font-weight: 600;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Welcome Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;

  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);

  background-color: rgba(17, 25, 40, 0.5); /* subtle dark glass tint */
  box-shadow: inset 0 0 0 1000px rgba(255, 255, 255, 0.02); /* soft inner glow */

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;

  /* Optional subtle vignette gradient */
  background-image: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(17, 25, 40, 0.6) 100%
  );

  transition: opacity 0.3s ease, transform 0.3s ease;
}

canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: -1 !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  pointer-events: none !important;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  max-width: 600px;
  max-height: 80vh;
  width: 90%;
  box-shadow: var(--shadow);
  color: var(--text-white);
  overflow: hidden;
  animation: fadeInUp 0.4s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

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

.modal-body {
  padding: 25px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.welcome-section {
  margin-bottom: 25px;
}

.welcome-section:last-child {
  margin-bottom: 0;
}

.welcome-section h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.welcome-section p {
  margin: 0 0 15px 0;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.welcome-section ul {
  margin: 0;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.welcome-section li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.example-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.example-tag {
  display: inline-block;
  background: linear-gradient(135deg, rgba(103, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: monospace;
  color: #fff;
  transition: var(--transition);
  cursor: pointer;
  user-select: text;
}

.example-tag:hover {
  background: linear-gradient(135deg, rgba(103, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-footer {
  padding: 20px 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  display: flex;
  justify-content: center;
}

.welcome-btn {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.welcome-btn:hover {
  background: linear-gradient(135deg, #5a73d8, #6a42a0);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.welcome-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Help Modal Page Navigation */
.help-page {
  transition: opacity 0.3s ease;
}

.help-page.hidden {
  display: none;
}

/* Welcome Modal Page Navigation */
.welcome-page {
  transition: opacity 0.3s ease;
}

.welcome-page.hidden {
  display: none;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  margin-right: 10px;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.secondary-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Image Gallery */
.image-gallery {
  margin: 10px 0;
  padding: 15px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.gallery-header {
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--text-white);
  text-align: center;
  font-size: 14px;
}

.gallery-image {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 400px;
  margin: 5px auto;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  cursor: pointer;
}

.gallery-image:hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.gallery-image.active {
  display: block;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.gallery-controls button {
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-white);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 500;
  min-width: 80px;
}

.gallery-controls button:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-controls button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.image-counter {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  margin: 0 15px;
  font-weight: 500;
}

/* Dedicated Image Gallery Container */
.image-gallery-container {
  width: 500px;
  min-width: 450px;
  max-width: 600px;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: slideInFromRight 0.3s ease-out;
}

.image-gallery-container.hidden {
  display: none;
}

.gallery-header {
  padding: 20px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-header h3 {
  margin: 0;
  color: white;
  font-size: 20px;
  font-weight: 600;
}

.gallery-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.gallery-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.gallery-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 25px;
  height: calc(100% - 80px);
}

.gallery-images {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  overflow: hidden;
}

.gallery-images img {
  max-width: 100%;
  max-height: calc(100% - 60px);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  display: none;
  object-fit: contain;
}

.gallery-images img.active {
  display: block;
  animation: fadeInImage 0.3s ease-in;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  height: 50px;
  flex-shrink: 0;
  margin-top: auto;
}

.gallery-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.gallery-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.gallery-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.gallery-counter {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  font-weight: 500;
}

/* Responsive Design - Consolidated */
@media (max-width: 1400px) {
  .image-gallery-container {
    width: 450px;
    min-width: 400px;
  }
}

@media (max-width: 1200px) {
  .main-container {
    margin-left: 240px;
  }

  .main-container.panel-hidden {
    margin-left: 20px;
  }

  #users-panel {
    width: 220px;
  }

  .users-toggle {
    left: 220px;
  }

  .image-gallery-container {
    width: 400px;
    min-width: 350px;
  }

  .gallery-content {
    height: calc(100% - 75px);
  }

  .gallery-images img {
    max-height: calc(100% - 50px);
  }
}

@media (max-width: 1000px) {
  .main-container {
    margin-left: 20px;
    margin-right: 20px;
  }

  #users-panel {
    width: 200px;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.07);
    transition: transform 0.3s ease;
  }

  #info-panel {
    width: 260px;
    z-index: 100;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.07);
    transition: transform 0.3s ease;
  }

  #info-panel.hidden {
    transform: translateX(100%);
  }

  .info-toggle {
    right: 260px;
    z-index: 101;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .info-toggle.panel-hidden {
    right: 20px;
  }

  #users-panel.hidden {
    transform: translateX(-100%);
  }

  .users-toggle {
    left: 200px;
    z-index: 101;
    border-left: none;
    transition: left 0.3s ease;
  }

  .users-toggle.panel-hidden {
    left: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  .image-gallery-container {
    position: fixed;
    top: 80px;
    right: 20px;
    bottom: 80px;
    width: 400px;
    height: auto;
    z-index: 15;
    margin-left: 0;
  }

  .gallery-content {
    height: calc(100vh - 200px);
  }
}

@media (max-width: 768px) {
  .layout-container {
    height: calc(100vh - 140px);
    height: calc(100dvh - 140px);
    top: env(safe-area-inset-top, 60px);
    bottom: calc(50px + env(safe-area-inset-bottom, 0px));
  }

  .main-container {
    margin-left: 20px;
    margin-right: 20px;
    padding: 5px;
  }

  #info-panel {
    width: 240px;
    z-index: 100;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.07);
    transition: transform 0.3s ease;
    padding: 5px 13px;
    box-sizing: border-box;
    height: 70vh;
  }

  #info-panel.hidden {
    transform: translateY(-50%) translateX(100%);
  }

  .info-toggle {
    right: 20px;
    z-index: 101;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .info-toggle.panel-hidden {
    right: 20px;
  }

  #chat-container {
    max-width: 450px;
  }

  #users-panel {
    width: 240px;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.07);
    transition: transform 0.3s ease;
    padding: 5px 13px;
    box-sizing: border-box;
  }

  #users-panel.hidden {
    transform: translateX(-100%);
  }

  .users-toggle {
    left: 240px;
    z-index: 101;
    border-left: none;
    transition: left 0.3s ease;
  }

  .users-toggle.panel-hidden {
    left: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  .message {
    font-size: 15px;
    padding: 10px 14px;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .user-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
  }

  #message-input {
    font-size: 16px;
    padding: 12px 18px;
    min-height: 44px;
  }

  #chat-form button {
    padding: 10px 18px;
    font-size: 15px;
    min-height: 44px;
    min-width: 70px;
  }

  #chat-form {
    gap: 10px;
    padding: 12px;
  }

  .bot-robot-button {
    padding: 6px 10px;
    font-size: 12px;
    gap: 6px;
  }

  .robot-icon {
    font-size: 14px;
  }

  .audio-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
    margin-right: 6px;
  }

  .volume-slider-container {
    padding: 6px 10px;
    margin-left: 6px;
  }

  .volume-slider {
    width: 80px; /* Wider on mobile for better touch */
    height: 12px; /* Taller on mobile */
  }

  .volume-slider::-webkit-slider-thumb {
    width: 24px; /* Larger thumb on mobile */
    height: 24px;
  }

  .volume-slider::-moz-range-thumb {
    width: 24px; /* Larger thumb on mobile */
    height: 24px;
  }

  .speed-btn {
    width: 44px; /* Wider to fit content on mobile */
    height: 24px; /* Match audio button mobile size */
    font-size: 10px; /* Smaller font for mobile */
  }

  #messages {
    padding: 12px;
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .modal-header {
    padding: 15px 20px;
  }

  .modal-header h2 {
    font-size: 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .welcome-section h3 {
    font-size: 16px;
  }

  .example-tag {
    font-size: 13px;
    padding: 6px 10px;
  }

  .modal-footer {
    padding: 15px 20px;
  }

  .welcome-btn {
    padding: 10px 25px;
    font-size: 15px;
  }

  .image-gallery-container {
    top: 70px;
    right: 10px;
    left: 10px;
    bottom: 70px;
    width: auto;
    height: auto;
    max-width: none;
  }

  .gallery-header h3 {
    font-size: 18px;
  }

  .gallery-content {
    padding: 20px;
    height: calc(100vh - 180px);
  }

  .gallery-images {
    margin-bottom: 15px;
  }

  .gallery-images img {
    max-height: calc(100% - 40px);
  }

  .gallery-controls {
    height: 45px;
  }

  .header-bar {
    padding: 10px 15px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    height: calc(60px + env(safe-area-inset-top, 0px));
  }

  .logged-in-text {
    font-size: 13px;
  }

  .username-display {
    font-size: 13px;
  }

  #logout-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .online-user {
    padding: 12px 15px;
    margin-bottom: 8px;
  }

  .online-user .user-name {
    font-size: 16px;
  }

  .pm-button {
    padding: 8px 12px;
    font-size: 14px;
    min-height: 36px;
  }

  #users-panel h3 {
    font-size: 18px;
    margin-bottom: 15px;
  }

  #private-input {
    font-size: 16px;
    padding: 12px 16px;
    min-height: 44px;
  }

  #private-send-btn {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px;
  }

  #private-chat-box .message {
    font-size: 15px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }

  #private-chat-box .user-name {
    font-size: 13px;
  }

  .pm-tab {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 40px;
  }

  #pm-footer {
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 600px) {
  .layout-container {
    height: calc(100vh - 140px);
    height: calc(100dvh - 140px);
    top: env(safe-area-inset-top, 60px);
    bottom: calc(50px + env(safe-area-inset-bottom, 0px));
  }

  .main-container {
    margin-left: 20px;
    margin-right: 20px;
    padding: 5px;
  }

  #users-panel {
    width: 260px;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease;
    padding: 5px 13px;
    box-sizing: border-box;
  }

  #info-panel {
    width: 260px;
    z-index: 100;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease;
    padding: 5px 13px;
    box-sizing: border-box;
  }

  #info-panel.hidden {
    transform: translateX(100%);
  }

  .info-toggle {
    right: 20px;
    z-index: 101;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .info-toggle.panel-hidden {
    right: 20px;
  }

  #users-panel.hidden {
    transform: translateX(-100%);
  }

  .users-toggle {
    left: 260px;
    z-index: 101;
    border-left: none;
    transition: left 0.3s ease;
  }

  .users-toggle.panel-hidden {
    left: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  #chat-container {
    max-width: 400px;
  }

  .message {
    font-size: 16px;
    padding: 12px 16px;
    margin-bottom: 12px;
    line-height: 1.5;
  }

  .user-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
  }

  #message-input {
    font-size: 16px;
    padding: 14px 20px;
    min-height: 48px;
  }

  #chat-form button {
    padding: 12px 20px;
    font-size: 16px;
    min-height: 48px;
    min-width: 80px;
  }

  #chat-form {
    gap: 12px;
    padding: 15px;
  }

  #messages {
    padding: 15px;
  }

  .image-gallery {
    padding: 10px;
    margin: 5px 0;
  }

  .gallery-header {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .gallery-image {
    max-height: 250px;
    border-width: 1px;
  }

  .gallery-controls {
    flex-direction: column;
    gap: 8px;
  }

  .gallery-controls button {
    padding: 8px 12px;
    width: 100%;
    max-width: 120px;
  }
}
/* Even smaller screens */
@media screen and (max-width: 480px) {
  .layout-container {
    height: calc(100vh - 170px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    min-height: calc(
      100vh - 170px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
    );
  }
  .main-container {
    padding: 0px;
    margin-left: 0px;
    margin-right: 0px;
  }
  #chat-container {
    margin-top: 70px;
    max-width: 85%;
    margin-left: 10px;
  }

  #info-panel {
    width: 260px;
    z-index: 100;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease;
    padding: 5px 13px;
    box-sizing: border-box;
    position: fixed;
    right: 0;
    top: calc(60px + env(safe-area-inset-top, 0px));
    height: 80%;
    padding-top: 20px;
    top: 70px;
  }

  #info-panel.hidden {
    transform: translateX(100%);
  }

  .info-toggle {
    right: 20px;
    z-index: 101;
    width: 36px;
    height: 36px;
    font-size: 14px;
    top: 70px;
  }

  .info-toggle.panel-hidden {
    right: 20px;
  }

  #users-panel {
    width: 260px;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease;
    padding: 5px 13px;
    box-sizing: border-box;
    position: fixed;
    left: 0;
    top: calc(60px + env(safe-area-inset-top, 0px));
    height: 80%;
    padding-top: 20px;
    top: 70px;
  }

  #users-panel.hidden {
    transform: translateX(-100%);
  }

  .users-toggle {
    left: 260px;
    z-index: 101;
    border-left: none;
    transition: left 0.3s ease;
    top: 70px;
  }

  .users-toggle.panel-hidden {
    left: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  .bot-toggle-container {
    width: 40px;
    padding: 0;
    flex-shrink: 0;
  }

  #bot-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    font-size: 0; /* collapse text spacing */
    width: 100%;
    height: 36px;
    border-radius: 8px;
    min-width: 0;
  }

  #bot-toggle .robot-icon {
    font-size: 18px;
  }

  #bot-toggle .robot-status {
    display: none !important; /* hide text completely */
  }
  #messages {
    padding: 0px;
    font-size: 14px;
  }

  .message-text {
    font-size: 10px;
  }

  #chat-form button {
    padding: 6px 6px;
    font-size: 16px;
    min-height: 30px;
    min-width: 30px;
  }

  #message-input {
    flex: 1;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    min-height: 44px;
    min-width: 0; /* prevents overflow in flex layout */
  }

  #chat-form button[type='submit'] {
    flex: 0 0 auto;
    font-size: 14px;
    padding: 10px 14px;
    min-height: 44px;
    border-radius: 8px;
  }
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Safari/iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari specific fixes */
  html,
  body {
    height: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    /* Prevent layout shifts */
    overflow-x: hidden;
  }

  /* Ensure layout is restored after modal closes */
  body:not(.modal-open) {
    overflow: auto;
    position: static;
    width: auto;
    height: auto;
  }

  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-top: env(safe-area-inset-top, 0px);
  }

  .layout-container {
    position: fixed;
    top: calc(60px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 1;
    display: flex;
    height: calc(100vh - 140px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    min-height: calc(
      100vh - 140px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
    );
  }

  #chat-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 85%;
    width: 85%;
    margin: 0 auto;
  }

  #users-panel {
    background: rgba(255, 255, 255, 0.04);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }

  .modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  #pm-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 1000;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding: 12px 24px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }

  #chat-form {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Fix for Safari viewport height issues */
  @media screen and (max-width: 768px) {
    .layout-container {
      height: calc(
        100vh - 170px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
      );
      min-height: calc(
        100vh - 170px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
      );
    }

    .main-container {
      margin-left: 0;
      padding: 15px;
      display: flex;
      justify-content: center;
      align-items: flex-start;
    }

    #chat-container {
      max-width: 80%;
      width: 80%;
    }

    #users-panel {
      position: fixed;
      left: 0;
      top: calc(60px + env(safe-area-inset-top, 0px));
      height: calc(100vh - 60px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
      z-index: 1001;
    }

    /* Even smaller screens */
    @media screen and (max-width: 480px) {
      .layout-container {
        height: calc(
          100vh - 170px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
        );
        min-height: calc(
          100vh - 170px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
        );
      }
      .main-container {
        padding: 0px;
      }

      .main-container.panel-hidden {
        margin-left: 0px;
      }
      #chat-container {
        max-width: 85%;
        max-height: 90%;
        left: 20px;
        margin-left: 10px;
      }

      #users-panel {
        width: 260px;
        z-index: 100;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(25px);
        background: rgba(255, 255, 255, 0.08);
        transition: transform 0.3s ease;
        padding: 5px 13px;
        box-sizing: border-box;
        position: fixed;
        left: 0;
        top: calc(60px + env(safe-area-inset-top, 0px));
        height: 80%;
        top: 60px;
      }

      #users-panel.hidden {
        transform: translateX(-100%);
      }

      .users-toggle {
        left: 260px;
        z-index: 101;
        border-left: none;
        transition: left 0.3s ease;
        top: -50px;
      }

      .users-toggle.panel-hidden {
        left: 0;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
      }

      .bot-toggle-container {
        width: 40px;
        padding: 0;
        flex-shrink: 0;
      }

      #bot-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px;
        font-size: 0; /* collapse text spacing */
        width: 100%;
        height: 36px;
        border-radius: 8px;
        min-width: 0;
      }

      #bot-toggle .robot-icon {
        font-size: 18px;
      }

      #bot-toggle .robot-status {
        display: none !important; /* hide text completely */
      }
      #messages {
        padding: 0px;
      }

      #chat-form button {
        padding: 6px 6px;
        font-size: 16px;
        min-height: 30px;
        min-width: 30px;
      }

      #message-input {
        flex: 1;
        font-size: 14px;
        padding: 10px 14px;
        border-radius: 8px;
        min-height: 44px;
        min-width: 0; /* prevents overflow in flex layout */
      }

      #chat-form button[type='submit'] {
        flex: 0 0 auto;
        font-size: 14px;
        padding: 10px 14px;
        min-height: 44px;
        border-radius: 8px;
      }
    }
  }
}

/* Additional Safari backdrop-filter fallbacks */
.glass-overlay,
.connecting-overlay,
#chat-container,
#users-panel,
.modal-content,
#pm-footer,
#chat-form {
  background-color: rgba(255, 255, 255, 0.1);
}

.glass-overlay {
  background-color: rgba(255, 255, 255, 0.15);
}

.connecting-overlay {
  background-color: rgba(0, 0, 0, 0.6);
}

#chat-container {
  background-color: rgba(255, 255, 255, 0.1);
}

#users-panel {
  background-color: rgba(255, 255, 255, 0.04);
}

.modal-content {
  background-color: rgba(255, 255, 255, 0.2);
}

#pm-footer {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Edit username styles */
#edit-username-btn {
  background: none;
  border: none;
  color: var(--text-white);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: var(--transition);
}

#edit-username-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.edit-username-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: var(--text-white);
  font-size: 14px;
  padding: 4px 8px;
  outline: none;
  transition: var(--transition);
}

.edit-username-input:focus {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.edit-username-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#save-username-btn,
#cancel-username-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: var(--text-white);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  transition: var(--transition);
}

#save-username-btn:hover {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.5);
}

#cancel-username-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
}

#save-username-btn:active,
#cancel-username-btn:active {
  transform: scale(0.95);
}

/* Info Panel Styles */
.info-toggle {
  position: fixed;
  right: 320px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: none;
  border-radius: 12px 0 0 12px;
  padding: 12px 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 80vh;
  width: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20px;
}

.info-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: -3px 0 20px rgba(0, 0, 0, 0.2);
}

.info-toggle.panel-hidden {
  right: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#info-panel {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  height: 80vh;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0;
  padding: 18px;
  backdrop-filter: blur(20px);
  color: var(--text-white);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15);
  z-index: 50;
  overflow-y: auto;
  transform: translateY(-50%) translateX(0);
  transition: transform 0.3s ease;
}

#info-panel::-webkit-scrollbar {
  width: 10px;
  margin-right: 1px;
  background-color: rgba(27, 4, 84, 0.2);
}

#info-panel::-webkit-scrollbar-track {
  background: rgba(124, 80, 235, 0.15);
  border-radius: 3px;
}

#info-panel::-webkit-scrollbar-thumb {
  background: rgba(51, 13, 190, 0.2);
  border-radius: 3px;
  transition: background 0.3s ease;
}

#info-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

#info-panel.hidden {
  transform: translateY(-50%) translateX(100%);
}

#info-panel h3 {
  margin: 0;
  padding: 20px 20px 15px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
}

.info-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.info-content::-webkit-scrollbar {
  width: 6px;
}

.info-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.5);
}

.info-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 3px;
}

.info-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.8);
}

.info-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.info-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
}

.info-section p {
  margin: 0 0 12px 0;
  font-size: 20px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.info-section ul {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}

.info-section li {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
}

.info-section li::before {
  content: '•';
  color: var(--accent-blue);
  font-weight: bold;
  position: absolute;
  left: -15px;
}

.info-section .example-questions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.info-section .example-tag {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-white);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 1.3;
}

.info-section .example-tag:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

/* Toast Notification System */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: rgba(11, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  color: white;
  font-size: 14px;
  font-weight: 500;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
}

/* Ensure text content appears above arrows */
.toast .toast-text {
  position: relative;
  z-index: 10;
}

/* Arrow styles for tutorial toasts */
.toast::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 20px solid transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

/* Glow effect for arrows */
.toast::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border: 60px solid transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  filter: blur(12px);
}

/* Arrow pointing right (toast on left side of target) */
.toast[data-arrow='left']::before {
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--arrow-color);
  opacity: 1;
}

.toast[data-arrow='left']::after {
  right: -82px;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--arrow-glow-color);
  opacity: 1;
}

/* Arrow pointing left (toast on right side of target) */
.toast[data-arrow='right']::before {
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--arrow-color);
  opacity: 1;
}

.toast[data-arrow='right']::after {
  left: -82px;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--arrow-glow-color);
  opacity: 1;
  z-index: 1;
}

/* Arrow pointing down (toast above target) */
.toast[data-arrow='up']::before {
  bottom: -40px;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border-top-color: var(--arrow-color);
  opacity: 1;
  z-index: 2;
}

.toast[data-arrow='up']::after {
  bottom: -82px;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border-top-color: var(--arrow-glow-color);
  opacity: 1;
  z-index: 1;
}

/* Arrow pointing up (toast below target) */
.toast[data-arrow='down']::before {
  top: -40px;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border-bottom-color: var(--arrow-color);
  opacity: 1;
  z-index: 2;
}

.toast[data-arrow='down']::after {
  top: -82px;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border-bottom-color: var(--arrow-glow-color);
  opacity: 1;
  z-index: 1;
}

/* Animation classes */
.toast.slide-animation {
  transform: translateX(100%);
  animation: slideInToast 0.3s ease forwards;
}

.toast.fade-animation {
  transform: none;
  animation: fadeInToast 0.3s ease forwards;
}

.toast.show {
  opacity: 1;
}

.toast.slide-animation.show {
  transform: translateX(0);
}

.toast.fade-animation.show {
  transform: none;
}

.toast.hide {
  opacity: 0;
}

.toast.slide-animation.hide {
  transform: translateX(100%);
  animation: slideOutToast 0.3s ease forwards;
}

.toast.fade-animation.hide {
  transform: none;
  animation: fadeOutToast 0.3s ease forwards;
}

.toast:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.02);
}

.toast.success {
  border-left: 4px solid #4ade80;
}

.toast.info {
  border-left: 4px solid #60a5fa;
}

.toast.warning {
  border-left: 4px solid #fbbf24;
}

.toast.error {
  border-left: 4px solid #f87171;
}

@keyframes slideInToast {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutToast {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

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

/* Mobile responsive */
@media (max-width: 768px) {
  #toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    max-width: none;
    margin-bottom: 8px;
    font-size: 13px;
    padding: 12px 16px;
  }

  /* Smaller arrows on mobile */
  .toast::before {
    border-width: 14px;
  }

  .toast::after {
    border-width: 16px;
  }

  .toast[data-arrow='left']::before {
    right: -28px;
  }

  .toast[data-arrow='left']::after {
    right: -32px;
  }

  .toast[data-arrow='right']::before {
    left: -28px;
  }

  .toast[data-arrow='right']::after {
    left: -32px;
  }

  .toast[data-arrow='up']::before {
    bottom: -28px;
  }

  .toast[data-arrow='up']::after {
    bottom: -32px;
  }

  .toast[data-arrow='down']::before {
    top: -28px;
  }

  .toast[data-arrow='down']::after {
    top: -32px;
  }
}

/* Sequence toast styles */
.sequence-toast {
  transition: opacity 0.3s ease, transform 0.3s ease, width 0.3s ease, height 0.3s ease;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
}

.sequence-toast::before {
  transition: left 0.3s ease;
}
