.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 16px 0;
}

.stat-card {
  background: var(--surface-color, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));
}

.stat-label {
  font-size: 12px;
  color: var(--text-light, #6b7280);
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color, #111827);
}

.turnover-progress-card {
  background: var(--surface-color, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.turnover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.turnover-text { font-weight: 600; }

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient, linear-gradient(135deg, #6366f1, #22c55e));
  width: 0%;
  transition: width .35s ease;
}

.turnover-caption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-light, #6b7280);
  text-align: right;
}
.config-description {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.config-description-icon {
  flex-shrink: 0;
  color: #6366f1;
  margin-top: 2px;
}

.config-description-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #4f46e5;
}
.tutorial-btn .tutorial-prev-text,
.tutorial-btn #tutorialNextText {
  display: inline-block;
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* Loading Overlay Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--surface-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.loading-spinner {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.loading-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  animation: loadingBounce 1.4s ease-in-out infinite both;
}

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

.loading-text {
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
}

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

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

/* Root variables */
:root {
  /* Primary Colors - Default Ocean Blue Theme */
  --primary-color: #0ea5e9;
  --secondary-color: #0284c7;
  --primary-gradient: linear-gradient(135deg, #0ea5e9, #0284c7);

  /* RGB Values for Background Effects */
  --primary-rgb: 14, 165, 233;
  --secondary-rgb: 2, 132, 199;

  /* Logo Styling */
  --logo-opacity: 0.30;
  --logo-size: 300px;
  --logo-filter: none;

  /* Background & Surface */
  --background-color: #f0f9ff;
  --surface-color: #ffffff;
  --text-color: #0f172a;
  --text-light: #475569;
  --border-color: #e0f2fe;
  --accent-gradient: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(2, 132, 199, 0.05));
  
  /* Status Colors */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  
  /* Design System */
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --border-radius-sm: 8px;
  --transition-speed: 0.3s;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --mobile-width: 767px;
}

/* Theme Palettes */
[data-theme="orange"] {
  --primary-color: #FF6701;
  --secondary-color: #fb924c;
  --primary-gradient: linear-gradient(135deg, #FF6701, #fb924c);
  --primary-rgb: 255, 103, 1;
  --secondary-rgb: 251, 146, 76;
  --logo-opacity: 0.30;
  --logo-filter: none;
  --background-color: #f8fafc;
  --surface-color: #ffffff;
  --text-color: #334155;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --accent-gradient: linear-gradient(135deg, rgba(255, 103, 1, 0.1), rgba(251, 146, 76, 0.05));
}

[data-theme="blue"] {
  --primary-color: #0ea5e9;
  --secondary-color: #0284c7;
  --primary-gradient: linear-gradient(135deg, #0ea5e9, #0284c7);
  --primary-rgb: 14, 165, 233;
  --secondary-rgb: 2, 132, 199;
  --logo-opacity: 0.30;
  --logo-filter: none;
  --background-color: #f0f9ff;
  --surface-color: #ffffff;
  --text-color: #0f172a;
  --text-light: #475569;
  --border-color: #e0f2fe;
  --accent-gradient: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(2, 132, 199, 0.05));
}

[data-theme="purple"] {
  --primary-color: #8b5cf6;
  --secondary-color: #7c3aed;
  --primary-gradient: linear-gradient(135deg, #8b5cf6, #7c3aed);
  --primary-rgb: 139, 92, 246;
  --secondary-rgb: 124, 58, 237;
  --logo-opacity: 0.30;
  --logo-filter: none;
  --background-color: #faf5ff;
  --surface-color: #ffffff;
  --text-color: #1e1b4b;
  --text-light: #6366f1;
  --border-color: #ede9fe;
  --accent-gradient: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(124, 58, 237, 0.05));
}

[data-theme="green"] {
  --primary-color: #10b981;
  --secondary-color: #059669;
  --primary-gradient: linear-gradient(135deg, #10b981, #059669);
  --primary-rgb: 16, 185, 129;
  --secondary-rgb: 5, 150, 105;
  --logo-opacity: 0.30;
  --logo-filter: none;
  --background-color: #f0fdf4;
  --surface-color: #ffffff;
  --text-color: #064e3b;
  --text-light: #047857;
  --border-color: #dcfce7;
  --accent-gradient: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
}

[data-theme="pink"] {
  --primary-color: #ec4899;
  --secondary-color: #db2777;
  --primary-gradient: linear-gradient(135deg, #ec4899, #db2777);
  --primary-rgb: 236, 72, 153;
  --secondary-rgb: 219, 39, 119;
  --logo-opacity: 0.30;
  --logo-filter: none;
  --background-color: #fdf2f8;
  --surface-color: #ffffff;
  --text-color: #831843;
  --text-light: #be185d;
  --border-color: #fce7f3;
  --accent-gradient: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(219, 39, 119, 0.05));
}

[data-theme="dark"] {
  --primary-color: #6366f1;
  --secondary-color: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1, #4f46e5);
  --primary-rgb: 99, 102, 241;
  --secondary-rgb: 79, 70, 229;
  --logo-opacity: 0.60;
  --logo-filter: brightness(1.2) contrast(1.1);
  --background-color: #1f2937;
  --surface-color: #374151;
  --text-color: #f9fafb;
  --text-light: #d1d5db;
  --border-color: #4b5563;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --accent-gradient: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.05));
}


/* Global styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
}

/* Enhanced Background Design */
.main-theme-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--background-color);
  z-index: -1;
  overflow: hidden;
  /* Ensure background is visible */
  pointer-events: none;
}

/* Geometric Pattern Overlay */
.main-theme-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent-gradient);
  z-index: 1;
}

/* Professional Logo Watermarks */
.logo-watermark {
  position: absolute;
  opacity: var(--logo-opacity);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoFloat 15s ease-in-out infinite;
}

.company-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: var(--logo-filter, none);
  transition: all 0.3s ease;
}

/* Subtle floating animation for logos */
@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-5px) rotate(1deg);
  }
  50% {
    transform: translateY(0px) rotate(0deg);
  }
  75% {
    transform: translateY(5px) rotate(-1deg);
  }
}

/* Primary Hero Logo - Center-Right */
.logo-primary {
  top: 50%;
  right: 8%;
  width: clamp(300px, 25vw, 450px);
  height: clamp(180px, 15vh, 270px);
  transform: translateY(-50%) rotate(-12deg);
  opacity: calc(var(--logo-opacity) * 1.8);
  animation-delay: 0s;
  z-index: 3;
}

/* Secondary Logo Positions - Strategically Placed */
.logo-secondary-1 {
  top: 18%;
  left: -3%;
  width: clamp(120px, 15vw, 200px);
  height: clamp(72px, 9vh, 120px);
  transform: rotate(22deg);
  animation-delay: 5s;
}

.logo-secondary-2 {
  bottom: 12%;
  left: 8%;
  width: clamp(100px, 12vw, 160px);
  height: clamp(60px, 7vh, 96px);
  transform: rotate(-28deg);
  animation-delay: 10s;
}

.logo-secondary-3 {
  top: 75%;
  right: -5%;
  width: clamp(140px, 18vw, 240px);
  height: clamp(84px, 11vh, 144px);
  transform: rotate(38deg);
  animation-delay: 7s;
}

/* Elegant Floating Particles */
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.4;
  animation: particleFloat 25s infinite linear;
  z-index: 3;
  box-shadow: 0 0 6px rgba(var(--primary-rgb), 0.3);
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(0px) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.4;
    transform: translateY(90vh) translateX(10px) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translateY(50vh) translateX(-15px) scale(1.2);
  }
  90% {
    opacity: 0.4;
    transform: translateY(10vh) translateX(25px) scale(1);
  }
  100% {
    transform: translateY(-10vh) translateX(30px) scale(0);
    opacity: 0;
  }
}

/* Sophisticated Grid Pattern */
.grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.015;
  background-image:
    linear-gradient(rgba(var(--primary-rgb), 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--primary-rgb), 0.1) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
  animation: gridShift 30s ease-in-out infinite alternate;
}

@keyframes gridShift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(10px, 10px); }
}

/* Professional Gradient Orbs */
.gradient-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15) 0%, transparent 70%);
  opacity: 0.12;
  animation: orbPulse 12s ease-in-out infinite;
  z-index: 2;
  filter: blur(1px);
}

.orb-1 {
  width: clamp(200px, 20vw, 350px);
  height: clamp(200px, 20vw, 350px);
  top: 15%;
  left: 75%;
  animation-delay: 0s;
}

.orb-2 {
  width: clamp(150px, 15vw, 250px);
  height: clamp(150px, 15vw, 250px);
  bottom: 25%;
  left: 5%;
  animation-delay: 4s;
}

.orb-3 {
  width: clamp(100px, 12vw, 180px);
  height: clamp(100px, 12vw, 180px);
  top: 65%;
  left: 55%;
  animation-delay: 8s;
}

@keyframes orbPulse {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.12;
  }
  33% {
    transform: scale(1.15) rotate(120deg);
    opacity: 0.18;
  }
  66% {
    transform: scale(0.9) rotate(240deg);
    opacity: 0.08;
  }
}

/* Refined Mobile Responsive Design */
@media (max-width: 768px) {
  .logo-primary {
    width: clamp(200px, 30vw, 300px);
    height: clamp(120px, 18vh, 180px);
    right: 5%;
    transform: translateY(-50%) rotate(-8deg);
  }

  .logo-secondary-1 {
    width: clamp(80px, 12vw, 120px);
    height: clamp(48px, 7vh, 72px);
    top: 10%;
    left: -5%;
  }

  .logo-secondary-2 {
    width: clamp(70px, 10vw, 100px);
    height: clamp(42px, 6vh, 60px);
    bottom: 8%;
    left: 5%;
  }

  .logo-secondary-3 {
    width: clamp(90px, 14vw, 130px);
    height: clamp(54px, 8vh, 78px);
    top: 80%;
    right: -8%;
  }

  /* Optimize animations for mobile performance */
  .logo-watermark {
    animation-duration: 20s;
  }

  .particle {
    animation-duration: 30s;
  }

  .gradient-orb {
    animation-duration: 15s;
  }
}

/* Responsive Language Dropdown */
@media (max-width: 768px) {
  .language-dropdown-btn {
    padding: 6px 10px;
    height: 32px;
    font-size: 13px;
  }

  .language-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%; /* Circular display on tablet */
    object-fit: cover;
  }

  .language-text {
    font-size: 13px;
  }

  .dropdown-arrow {
    width: 10px;
    height: 10px;
  }

  .dropdown-menu {
    width: 100%;
    min-width: 100%;
    margin-bottom: 6px; /* Space above button on mobile */
    right: 0;
    left: 0;
    bottom: 100%;
    top: auto;
  }

  .dropdown-menu .language-options {
    padding: 10px 12px;
    gap: 10px;
  }

  .dropdown-menu .language-options img {
    width: 20px;
    height: 20px;
    border-radius: 50%; /* Circular display on tablet */
    object-fit: cover;
  }

  .dropdown-menu .language-options span {
    font-size: 13px;
  }
}

/* iOS Safari specific: ensure input area stays above bottom UI and not blocked */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 767px) {
    .chatbot-widget {
      padding-bottom: max(0px, env(safe-area-inset-bottom));
    }

    .telegram-input-container {
      padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
  }
}

@media (max-width: 480px) {
  .logo-secondary-2 {
    display: none; /* Hide one logo on very small screens */
  }

  .particle:nth-child(odd) {
    display: none; /* Reduce particle count for performance */
  }

  .language-dropdown-btn {
    padding: 5px 8px;
    height: 30px;
    font-size: 12px;
  }

  .language-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%; /* Circular display on mobile */
    object-fit: cover;
  }

  .language-text {
    font-size: 12px;
  }

  .dropdown-menu {
    width: 100%;
    min-width: 100%;
    right: 0;
    left: 0;
    bottom: 100%;
    top: auto;
    margin-bottom: 5px; /* Small space on very small screens */
  }

  .dropdown-menu .language-options {
    padding: 8px 10px;
    gap: 8px; /* Slightly smaller gap on mobile */
  }

  .dropdown-menu .language-options img {
    width: 18px;
    height: 18px;
    border-radius: 50%; /* Circular display on mobile */
    object-fit: cover;
  }
}

/* Widget container */
.widget-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  box-sizing: border-box;
}

/* Initially hidden until configuration is loaded */
.chatbot-widget {
  /* Desktop defaults */
  width: clamp(560px, min(85vw, 560px), 600px);
  height: clamp(780px, min(80vh, 780px), 850px);
  max-width: 95vw;
  max-height: 95vh;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  display: none; /* Hidden by default */
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  background-color: var(--surface-color);
  backdrop-filter: blur(10px);
  transition: all var(--transition-speed) ease;
}

/* Show chatbot when configuration is loaded */
.chatbot-widget.loaded {
  display: flex;
}

/* Medium screen optimizations - preserve original dimensions when possible */
@media (max-width: 767px) {
  /* Fill the mobile viewport using dynamic viewport units and safe-area */
  .widget-container {
    position: fixed;
    inset: 0;
    transform: none;
  }

  .chatbot-widget {
    width: 100svw; /* small viewport width accounts for browser UI */
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-width: 100svw;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 0;
    box-shadow: none;
  }
}

@media (min-width: 768px) and (max-width: 1200px) {
  .chatbot-widget {
    width: clamp(450px, min(90vw, 560px), 580px);
    height: clamp(650px, min(85vh, 780px), 800px);
  }
}

.chatbot-button {
  text-transform: capitalize;
  background: var(--secondary-color);
  /* border: .5px solid #cecece; */
  border: none;
  outline: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px 2px 4px;
}


/* Header styles - Compact purple area with same logo size */
.header {
  background: var(--primary-gradient);
  color: white;
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  pointer-events: none;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-icon {
  width: 30px;
  height: 30px;
}

img {
  object-fit: cover;
  width: 48px;
  height: 48px;
  object-position: top;
  border-radius: 50%;
  margin-right: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition-speed) ease;
}

img:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.header-text h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.header-text p {
  margin: 0;
  font-size: 13px;
  opacity: 0.8;
}

.header-right {
  display: flex;
  align-items: center;
}

/* Elegant Restart Button */
.restart-btn-elegant {
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 8px 16px;
  color: white;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.restart-text {
  position: relative;
  z-index: 2;
}

.restart-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s ease;
}

.restart-btn-elegant:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.2));
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.restart-btn-elegant:hover .restart-shine {
  left: 100%;
}

.restart-btn-elegant:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Color Theme Button - Enhanced Visual Presence with Light Effect */
.color-theme-btn-elegant {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  border: none;
  border-radius: 22px;
  padding: 8px;
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-right: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-theme-btn-elegant:hover {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-theme-btn-elegant:active {
  transform: scale(0.95);
}

/* Settings Button - Enhanced Visual Presence with Light Effect */
.settings-btn-elegant {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  border: none;
  border-radius: 22px;
  padding: 8px;
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-right: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn-elegant:hover {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-btn-elegant:active {
  transform: rotate(90deg) scale(0.95);
}

/* Enhanced Button Animations */
@keyframes gentlePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.5);
  }
}

@keyframes shimmer {
  0%, 100% {
    transform: translateX(-100%) translateY(-100%);
  }
  50% {
    transform: translateX(100%) translateY(100%);
  }
}

/* Animation States */
.color-theme-btn-elegant.animate,
.settings-btn-elegant.animate {
  animation: gentlePulse 3s ease-in-out infinite;
}

.color-theme-btn-elegant.animate::after,
.settings-btn-elegant.animate::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  animation: shimmer 4s ease-in-out infinite;
  pointer-events: none;
  border-radius: 22px;
}

.color-theme-btn-elegant.no-animate,
.settings-btn-elegant.no-animate {
  animation: none;
}

.color-theme-btn-elegant.no-animate::after,
.settings-btn-elegant.no-animate::after {
  display: none;
}

/* Badge Indicator */
.badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: badgePulse 2s ease-in-out infinite;
  z-index: 10;
}

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


/* Custom Confirm Modal */
.custom-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.custom-confirm-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.custom-confirm-content {
  background: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 400px;
  overflow: hidden;
  transform: scale(0.9);
  animation: confirmSlideUp 0.3s ease-out forwards;
}

@keyframes confirmSlideUp {
  to {
    transform: scale(1);
  }
}

.custom-confirm-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border-color);
}

.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 103, 1, 0.1), rgba(251, 146, 76, 0.05));
  border: 2px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  flex-shrink: 0;
}

.custom-confirm-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: -0.5px;
}

.custom-confirm-body {
  padding: 20px 24px;
}

.custom-confirm-body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-light);
}

.custom-confirm-actions {
  display: flex;
  gap: 12px;
  padding: 16px 24px 24px;
  justify-content: flex-end;
}

.confirm-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: none;
  outline: none;
  min-width: 100px;
  justify-content: center;
}

.cancel-btn {
  background: var(--background-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.cancel-btn:hover {
  background: var(--border-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.confirm-btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.confirm-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

/* Settings Modal */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.settings-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.settings-content {
  background: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.9);
  animation: modalSlideUp 0.3s ease-out forwards;
}

@keyframes modalSlideUp {
  to {
    transform: scale(1);
  }
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border-color);
}

.settings-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: -0.5px;
}

.settings-close-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-close-btn:hover {
  background: var(--border-color);
  color: var(--text-color);
  transform: scale(1.1);
}

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

.settings-section {
  margin-bottom: 32px;
}

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

.settings-section h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
}

.settings-description {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Theme Grid */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.theme-option {
  background: var(--surface-color);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  position: relative;
  text-align: center;
}

.theme-option:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.theme-option.active {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(255,103,1,0.1), rgba(251,146,76,0.05));
}

.theme-option.active .theme-check {
  opacity: 1;
  transform: scale(1);
}

.theme-preview {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  justify-content: center;
}

.theme-color-primary,
.theme-color-secondary,
.theme-color-accent {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.theme-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  display: block;
  margin-bottom: 8px;
}

.theme-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--transition-speed) ease;
}

/* Custom Theme Styles */
.theme-custom {
  position: relative;
  background: linear-gradient(135deg, rgba(255,103,1,0.05), rgba(251,146,76,0.02));
  border: 2px dashed var(--border-color) !important;
}

.theme-custom:hover {
  border-color: var(--primary-color) !important;
  border-style: dashed !important;
  background: linear-gradient(135deg, rgba(255,103,1,0.1), rgba(251,146,76,0.05));
}

.theme-custom.active {
  border-style: solid !important;
  background: linear-gradient(135deg, rgba(255,103,1,0.15), rgba(251,146,76,0.1));
}

.theme-custom-icon {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  color: var(--primary-color);
  opacity: 0.7;
}

.theme-custom-hint {
  font-size: 11px;
  color: var(--text-light);
  opacity: 0.8;
  margin-top: 4px;
  font-style: italic;
}

/* Custom Color Section */
.custom-color-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  animation: slideDown 0.3s ease-out;
}

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

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.color-picker-item {
  background: var(--background-color);
  border-radius: var(--border-radius);
  padding: 16px;
  border: 1px solid var(--border-color);
}

.color-picker-item label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 8px;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-input {
  width: 50px;
  height: 40px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  outline: none;
  transition: all var(--transition-speed) ease;
}

.color-input:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.color-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 103, 1, 0.2);
}

.color-value {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--text-light);
  background: var(--surface-color);
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  min-width: 80px;
  text-align: center;
  font-weight: 500;
}

/* Custom Theme Actions */
.custom-theme-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.custom-theme-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: none;
  outline: none;
}

.reset-btn {
  background: var(--background-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.reset-btn:hover {
  background: var(--border-color);
  transform: translateY(-1px);
}

.done-btn {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.done-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.done-btn:active,
.reset-btn:active {
  transform: translateY(0);
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  top: 220px; /* lowered slightly per request */
  right: 24px;
  z-index: 20000;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 500px;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= Clickable Conversation Images ================= */
.clickable-conversation-image {
  cursor: pointer !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  border-radius: 8px !important;
  max-width: 100%;
  height: auto;
}

.clickable-conversation-image:hover {
  transform: scale(1.02) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.clickable-conversation-image:active {
  transform: scale(0.98) !important;
}

/* ================= Image Lightbox (in-chat viewer) ================= */
.image-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30000;
  backdrop-filter: blur(4px);
}

.image-lightbox-overlay.show {
  display: flex;
}

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

.image-lightbox-img {
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  object-fit: contain;
}

/* Mobile responsiveness for larger images */
@media (max-width: 768px) {
  .image-lightbox-content {
    max-width: 98vw;
    max-height: 98vh;
  }
  
  .image-lightbox-img {
    max-width: 98vw;
    max-height: 98vh;
    border-radius: 8px;
  }
}

@media (max-width: 480px) {
  .image-lightbox-img {
    border-radius: 6px;
  }
}

.toast-notification.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.toast-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 12px;
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  flex: 1;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--border-color);
  color: var(--text-color);
}

.toast-success {
  border-left: 4px solid var(--success-color);
  background: linear-gradient(to right, rgba(16, 185, 129, 0.1), var(--surface-color));
}

.toast-info {
  border-left: 4px solid var(--primary-color);
  background: linear-gradient(to right, rgba(255, 103, 1, 0.1), var(--surface-color));
}

.toast-warning {
  border-left: 4px solid var(--warning-color);
  background: linear-gradient(to right, rgba(245, 158, 11, 0.1), var(--surface-color));
}

.toast-error {
  border-left: 4px solid var(--danger-color);
  background: linear-gradient(to right, rgba(239, 68, 68, 0.1), var(--surface-color));
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .settings-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .settings-header {
    padding: 20px 20px 12px;
  }
  
  .settings-header h3 {
    font-size: 20px;
  }
  
  .settings-body {
    padding: 20px;
  }
  
  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .theme-option {
    padding: 12px;
  }
  
  .color-theme-btn-elegant {
    width: 44px;
    height: 44px;
    margin-right: 8px;
  }

  .settings-btn-elegant {
    width: 44px;
    height: 44px;
    margin-right: 8px;
  }
  
  .restart-btn-elegant {
    padding: 6px 12px;
    font-size: 12px;
  }

  .toast-notification {
    top: 500px;
    right: 12px;
    left: 12px;
    min-width: auto;
    max-width: none;
  }

  .color-picker-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .color-picker-item {
    padding: 12px;
  }

  .custom-theme-actions {
    flex-direction: column;
    gap: 8px;
  }

  .custom-theme-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
  }

  .custom-confirm-content {
    width: 95%;
    max-width: 350px;
  }

  .custom-confirm-header {
    padding: 20px 20px 12px;
    gap: 12px;
  }

  .confirm-icon {
    width: 40px;
    height: 40px;
  }

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

  .custom-confirm-body {
    padding: 16px 20px;
  }

  .custom-confirm-body p {
    font-size: 15px;
  }

  .custom-confirm-actions {
    flex-direction: column;
    gap: 8px;
    padding: 12px 20px 20px;
  }

  .confirm-btn {
    width: 100%;
    padding: 14px 20px;
  }

  /* Mobile scroll to bottom button */
  .scroll-to-bottom-btn {
    bottom: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
  }

  .unread-count {
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    font-size: 10px;
  }
}

.header-status {
  display: flex;
  align-items: center;
  font-size: 14px;
  padding: 5px 15px;
  margin-top: 10px;
  flex-wrap: nowrap;
  border-top: 1px solid var(--border-color);
  background: var(--secondary-color);
}

/* Professional Language Dropdown Styling */
#language-dropdown-container {
  width: 100%;
  margin-top: auto;
  margin-bottom: auto;
  /* Ensure dropdown menu inherits container width */
  position: relative;
}

/* Elegant Language Dropdown Button */
.language-dropdown-btn {
  width: 100%;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 14px;
  padding: 8px 12px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.language-dropdown-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.1), transparent);
  transition: left 0.5s ease;
}

.language-dropdown-btn:hover::before {
  left: 100%;
}

.language-dropdown-btn:hover {
  background: var(--background-color);
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-dropdown-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.language-dropdown-btn:active {
  transform: translateY(0px);
}

/* Language Button Content */
.language-btn-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.language-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%; /* Circular display for button icon */
  transition: transform 0.2s ease;
  object-fit: cover;
}

.language-text {
  font-weight: 500;
  color: var(--text-color);
  font-size: 14px;
}

/* Dropdown Arrow - points down when menu is above */
.dropdown-arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.6;
  margin-left: 8px;
  transform: rotate(0deg); /* Arrow points down by default */
}

.language-dropdown-btn[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(0deg); /* Keep pointing down when menu is open */
  opacity: 1;
}

.language-dropdown-btn:hover .dropdown-arrow {
  opacity: 1;
}

/* Professional Dropdown Menu Styling with upward positioning */
.dropdown-menu {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--surface-color);
  color: var(--text-color);
  /* Same width as button for consistent appearance */
  width: 100%;
  min-width: 100%;
  padding: 12px 0;
  backdrop-filter: blur(10px);
  animation: dropdownSlideUp 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  /* Position above the button instead of below */
  position: absolute;
  bottom: 100%;
  top: auto;
  right: 0;
  left: 0;
  z-index: 1050;
  /* Ensure smooth upward animation */
  transform: translateY(0);
  margin-bottom: 8px; /* Space between button and menu */
}

/* Show dropdown when Bootstrap adds the 'show' class */
.dropdown-menu.show {
  display: block;
  transform: translateY(0); /* Ensure no transform issues */
}

/* Override Bootstrap's default dropdown positioning */
.dropdown-toggle ~ .dropdown-menu,
.language-dropdown-btn ~ .dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: auto; /* Ensure left is auto to prevent conflicts */
  transform: translateY(0);
}

/* Language dropdown container specific styling */
#language-dropdown-container .dropdown-menu {
  width: 100%;
  min-width: 100%;
  right: 0;
  left: 0;
  /* Position above the button */
  bottom: 100%;
  top: auto;
  margin-bottom: 8px;
  /* Ensure smooth upward animation */
  will-change: transform;
  backface-visibility: hidden;
  perspective: 1000px;
  /* Browser compatibility */
  -webkit-transform: translateZ(0);
  -moz-transform: translateZ(0);
  -ms-transform: translateZ(0);
  -o-transform: translateZ(0);
  transform: translateZ(0);
}

/* Prevent dropdown from jumping during animation */
.dropdown-menu {
  contain: layout style paint;
  contain-intrinsic-size: 0 200px;
}

/* Ensure dropdown doesn't interfere with other elements */
.dropdown-menu {
  isolation: isolate;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--surface-color);
  filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

.dropdown-menu .language-options {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.dropdown-menu .language-options:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
  transform: translateX(4px);
}

.dropdown-menu .language-options:active {
  transform: translateX(2px);
}

.dropdown-menu .language-options img {
  width: 24px;
  height: 24px;
  border-radius: 50%; /* Changed to circular display */
  transition: transform 0.2s ease;
  flex-shrink: 0;
  object-fit: cover; /* Ensure proper scaling for circular display */
}

.dropdown-menu .language-options:hover img {
  transform: scale(1.1);
}

.dropdown-menu .language-options span {
  font-size: 14px;
  font-weight: 500;
  vertical-align: middle;
  line-height: 1.4;
}

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


.activity-status {
  transform: translateX(-16px);
  margin: 0;
  margin-top: 2em;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: lime;
  border-radius: 50%;
  margin-right: 5px;
}

/* Chat toggle button */
.chat-toggle {
  width: 60px;
  height: 60px;
  background-color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: white;
  font-size: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: fixed;
  bottom: 20px;
  right: 20px;
}

.minimized {
  display: none;
}

/* Options container */
.options-container {
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 10px;
  margin-top: 15px;
}

.options-container h5 {
  text-align: left;
  margin-bottom: 10px;
  color: var(--text-light);
  font-size: 11px;
  font-weight: 600;
  padding-left: 5px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.option {
  background-color: white;
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color var(--transition-speed) ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.option:hover {
  background-color: var(--background-color);
}

.option .icon {
  font-size: 24px;
  margin-right: 10px;
  width: 30px;
  height: 30px;
  background-color: #e9ecef;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.option span:not(.icon) {
  font-size: 12px;
  color: var(--text-color);
  font-weight: 500;
  word-break: break-word;
}

.option.special-offer {
  position: relative;
  overflow: hidden;
}

.option.special-offer::before {
  content: 'SPECIAL OFFER';
  position: absolute;
  top: 15px;
  right: -35px;
  background-color: var(--danger-color);
  color: white;
  font-size: 8px;
  padding: 2px 25px;
  transform: rotate(45deg);
}

/* Option icon colors */
.option-icon-blue {
  background-color: #e7f5ff;
  color: #339af0;
}

.option-icon-yellow {
  background-color: #fff9db;
  color: var(--warning-color);
}

.option-icon-orange {
  background-color: #fff4e6;
  color: #ff922b;
}

.option-icon-purple {
  background-color: #f8f0fc;
  color: #cc5de8;
}

.option-icon-green {
  background-color: #e6fcf5;
  color: #20c997;
}

.option-icon-red {
  background-color: #fff5f5;
  color: #ff6b6b;
}

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background-color: var(--background-color);
  position: relative;
  scroll-behavior: smooth;
}

/* Custom Scrollbar Styles */
.messages::-webkit-scrollbar {
  width: 6px;
}

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
  width: 8px;
}

/* For dark themes */
[data-theme="dark"] .messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Gradient Fade Effects */
.messages::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, var(--background-color), transparent);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.messages::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to top, var(--background-color), transparent);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.messages.has-scroll-top::before {
  opacity: 1;
}

.messages.has-scroll-bottom::after {
  opacity: 1;
}

/* Scroll to Bottom Button */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-gradient);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(60px);
  opacity: 0;
}

.scroll-to-bottom-btn.show {
  transform: translateY(0);
  opacity: 1;
}

.scroll-to-bottom-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-xl);
}

.scroll-to-bottom-btn:active {
  transform: translateY(0) scale(0.95);
}

/* Unread Message Count Badge */
.unread-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--danger-color);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  animation: pulse 2s infinite;
}

.unread-count.show {
  display: flex;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Smooth scroll behavior */
.messages.smooth-scroll {
  scroll-behavior: smooth;
}

.message-container {
  margin-bottom: 20px;
  max-width: 80%;
  display: flex;
  flex-direction: column;
}

.user-message-container {
  margin-left: auto;
  align-items: flex-end;
}

.error-message {
  background-color: #fee;
  border-left: 4px solid #f66;
  padding: 10px;
  margin: 10px 0;
  border-radius: 4px;
}

.error-action-buttons {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.refresh-button {
  background-color: #f66;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.refresh-button:hover {
  background-color: #e55;
}

/* Audio playback */
#playback-container {
  width: 40%;
  right: 17.5%;
  bottom: 12.5%;
  position: absolute;
  gap: 15px;
  display: none;
}

audio {
  height: 20px;
  padding-top: 5px;
  margin: 0;
  max-width: 100%;
}

audio::-webkit-media-controls-panel {
  background-color: #FB924D;
}

#deleteRecording {
  width: 47px;
  padding: 0;
}

#recordingTimer {
  width: 50px;
}

#audio-visualizer-container {
  width: 100%;
  max-height: 40px;
  overflow: hidden;
  display: flex;
}

#audio-visualizer {
  width: 100%;
  height: 100px;
  transform: translateY(-30px);
}

.red-dot {
  width: 12px;
  height: 12px;
  margin-top: 2px;
  background-color: red;
  border-radius: 100%;
}

#playback-close {
  font-size: 14px;
  color: white;
  background: var(--secondary-color);
  padding-left: 5.3px;
  padding-top: 1.5px;
  min-width: 14.7px;
  min-height: 18.5px;
  cursor: pointer;
  border-left: none;
  border-radius: 100px;
}

@media (max-width: 767px) {
  #playback-container {
    right: 12.5%;
    bottom: 12%;
    gap: 30px;
  }

  #recorder-timer-container {
    right: 12.5%;
    bottom: 12%;
    /* display: flex; */
  }
}


.bot-message-container {
  margin-right: auto;
  align-items: flex-start;
}

.message-pending-container {
  padding: 0 18px 0 18px;
}

.username-container {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

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

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #ccc;
  background-size: cover;
  margin-left: 8px;
}

.message-containerbot-message-container .user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-image: url('https://bobo-bucket.s3.ap-southeast-1.amazonaws.com/chatbot/chatbot_avatar.png');
  background-size: cover;
  margin-left: 8px;
}

.message {
  padding: 14px 18px;
  border-radius: var(--border-radius);
  max-width: 100%;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
}

.message>p {
  margin: 0;
  padding: 0;
}

.message img {
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 0;
  display: block;
  margin: 0 0 8px 0;
}

.user-message {
  background: var(--primary-gradient);
  color: white;
  border-radius: var(--border-radius) var(--border-radius) var(--border-radius-sm) var(--border-radius);
}

.bot-message {
  background-color: var(--surface-color);
  color: var(--text-color);
  border-radius: var(--border-radius) var(--border-radius) var(--border-radius) var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

/* Chat Action Buttons */
.chat-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  margin: 8px 0;
  background: var(--primary-gradient);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  border: none;
  cursor: pointer;
  min-width: 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.chat-action-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-action-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
  text-decoration: none;
  filter: brightness(1.1);
}

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

.chat-action-button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.chat-action-button:focus {
  outline: none;
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Button variants */
.chat-action-button.secondary {
  background: var(--background-color);
  color: var(--text-color);
  border: 2px solid var(--border-color);
}

.chat-action-button.secondary:hover {
  background: var(--border-color);
  color: var(--text-color);
  border-color: var(--primary-color);
}

.chat-action-button.success {
  background: linear-gradient(135deg, var(--success-color), #059669);
}

.chat-action-button.warning {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.chat-action-button.danger {
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

/* Button icons */
.chat-action-button svg {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.chat-action-button:hover svg {
  transform: scale(1.1);
}

/* Button container for multiple buttons */
.chat-buttons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.chat-buttons-container .chat-action-button {
  margin: 0;
  flex: 1;
  min-width: 140px;
}

/* Full width button */
.chat-action-button.full-width {
  width: 100%;
  display: flex;
}

/* Row layout for two decision buttons */
.chat-buttons-row {
  display: flex;
  gap: 10px;
  margin: 8px 0 8px 0;
}

.chat-buttons-row .chat-action-button {
  flex: 1 1 0%;
  width: 100%;
}

/* hide empty lines and consecutive br tags */
.message-container p:empty,
.message-container br + br,
.message-container br + p:empty + br {
  display: none;
}

/* Disabled/greyed state */
.chat-action-button.disabled,
.chat-action-button:disabled {
  background: #9ca3af !important; /* grey */
  color: #f3f4f6 !important;
  cursor: not-allowed !important;
  filter: none !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Small button variant */
.chat-action-button.small {
  padding: 8px 16px;
  font-size: 13px;
  min-width: 100px;
}

/* Large button variant */
.chat-action-button.large {
  padding: 16px 24px;
  font-size: 16px;
  min-width: 160px;
}

.message-pending {
  display: flex;
  text-wrap: nowrap;
  gap: 4px;
  background-color: var(--surface-color);
  color: var(--text-color);
  border-radius: 18px 18px 18px 0;
  width: fit-content;
  border: 1px solid var(--border-color);
}

.message-pending-text {
  display: block;
  width: 10px;
  height: 10px;
  background: var(--text-light);
  border-radius: 100px;
  transition: .2s;
}

.error-message-container {
  margin-bottom: 10px;
  animation: errorHighlight 2s ease-in-out;
}

.error-message {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  border-radius: 8px;
  padding: 8px 12px;
  max-width: 80%;
  word-wrap: break-word;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

@keyframes errorHighlight {
  0% {
    background-color: rgba(255, 0, 0, 0.1);
  }

  50% {
    background-color: rgba(255, 0, 0, 0.2);
  }

  100% {
    background-color: transparent;
  }
}

.timestamp {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
  align-self: flex-start;
}

.user-message-container .timestamp {
  align-self: flex-end;
}

/* System Notification Styles */
.system-notification {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  padding: 12px 16px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  border-radius: var(--border-radius-sm);
  position: relative;
}

.demo-notification {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 18px;
  gap: 6px;
}

.demo-mode-banner {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-top: 8px;
}

.demo-notification .demo-badge {
  background: rgba(79, 70, 229, 0.16);
  color: #3730a3;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.system-notification::before {
  content: '';
  position: absolute;
  left: 16px;
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.6;
}

.system-notification .agent-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-left: 8px;
  border: 2px solid var(--primary-color);
}

/* FAQ Suggestion Bubbles Container (3 items) */
.faq-suggestions-container {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: bubblesUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 600px;
  flex-wrap: nowrap;
  padding: 0 20px;
  background: transparent;
  backdrop-filter: none;
  border-radius: 25px;
  border: none;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

/* Responsive design for FAQ suggestions */
@media (max-width: 768px) {
  .faq-suggestions-container {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 80px; /* stays above the input with space for two-line FAQ items */
    gap: 8px;
    max-width: calc(100svw - 32px); /* Reduced padding for wider display: 16px + 16px */
    width: calc(100svw - 32px);
    padding: 6px 8px;
    backdrop-filter: none;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory; /* horizontal snapping */
    flex-wrap: wrap; /* force horizontal */
  }

  .faq-suggestion-item {
    flex: 0 0 auto;
    /* Fixed-size card with responsive cap */
    width: calc(100svw - 32px);     /* Wider for better text display */
    height: auto;                   /* Auto height for complete text display */
    min-height: 60px;               /* Minimum height for consistency */
    max-height: none;               /* Remove max height restriction */
    padding: 14px 16px;             /* More padding for better text flow */
    margin-right: 0;
    border-radius: 20px;            /* Slightly larger border radius */

    /* Text handling - Two-line display with proper wrapping */
    white-space: normal;            /* Allow normal text wrapping */
    word-break: break-word;         /* Break long words at appropriate points */
    overflow-wrap: break-word;      /* Alternative word breaking for very long words */
    text-align: center;
    font-size: 12px;                /* Optimal size for two-line display */
    line-height: 1.3;                /* Comfortable line height for readability */
    display: -webkit-box;           /* Use webkit box for line clamping */
    -webkit-box-orient: vertical;   /* Vertical orientation for line clamp */
    -webkit-line-clamp: 2;         /* Limit to exactly 2 lines */
    line-clamp: 2;                  /* Standard property for line clamp */
    overflow: hidden;               /* Hide any content that exceeds 2 lines */

    scroll-snap-align: center;      /* snap each bubble to center */
  }

  .faq-suggestion-game-selection {
    min-width: 250px;
    max-width: 300px;
    padding: 14px;
  }

  .game-selection-buttons {
    gap: 6px;
  }

  .faq-game-btn {
    min-width: 60px;
    padding: 6px 12px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .faq-suggestions-container {
    bottom: 76px; /* stays above the input with space for two-line FAQ items */
    gap: 6px;
    backdrop-filter: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    max-width: calc(100svw - 24px); /* Wider for better text display on small screens */
    width: calc(100svw - 24px);
  }

  .faq-suggestion-item {
    width: calc(100svw - 24px);     /* Wider for better text display */
    height: auto;                   /* Auto height for two-line display */
    min-height: 56px;               /* Minimum height for consistency */
    max-height: 100px;              /* Reasonable max height for two lines */
    font-size: 11px;                /* Optimal size for small screens */
    padding: 12px 14px;             /* More padding for better text flow */
    margin-right: 0;
    /* Text handling - Two-line display with proper wrapping */
    white-space: normal;            /* Allow normal text wrapping */
    word-break: break-word;         /* Break long words at appropriate points */
    overflow-wrap: break-word;      /* Alternative word breaking for very long words */
    display: -webkit-box;           /* Use webkit box for line clamping */
    -webkit-box-orient: vertical;   /* Vertical orientation for line clamp */
    -webkit-line-clamp: 2;         /* Limit to exactly 2 lines */
    line-clamp: 2;                  /* Standard property for line clamp */
    overflow: hidden;               /* Hide any content that exceeds 2 lines */
  }

  .faq-suggestion-game-selection {
    min-width: 220px;
    max-width: 280px;
    padding: 12px;
  }

  .game-selection-header {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .game-selection-buttons {
    gap: 4px;
    margin-bottom: 10px;
  }

  .faq-game-btn {
    min-width: 55px;
    padding: 5px 10px;
    font-size: 10px;
  }

  .game-selection-hint {
    font-size: 10px;
  }
}

.faq-suggestions-container.show {
  display: flex;
  opacity: 1;
}

.faq-suggestions-container.hide {
  animation: bubblesDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.faq-suggestion-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  opacity: 0.95;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  min-width: 140px;
  max-width: none; /* Remove max-width constraint for better mobile display */
  width: auto; /* Allow responsive width */
  word-wrap: break-word;
  position: relative;
  backdrop-filter: blur(5px);
}

.faq-suggestion-item::before {
  content: "💡";
  margin-right: 6px;
  font-size: 13px;
  opacity: 0.3;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-suggestion-item:hover {
  background: var(--accent-gradient);
  color: var(--text-color);
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.25);
  border-color: var(--primary-color);
}

.faq-suggestion-item:hover::before {
  opacity: 1;
  text-shadow: 0 0 10px rgba(255, 235, 59, 0.8);
  filter: drop-shadow(0 0 3px rgba(255, 235, 59, 0.6));
}

.faq-suggestion-item:active {
  transform: translateY(-1px);
}

/* Overlay that preserves default bubbles underneath */
.faq-game-selection-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* allow inner card buttons only */
}

.faq-game-selection-overlay .faq-suggestion-game-selection {
  pointer-events: auto; /* enable clicking on buttons */
}

/* FAQ Suggestion Game Selection Styles */
.faq-suggestion-game-selection {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  backdrop-filter: blur(5px);
  min-width: 280px;
  max-width: 350px;
}

.game-selection-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
}

.game-selection-icon {
  font-size: 18px;
}

.game-selection-title {
  white-space: nowrap;
}

.game-selection-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.faq-game-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 70px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.faq-game-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
}

.faq-game-btn:active {
  transform: translateY(-1px) scale(1.02);
}

.game-selection-hint {
  font-size: 11px;
  color: var(--text-light);
  opacity: 0.8;
  line-height: 1.4;
}

@keyframes bubblesUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-15px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes bubblesDown {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(15px) scale(0.9);
  }
}

/* Telegram Style Input Container */
.telegram-input-container {
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.telegram-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--background-color);
  border-radius: 24px;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-speed) ease;
  min-height: 52px;
  width: 100%;
  box-sizing: border-box;
}

.telegram-input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 103, 1, 0.1);
}

/* Input field container and textarea */
.telegram-input-field-container {
  flex: 1;
  position: relative;
  min-width: 0; /* Important for flex shrinking */
  width: 100%;
}

.telegram-input-field {
  width: 100%;
  min-height: 40px; /* Optimized for better proportion */
  max-height: 120px; /* 6 lines max before scrolling */
  padding: 10px 14px;
  margin: 0; /* Ensure full fit without default margins */
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 20px;
  background: transparent;
  color: var(--text-color);
  overflow-y: hidden; /* Start hidden, JS will control this */
  scroll-behavior: smooth;
  box-sizing: border-box;
}

.telegram-input-field::placeholder {
  color: var(--text-light);
}

.telegram-input-field::-webkit-scrollbar {
  width: 4px;
}

.telegram-input-field::-webkit-scrollbar-track {
  background: transparent;
}

.telegram-input-field::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.telegram-input-field::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Telegram style buttons */
.telegram-btn {
  width: 40px;
  height: 40px;
  min-width: 40px; /* Prevent shrinking */
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  flex-shrink: 0;
  flex-grow: 0;
  font-size: 16px;
}

.telegram-btn:focus,
.telegram-input-field:focus {
  outline: none;
}

.telegram-btn:hover {
  background: var(--border-color);
  color: var(--text-color);
  transform: scale(1.05);
}

.telegram-btn:active {
  transform: scale(0.95);
}

.telegram-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Send button special styling */
.telegram-send-btn {
  background: var(--primary-gradient);
  color: white;
  width: 42px; /* Slightly larger than other buttons for emphasis */
  height: 42px;
  min-width: 42px; /* Prevent shrinking */
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  flex-grow: 0;
  font-size: 16px;
}

.telegram-send-btn:hover {
  background: var(--primary-gradient);
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.telegram-send-btn:disabled {
  background: var(--border-color);
  box-shadow: none;
}

/* Audio controls */
.telegram-audio-controls {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--background-color);
  border-radius: 12px;
}

.telegram-audio-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recording-timer {
  font-size: 14px;
  color: var(--text-color);
  font-weight: 500;
}

/* Emoji picker */
#emojiPicker {
  position: absolute;
  bottom: 100px;
  right: 20px;
  z-index: 1000;
}

/* Menu styles */
.menu {
  position: relative;
  margin-right: 10px;
}

.menu .link {
  color: white;
  font-size: 24px;
  text-decoration: none;
  cursor: pointer;
}

.menu .submenu {
  position: absolute;
  top: 100%;
  /* right: 0; */
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  /* transform: translateX(150px); */
  display: none;
  z-index: 10;
}

.menu:hover .submenu {
  display: block;
}

.submenu .submenu-link {
  display: block;
  padding: 10px 15px;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color var(--transition-speed) ease;
}

.submenu .submenu-link:hover {
  background-color: var(--background-color);
}

/* Loader */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* File preview styles */
.file-preview-container {
  margin-bottom: 10px;
  width: 100%;
}

.file-preview {
  display: flex;
  align-items: center;
  background-color: #f0f0f0;
  border-radius: 10px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
}

.file-preview img {
  max-width: 60px;
  max-height: 60px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 10px;
}

.file-preview .file-info {
  flex-grow: 1;
}

.file-preview .file-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
}

.file-preview .file-size {
  font-size: 12px;
  color: var(--text-light);
}

.file-preview .remove-file {
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  font-size: 18px;
  padding: 5px;
}

/* Message attachment styles */
.message-attachment img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 10px;
}

.chatbot-name-header {
  padding-top: 10px;
}

#playback-bar {
  width: 100%;
  margin: auto 10px;
}

@keyframes wave {
  0% {
    transform: translateX(0) scaleY(1);
  }

  25% {
    transform: translateX(-25%) scaleY(0.8);
  }

  50% {
    transform: translateX(-50%) scaleY(1.1);
  }

  75% {
    transform: translateX(-75%) scaleY(0.9);
  }

  100% {
    transform: translateX(-100%) scaleY(1);
  }
}

.audio-progress {
  --progress-color: #495057;
  --background-color: #e9edef;

  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--background-color);
  cursor: pointer;
}

.audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--progress-color);
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
}

.audio-progress:hover::-webkit-slider-thumb {
  opacity: 1;
}

.audio-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--progress-color);
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
}

.audio-progress:hover::-moz-range-thumb {
  opacity: 1;
}

.audio-progress::-webkit-progress-value {
  background: var(--progress-color);
  border-radius: 2px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Responsive layout for mobile only */
@media (max-width: 767px) {
  .widget-container {
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    transform: none;
    position: fixed;
    box-sizing: border-box;
  }

  .chatbot-widget {
    /* Mobile: dynamic viewport units to avoid browser UI overlap */
    width: 100svw;
    height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-width: 100svw;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
  }

  /* Special handling for very small screens */
  @media (max-width: 480px) {
    .chatbot-widget {
      /* Ensure full coverage on tiny screens with safe areas */
      width: 100svw;
      height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
      max-width: 100svw;
      max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
  }

  .chatbot-widget.minimized {
    height: auto;
  }

  .header-text h2 {
    font-size: 18px;
  }

  .header-text p {
    font-size: 12px;
  }

  .options-container h5 {
    font-size: 12px;
  }

  .option span:not(.icon) {
    font-size: 12px;
  }

  .message {
    max-width: 90%;
  }

  .telegram-input-container {
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .telegram-input-wrapper {
    padding: 4px 6px;
    gap: 4px;
    min-height: 48px;
    border-radius: 20px;
    width: 100%;
    box-sizing: border-box;
  }

  .telegram-input-field-container {
    flex: 1;
    min-width: 0;
    width: 100%;
  }

  .telegram-input-field {
    font-size: 16px;
    max-height: 100px; /* Reasonable mobile height */
    min-height: 36px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .telegram-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 14px;
    flex-shrink: 0;
    flex-grow: 0;
  }

  .telegram-send-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 14px;
    flex-shrink: 0;
    flex-grow: 0;
  }

  .chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
  }
}

/* Avatar Modal Styles */
.clickable-avatar {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clickable-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.avatar-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.avatar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.avatar-content {
  position: relative;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
  animation: zoomIn 0.3s ease;
}

.avatar-image-container {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 4px solid var(--surface-color);
}

.avatar-large-image {
  width: 300px;
  height: 300px;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}


/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile responsiveness for avatar modal */
@media (max-width: 768px) {
  .avatar-large-image {
    width: 250px;
    height: 250px;
  }
}

@media (max-width: 480px) {
  .avatar-large-image {
    width: 200px;
    height: 200px;
  }
}

/* ================ SIDEBAR WIDGET STYLES ================ */

/* Sidebar Widget Container */
.sidebar-widget {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  height: 100vh;
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  transform: translateX(-320px); /* Initially collapsed, showing only 40px */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-widget.expanded {
  transform: translateX(0);
}

/* Sidebar Header - compact purple area while keeping logo size */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 8px; /* tighter vertical padding to shorten orange area */
  background: var(--primary-gradient);
  color: white;
  min-height: 48px; /* make header visibly shorter; logo can overflow */
  flex-shrink: 0;
  position: relative;
  overflow: visible; /* allow logo to extend outside to keep size */
  gap: 8px;
}

/* Sidebar Language Dropdown */
.sidebar-language-dropdown {
  position: relative;
}

.sidebar-flag-button {
  background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: white;
  min-height: 32px;
  font-size: 12px;
}

.sidebar-flag-button:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.15));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.sidebar-flag-button:active {
  transform: translateY(0px);
}

.sidebar-flag-button .flag-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  object-fit: cover;
}

.sidebar-flag-button:hover .flag-icon {
  transform: scale(1.1);
}

.sidebar-flag-button .dropdown-indicator {
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.sidebar-flag-button[aria-expanded="true"] .dropdown-indicator {
  transform: rotate(180deg);
}

/* Sidebar Language Dropdown Menu */
.sidebar-language-dropdown .dropdown-menu {
  position: absolute;
  top: 100%;
  bottom: auto;
  left: 0;
  right: auto;
  margin-top: 8px;
  min-width: 200px;
  max-width: 280px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  backdrop-filter: blur(20px);
  z-index: 30000 !important;
  animation: sidebarDropdownSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  display: none;
}

.sidebar-language-dropdown .dropdown-menu.show {
  display: block;
}

/* Floating version for sidebar dropdown */
.dropdown-menu.sidebar-flyout {
  position: fixed;
  top: 0; /* will be set inline */
  left: 0; /* will be set inline */
  margin: 0;
  min-width: 200px;
  max-width: 280px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  backdrop-filter: blur(20px);
  z-index: 30000 !important;
  animation: sidebarDropdownSlideUp 0.22s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sidebar-language-dropdown .language-options {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  color: var(--text-color);
}

.sidebar-language-dropdown .language-options:hover {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
  transform: translateX(4px);
}

.sidebar-language-dropdown .language-options:active {
  transform: translateX(2px);
}

.sidebar-language-dropdown .language-options img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  object-fit: cover;
}

.sidebar-language-dropdown .language-options:hover img {
  transform: scale(1.1);
}

.sidebar-language-dropdown .language-options span {
  font-size: 14px;
  font-weight: 500;
  vertical-align: middle;
  line-height: 1.4;
}

/* Sidebar dropdown animation */
@keyframes sidebarDropdownSlideUp {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile responsive styles for sidebar language dropdown */
@media (max-width: 768px) {
  .sidebar-flag-button {
    padding: 4px 6px;
    height: 32px;
    min-width: 60px;
  }

  .sidebar-language-icon {
    width: 14px;
    height: 14px;
  }

  .sidebar-language-dropdown .language-options {
    padding: 10px 12px;
    gap: 8px;
  }

  .sidebar-language-dropdown .language-options img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .sidebar-language-dropdown .dropdown-menu {
    min-width: 180px;
  }
}

.sidebar-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  pointer-events: none;
}

/* Remove duplicate definition, updated version below */

/* Logo still displays when collapsed, but slightly faded */
.sidebar-widget:not(.expanded) .sidebar-logo-container {
  opacity: 0.8;
  /* Don't set pointer-events: none, keep logo always clickable */
}

/* Sidebar Logo - Extra large logo image */
.sidebar-logo {
  height: 120px !important; /* Extra large logo image */
  width: 120px !important; /* Square extra large size */
  max-width: 120px !important;
  min-width: 120px !important; 
  object-fit: contain;
  background: transparent;
  /* Convert logo to white to adapt to background */
  filter: brightness(0) saturate(100%) invert(100%) contrast(200%) drop-shadow(0 1px 3px rgba(0,0,0,0.2));
  transition: all 0.3s ease;
  /* Debug: temporary border to confirm position */
  /* border: 2px solid rgba(255,255,255,0.5); */
  z-index: 10;
  position: relative;
  border-radius: 8px;
}

.sidebar-logo:hover {
  filter: brightness(0) saturate(100%) invert(100%) drop-shadow(0 0 12px rgba(255,255,255,0.8)) contrast(200%);
  transform: scale(1.08);
}

/* Extra large logo container - keep logo size without forcing header height */
.sidebar-logo-container {
  display: flex !important;
  align-items: center;
  justify-content: flex-start; /* Logo left-aligned */
  opacity: 1 !important;
  transition: all 0.3s ease;
  overflow: visible;
  position: relative;
  z-index: 10;
  white-space: nowrap;
  min-height: 0; /* do not force extra header height */
  padding: 0; /* remove extra vertical padding */
  margin-top: -30px; /* avoid affecting header height */
  transform: translateY(10px); /* move logo down without changing layout height */
}

/* Debug: Show fallback text if image fails to load */
.sidebar-logo::after {
  content: attr(alt);
  display: none;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* Show text when image fails to load */
.sidebar-logo:broken,
.sidebar-logo[src=""],
img.sidebar-logo:not([src]) {
  display: none;
}

.sidebar-logo:broken::after,
.sidebar-logo[src=""]::after,
img.sidebar-logo:not([src])::after {
  display: block;
  content: "SKY ONE";
  color: white !important;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Legacy title styles - Keep just in case, but hidden */
.sidebar-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.5px;
  opacity: 1;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 1;
  display: none; /* Hide original Tools text */
}

.sidebar-widget:not(.expanded) .sidebar-title {
  opacity: 0;
  pointer-events: none;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.sidebar-toggle-icon {
  transition: transform 0.3s ease;
}

.sidebar-widget.expanded .sidebar-toggle-icon {
  transform: rotate(180deg);
}

/* Sidebar Content */
.sidebar-content {
  flex: 1;
  padding: 20px;
  padding-bottom: 150px; /* extra bottom space so footer button is fully visible */
  overflow-y: auto;
  opacity: 1;
  transition: opacity 0.3s ease 0.1s;
}

/* Ensure scroller can go a bit beyond the last element so footer button is not cut off */
.sidebar-content::after {
  content: '';
  display: block;
  height: 140px; /* extra scroll spacer */
  flex-shrink: 0;
}

.sidebar-widget:not(.expanded) .sidebar-content {
  opacity: 0;
  pointer-events: none;
  transition-delay: 0s;
}

/* Sidebar Sections */
.sidebar-section {
  margin-bottom: 24px;
}

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

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Empty Sidebar State */
.sidebar-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  text-align: center;
  opacity: 0.6;
}

.empty-icon {
  margin-bottom: 12px;
  opacity: 0.4;
  color: var(--text-light);
}

.empty-text {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
  font-weight: 500;
}

/* Sidebar Menu */
.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-color);
  margin-bottom: 4px;
  position: relative;
}

.sidebar-menu-item:hover {
  background: var(--background-color);
  color: var(--primary-color);
  transform: translateX(4px);
}

.sidebar-menu-item.active {
  background: linear-gradient(135deg, rgba(255, 103, 1, 0.1), rgba(251, 146, 76, 0.05));
  color: var(--primary-color);
  font-weight: 500;
}

.sidebar-menu-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary-color);
  border-radius: 0 2px 2px 0;
}

.menu-icon {
  margin-right: 12px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.sidebar-menu-item:hover .menu-icon,
.sidebar-menu-item.active .menu-icon {
  opacity: 1;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  width: 100%;
  gap: 8px;
}

.quick-action-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.quick-action-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.quick-action-btn:hover svg {
  opacity: 1;
}

/* Status Indicators */
.status-indicators {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--background-color);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-online {
  background: var(--success-color);
  animation: pulse-status 2s infinite;
}

.status-offline {
  background: var(--danger-color);
}

.status-icon {
  opacity: 0.6;
  flex-shrink: 0;
}

.status-text {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

@keyframes pulse-status {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Custom Scrollbar for Sidebar */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  transition: background 0.3s ease;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* Widget container stays in center regardless of sidebar state */
.widget-container {
  /* No margin adjustments for sidebar - chatbot stays centered */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  box-sizing: border-box;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .sidebar-widget {
    width: 100vw; /* match viewport width precisely */
    transform: translateX(-100%); /* fully off-screen when collapsed */
  }

  /* Stronger collapsed rule to avoid partial visibility from earlier transforms */
  .sidebar-widget:not(.expanded) {
    transform: translateX(-100%) !important;
    border-right: none; /* avoid 1px border sliver */
    box-shadow: none;   /* avoid shadow sliver */
  }

  .sidebar-widget.expanded {
    transform: translateX(0) !important;
  }

  /* Mobile: widget container stays in place, no movement */
  .widget-container {
    /* No transforms or margin adjustments - stays centered */
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    transform: none;
    z-index: 1000;
    box-sizing: border-box;
  }

  /* Mobile overlay for closing sidebar */
  .sidebar-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
  
  .sidebar-widget.expanded .sidebar-mobile-overlay {
    display: block;
  }
}

@media (max-width: 480px) {
  .sidebar-header {
    padding: 2px 8px; /* tighter on mobile */
    min-height: 30px; /* shorter mobile header */
  }

  /* Mobile sidebar logo - Large image size */
  .sidebar-logo {
    height: 90px !important; /* Mobile large logo image */
    width: 90px !important; 
    max-width: 90px !important;
    min-width: 90px !important;
  }

  /* Keep logo clear on small screens */
  .sidebar-logo:hover {
    transform: scale(1.06); /* Slightly enlarge hover effect */
  }

  /* Mobile container adjustment */
  .sidebar-logo-container {
    min-height: 0 !important; /* do not enforce height */
    padding: 0 !important;
    margin-top: -6px; /* align with desktop */
  }

  /* Legacy title - Keep hidden */
  .sidebar-title {
    font-size: 16px;
    display: none; /* Ensure mobile also hides Tools text */
  }

  .sidebar-toggle {
    width: 32px;
    height: 32px;
  }

  .sidebar-content {
    padding: 16px;
    padding-bottom: 100px; /* extra space for mobile so button is not cut off */
  }

  .sidebar-content::after {
    content: '';
    display: block;
    height: 120px; /* mobile spacer */
  }

  .sidebar-menu-item {
    padding: 10px 12px;
  }

  .quick-action-btn {
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* Theme Compatibility */
[data-theme="dark"] .sidebar-widget {
  background: var(--surface-color);
  border-right-color: var(--border-color);
}

[data-theme="dark"] .sidebar-title {
  color: var(--text-color);
}

[data-theme="dark"] .sidebar-content {
  background: var(--surface-color);
}

[data-theme="dark"] .sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .sidebar-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Dark theme background - enhanced dark styling */
[data-theme="dark"] .main-theme-background {
  background-color: #1f2937; /* Fixed dark background for dark theme */
}

[data-theme="dark"] .company-logo-img {
  filter: brightness(1.2) contrast(1.1);
}

[data-theme="dark"] .language-dropdown-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .language-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-color);
}

[data-theme="dark"] .language-text {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .dropdown-menu {
  background: rgba(17, 24, 39, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  width: 100%;
  min-width: 100%;
  bottom: 100%;
  top: auto;
  margin-bottom: 8px;
}

[data-theme="dark"] .dropdown-menu::before {
  border-bottom-color: rgba(17, 24, 39, 0.95);
}

/* Dark theme language options */
[data-theme="dark"] .dropdown-menu .language-options {
  color: rgba(255, 255, 255, 0.9); /* Ensure text is visible in dark theme */
}

[data-theme="dark"] .dropdown-menu .language-options:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary-color);
}

/* Dark theme responsive overrides */
@media (max-width: 768px) {
  [data-theme="dark"] .dropdown-menu .language-options {
    color: rgba(255, 255, 255, 0.9);
  }
}

@media (max-width: 480px) {
  [data-theme="dark"] .dropdown-menu .language-options {
    color: rgba(255, 255, 255, 0.9);
  }
}

/* Ensure dropdown positioning is consistent across all themes - ABOVE button */
:root .dropdown-menu,
[data-theme="blue"] .dropdown-menu,
[data-theme="orange"] .dropdown-menu,
[data-theme="purple"] .dropdown-menu,
[data-theme="green"] .dropdown-menu,
[data-theme="pink"] .dropdown-menu,
[data-theme="dark"] .dropdown-menu {
  width: 100% !important;
  min-width: 100% !important;
  right: 0 !important;
  left: 0 !important;
  bottom: 100% !important;
  top: auto !important;
  margin-bottom: 8px !important;
  transform: translateY(0) !important;
  position: absolute !important;
}

/* Final override to prevent any positioning issues - ABOVE button */
.dropdown-menu {
  position: absolute !important;
  bottom: 100% !important;
  top: auto !important;
  right: 0 !important;
  left: 0 !important;
  width: 100% !important;
  min-width: 100% !important;
  margin-bottom: 8px !important;
  transform: translateY(0) !important;
  will-change: transform !important;
  /* Ensure it appears above all other elements */
  z-index: 1050 !important;
}

[data-theme="dark"] .config-form {
  background: var(--surface-color);
}

[data-theme="dark"] .config-section {
  background: var(--surface-color);
}

[data-theme="dark"] .config-title {
  color: var(--text-color);
  border-bottom-color: var(--primary-color);
}

[data-theme="dark"] .config-label {
  color: var(--text-color);
}

[data-theme="dark"] .config-input,
[data-theme="dark"] .config-select {
  background: var(--background-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .config-input:focus,
[data-theme="dark"] .config-select:focus {
  background: var(--background-color);
  color: var(--text-color);
}

[data-theme="dark"] .config-input::placeholder {
  color: var(--text-light);
}

[data-theme="dark"] .image-preview {
  background: linear-gradient(135deg, var(--surface-color) 0%, rgba(255, 103, 1, 0.03) 100%);
  border-color: var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .image-preview:hover {
  background: linear-gradient(135deg, rgba(255, 103, 1, 0.12), rgba(251, 146, 76, 0.06));
  box-shadow: 0 8px 25px rgba(255, 103, 1, 0.25);
}

[data-theme="dark"] .upload-text {
  color: var(--text-light);
}

[data-theme="dark"] .upload-icon {
  color: var(--text-light);
}

[data-theme="dark"] .btn-change-image,
[data-theme="dark"] .btn-remove-image {
  background: var(--background-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .btn-change-image:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
}

[data-theme="dark"] .btn-remove-image:hover {
  border-color: var(--danger-color);
  background: var(--danger-color);
  color: white;
}

[data-theme="dark"] .version-btn {
  color: var(--text-light);
  border-color: var(--border-color);
}

[data-theme="dark"] .version-btn:hover {
  color: var(--primary-color);
}

[data-theme="dark"] .version-btn.active {
  color: white;
}

[data-theme="dark"] .chat-version-toggle {
  background: var(--background-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .version-btn:first-child {
  border-right: 1px solid var(--border-color);
}

[data-theme="dark"] .version-btn.active + .version-btn {
  border-left: 1px solid transparent;
}

/* Dark theme styles for action type toggle */
[data-theme="dark"] .action-type-toggle {
  background: var(--background-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .action-btn {
  color: var(--text-light);
  border-color: var(--border-color);
}

[data-theme="dark"] .action-btn:hover {
  background: rgba(255, 103, 1, 0.1);
  color: var(--primary-color);
}

[data-theme="dark"] .action-btn.active {
  color: white;
}

[data-theme="dark"] .action-btn:first-child {
  border-right: 1px solid var(--border-color);
}

[data-theme="dark"] .action-btn.active + .action-btn {
  border-left: 1px solid transparent;
}

/* Collapsed State Indicator */
.sidebar-widget:not(.expanded)::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  width: 2px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 1px;
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.sidebar-widget:not(.expanded):hover::before {
  opacity: 0.6;
}

/* Hover effects when collapsed */
.sidebar-widget:not(.expanded):hover {
  transform: translateX(-300px);
}

.sidebar-widget:not(.expanded):hover .sidebar-title {
  opacity: 0.3;
}

.sidebar-widget:not(.expanded):hover .sidebar-content {
  opacity: 0.3;
}

/* ================ CONFIGURATION FORM STYLES ================ */

/* Config Form Container */
.config-form {
  width: 100%;
  height: 100%;
}

.config-section {
  background: var(--surface-color);
}

/* ============ Collapsible sections ============ */
.collapsible {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.collapsible + .collapsible { margin-top: 12px; }

.collapsible-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--background-color);
  border: none;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.collapsible-header:focus { outline: none; }

.collapsible-header .config-title { margin: 0; border-bottom: none; padding-bottom: 0; }

.collapsible-chevron {
  transition: transform var(--transition-speed) ease;
}

.collapsible-header[aria-expanded="true"] .collapsible-chevron {
  transform: rotate(180deg);
}

.collapsible-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, padding 0.2s ease;
  padding: 0 14px;
}

.collapsible-content.expanded {
  padding: 14px;
  max-height: 1600px; /* enough for content */
}

.config-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-color);
  position: relative;
}

.config-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--secondary-color);
}

/* Config Field Styles */
.config-field {
  margin-bottom: 20px;
}

.config-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.config-input,
.config-select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--background-color);
  color: var(--text-color);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.config-input:focus,
.config-select:focus {
  border-color: var(--primary-color);
  background: var(--surface-color);
  box-shadow: 0 0 0 3px rgba(255, 103, 1, 0.1);
  transform: translateY(-1px);
}

.config-input::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

.config-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 32px;
  appearance: none;
}

/* Chat Version Toggle Buttons */
.chat-version-toggle {
  display: flex;
  background: var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.version-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

.version-btn:hover {
  background: rgba(255, 103, 1, 0.1);
  color: var(--primary-color);
}

.version-btn.active {
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(255, 103, 1, 0.3);
}

.version-btn:first-child {
  border-right: 1px solid var(--border-color);
}

.version-btn.active + .version-btn {
  border-left: 1px solid transparent;
}

/* Animation for smooth transitions */
.chat-version-toggle {
  position: relative;
}

.version-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

.version-btn.active::before {
  opacity: 1;
}

/* Action Type Toggle Buttons (Register/Deposit) */
.action-type-toggle {
  display: flex;
  background: var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.action-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn:hover {
  background: rgba(255, 103, 1, 0.1);
  color: var(--primary-color);
}

.action-btn.active {
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(255, 103, 1, 0.3);
}

.action-btn:first-child {
  border-right: 1px solid var(--border-color);
}

.action-btn.active + .action-btn {
  border-left: 1px solid transparent;
}

.action-btn svg {
  flex-shrink: 0;
}

/* Animation for smooth transitions */
.action-type-toggle {
  position: relative;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

.action-btn.active::before {
  opacity: 1;
}

/* Campaign Dropdown Styles */
.campaign-dropdown-container {
  margin-top: 16px;
}

.dropdown-wrapper {
  position: relative;
  width: 100%;
}

.dropdown-toggle-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.dropdown-toggle-btn:hover {
  border-color: var(--primary-color);
  background: rgba(14, 165, 233, 0.05);
}

.dropdown-toggle-btn:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.dropdown-selected-text {
  flex: 1;
  margin-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-arrow-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.dropdown-toggle-btn.open .dropdown-arrow-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 4px;
  display: none;
}

.dropdown-menu.show {
  display: block;
}

/* Ensure dropdown items never cause horizontal scroll */
.dropdown-items {
  overflow-x: hidden;
}

/* Campaign language dropdown uses same visual style */
#campaignLanguageWrapper .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
}

#campaignLanguageItems .language-options {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

#campaignLanguageItems .language-options img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

#campaignLanguageItems .language-options:hover {
  background: rgba(14, 165, 233, 0.05);
}

.dropdown-loading {
  padding: 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dropdown-loading .loading-spinner.small {
  gap: 4px;
}

.dropdown-loading .loading-spinner.small .loading-dot {
  width: 8px;
  height: 8px;
}

.dropdown-no-data {
  padding: 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  font-style: italic;
}


.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(14, 165, 233, 0.05);
  border-left: 3px solid var(--primary-color);
}

.dropdown-item.selected {
  background: rgba(14, 165, 233, 0.1);
  border-left: 3px solid var(--primary-color);
  color: var(--primary-color);
}

/* Campaign Item Layout */
.campaign-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0; /* allow inner content to shrink/wrap inside flex */
}

.campaign-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.view-detail-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.view-detail-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

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

.view-detail-btn svg {
  flex-shrink: 0;
}


.campaign-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-color);
  margin-bottom: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.campaign-description {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.campaign-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--text-light);
}

.campaign-detail-item {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0; /* prevent flex children from overflowing */
}

.campaign-detail-label {
  font-weight: 500;
  color: var(--text-color);
  flex-shrink: 0;
}

.campaign-detail-value {
  color: var(--text-light);
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere; /* prefer wrapping over horizontal scroll */
  word-break: break-word;
  white-space: normal;
}

.blast-message-id {
  word-break: break-all;
  overflow-wrap: break-word;
  line-height: 1.4;
  white-space: pre-line;
}


/* Dark theme styles for campaign dropdown */
[data-theme="dark"] .dropdown-toggle-btn {
  background: var(--background-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .dropdown-toggle-btn:hover {
  background: rgba(14, 165, 233, 0.05);
  border-color: var(--primary-color);
}

[data-theme="dark"] .dropdown-menu {
  background: var(--background-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-loading {
  color: var(--text-light);
}

[data-theme="dark"] .dropdown-no-data {
  color: var(--text-light);
}

[data-theme="dark"] .dropdown-item {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item:hover {
  background: rgba(14, 165, 233, 0.05);
}

[data-theme="dark"] .dropdown-item.selected {
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary-color);
}

[data-theme="dark"] .campaign-name {
  color: var(--text-color);
}

[data-theme="dark"] .campaign-description {
  color: var(--text-light);
}

[data-theme="dark"] .campaign-detail-label {
  color: var(--text-color);
}

[data-theme="dark"] .campaign-detail-value {
  color: var(--text-light);
}

[data-theme="dark"] .blast-message-id {
  word-break: break-all;
  overflow-wrap: break-word;
  line-height: 1.4;
  white-space: pre-line;
}

[data-theme="dark"] .view-detail-btn {
  background: var(--primary-color);
  color: white;
}

[data-theme="dark"] .view-detail-btn:hover {
  background: var(--secondary-color);
}

[data-theme="dark"] .campaign-actions {
  border-top-color: var(--border-color);
}

/* Image Upload Styles */
.image-upload-container {
  width: 100%;
}

.image-preview {
  width: 100%;
  height: 160px; /* Increased height for better preview */
  border: 3px dashed var(--border-color);
  border-radius: var(--border-radius-lg); /* Larger border radius */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--background-color) 0%, rgba(255, 103, 1, 0.02) 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.image-preview:hover {
  border-color: var(--primary-color);
  border-style: solid;
  background: linear-gradient(135deg, rgba(255, 103, 1, 0.08), rgba(251, 146, 76, 0.04));
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 25px rgba(255, 103, 1, 0.15);
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: calc(var(--border-radius-lg) - 3px);
  transition: all 0.3s ease;
  filter: brightness(1.02) contrast(1.05);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0.7;
  transition: all 0.3s ease;
  padding: 20px;
}

.image-preview:hover .upload-placeholder {
  opacity: 1;
  transform: translateY(-2px);
}

.upload-icon {
  color: var(--primary-color);
  opacity: 0.8;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(255, 103, 1, 0.2));
}

.image-preview:hover .upload-icon {
  opacity: 1;
  transform: scale(1.1);
  color: var(--primary-color);
}

.upload-text {
  font-size: 13px;
  color: var(--text-color);
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Image Controls */
.image-controls {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-change-image,
.btn-remove-image {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--surface-color);
  color: var(--text-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  min-width: 85px;
  justify-content: center;
  z-index: 1;
}

.btn-change-image::before,
.btn-remove-image::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  transition: all 0.4s ease;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.btn-change-image:hover::before {
  width: 150px;
  height: 150px;
  background: var(--primary-color);
}

.btn-remove-image:hover::before {
  width: 150px;
  height: 150px;
  background: var(--danger-color);
}

.btn-change-image:hover {
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 103, 1, 0.3);
}

.btn-remove-image:hover {
  border-color: var(--danger-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}


/* Config Actions */
.config-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.config-save-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  outline: none;
}

.config-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.config-save-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.config-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Loading State */
.config-save-btn.loading {
  position: relative;
  color: transparent;
}

.config-save-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ================ FAQ SECTION STYLES ================ */

/* FAQ Container */
.faq-section {
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
  position: relative;
}

.faq-section.expanded {
  max-height: 300px;
  padding: 12px 16px;
}

/* FAQ Header */
.faq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.faq-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  opacity: 0.9;
}

.faq-title svg {
  color: var(--primary-color);
}

.faq-toggle-btn {
  background: var(--border-color);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.faq-toggle-btn:hover {
  background: var(--danger-color);
  color: white;
  transform: scale(1.1);
}

/* FAQ Content */
.faq-content {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

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

.faq-content::-webkit-scrollbar-track {
  background: transparent;
}

.faq-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.faq-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* FAQ List */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* FAQ Item */
.faq-item {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.faq-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--primary-color);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}

.faq-item:hover {
  background: linear-gradient(135deg, rgba(255, 103, 1, 0.05), rgba(251, 146, 76, 0.02));
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 103, 1, 0.1);
}

.faq-item:hover::before {
  transform: scaleY(1);
}

.faq-item:active {
  transform: translateY(0) scale(0.98);
}

/* FAQ Icon - Removed (no longer needed) */
/* 
.faq-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
  margin-top: 2px;
}
*/

/* FAQ Text */
.faq-text {
  flex: 1;
  min-width: 0;
}

.faq-question {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  line-height: 1.4;
  margin: 0;
  word-break: break-word;
}

.faq-category {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* FAQ Buttons for Games */
.faq-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.faq-game-btn {
  padding: 10px 16px;
  background-color: var(--primary-color, #007bff);
  color: #fff;
  border: 2px solid var(--primary-color, #007bff);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: inline-block;
  text-align: center;
  min-width: 80px;
}

.faq-game-btn:hover {
  background-color: var(--primary-hover, #0056b3);
  border-color: var(--primary-hover, #0056b3);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.faq-game-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* FAQ Button Styling */
.telegram-faq-btn {
  background: linear-gradient(135deg, rgba(255, 103, 1, 0.1), rgba(251, 146, 76, 0.05));
  color: var(--primary-color);
  border: 1px solid rgba(255, 103, 1, 0.2);
}

.telegram-faq-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.telegram-faq-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(255, 103, 1, 0.3);
}

/* Disabled state for FAQ button */
.telegram-faq-btn.disabled,
.telegram-faq-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--border-color);
  color: var(--text-light);
  border-color: var(--border-color);
  box-shadow: none;
}

/* FAQ Animation States */
.faq-section.show {
  animation: faqSlideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.faq-section.hide {
  animation: faqSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes faqSlideDown {
  from {
    max-height: 0;
    padding: 0 16px;
  }
  to {
    max-height: 300px;
    padding: 12px 16px;
  }
}

@keyframes faqSlideUp {
  from {
    max-height: 300px;
    padding: 12px 16px;
  }
  to {
    max-height: 0;
    padding: 0 16px;
  }
}

/* Mobile Responsiveness for FAQ */
@media (max-width: 768px) {
  .faq-section.expanded {
    max-height: 250px;
    padding: 10px 12px;
  }
  
  .faq-header {
    padding: 6px 0;
    margin-bottom: 10px;
  }
  
  .faq-title {
    font-size: 13px;
  }
  
  .faq-title svg {
    width: 16px;
    height: 16px;
  }
  
  .faq-toggle-btn {
    width: 24px;
    height: 24px;
  }
  
  .faq-toggle-btn svg {
    width: 12px;
    height: 12px;
  }
  
  .faq-content {
    max-height: 180px;
  }
  
  .faq-item {
    padding: 14px;
    /* On mobile, stack text above buttons to avoid narrow text column */
    flex-direction: column;
    align-items: stretch;
  }
  
  .faq-question {
    font-size: 13px;
  }
  
  .faq-category {
    font-size: 10px;
  }

  /* Ensure text takes full width */
  .faq-text {
    width: 100%;
  }

  /* Buttons fill full width and wrap nicely */
  .faq-buttons {
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  /* Make each game button flex responsive (3 per row on medium mobile) */
  .faq-game-btn {
    flex: 1 1 calc(33.33% - 20px);
    min-width: 90px;
    padding: 10px 12px;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .faq-game-btn {
    flex: 1 1 calc(50% - 16px); /* 2 per row for very small screens */
    min-width: 120px;
  }
}

/* Dark Theme Compatibility for FAQ */
[data-theme="dark"] .faq-section {
  background: var(--surface-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .faq-header {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .faq-item {
  background: var(--background-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .faq-item:hover {
  background: linear-gradient(135deg, rgba(255, 103, 1, 0.1), rgba(251, 146, 76, 0.05));
}

[data-theme="dark"] .faq-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

[data-theme="dark"] .faq-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Theme Compatibility for Config Form */
[data-theme="dark"] .config-input,
[data-theme="dark"] .config-select {
  background: var(--surface-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .config-input:focus,
[data-theme="dark"] .config-select:focus {
  background: var(--background-color);
}


/* Mobile Responsiveness for Config Form */
@media (max-width: 768px) {
  .config-title {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .config-field {
    margin-bottom: 16px;
  }

  .config-label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .config-input,
  .config-select {
    padding: 8px 10px;
    font-size: 13px;
  }

  .image-preview {
    height: 140px;
    border-width: 2px;
  }

  .upload-placeholder {
    padding: 16px;
    gap: 10px;
  }

  .upload-icon {
    width: 28px;
    height: 28px;
  }

  .upload-text {
    font-size: 12px;
  }

  .btn-change-image,
  .btn-remove-image {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 75px;
  }

  .config-save-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .config-actions {
    margin-top: 20px;
    padding-top: 16px;
  }
}

/* ================ PAGE LOGO (TOP RIGHT CORNER) ================ */

/* Page Logo Container - square floating button style */
.page-logo-container {
  position: fixed;
  right: 20px;
  top: 20px;
  bottom: auto; /* move to top-right */
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: transparent; /* pure image button - no container visuals */
  border-radius: 0; /* use image's own shape */
  box-shadow: none;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

/* Hide floating logos when sidebar is open (robust, works across browsers) */
/* body.sidebar-open .page-logo-container,
body.sidebar-open .logo-bottom-button {
  display: none !important;
  pointer-events: none !important;
} */

.page-logo-container:hover {
  transform: none; /* no container animations */
  box-shadow: none;
}

.page-logo-container:active {
  transform: none;
}

/* Page Logo - fit inside the square button */
.page-logo {
  width: 100%;
  height: 100%;
  object-fit: cover; /* fill the square */
  object-position: left center; /* crop to show left S only */
  background: transparent;
  border: none;
  border-radius: 0;
}

/* Logo Bottom Button - positioned below the company logo */
.logo-bottom-button {
  position: absolute;
  top: 750px; /* Position below the 56px logo container */
  right: 0;
  width: 50px;
  height: 50px;
  background: var(--primary-gradient);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  outline: none;
  z-index: 10000;
}

/* Logo Bottom Button Hover Effects */
.logo-bottom-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-xl);
  border-color: rgba(255, 255, 255, 0.2);
  filter: brightness(1.1);
}

.logo-bottom-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-md);
}

.logo-bottom-button:focus {
  outline: none;
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Logo Contact Popup - positioned to appear from logo like speech bubble */
.contact-message-bubble {
  position: absolute;
  top: 60px; /* closer to logo */
  right: -10px; /* slightly overlapping for better connection */
  width: 320px; /* wider popup */
  max-width: 420px;
  z-index: 10001;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Initially hidden - will show via JavaScript */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

/* Show state with beautiful animation */
.contact-message-bubble.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: messageBubbleEntry 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Message bubble content container - wider, shorter speech bubble from logo */
.message-bubble-content {
  background: var(--primary-gradient);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 20px 24px; /* less vertical padding, more horizontal */
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.25),
    0 10px 30px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  --shadow-color: var(--primary-color);
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.2));
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 12px; /* tighter spacing for compact layout */
  align-items: flex-start;
  position: relative;
  cursor: pointer;
  color: white;
  transform: perspective(500px) rotateX(3deg) rotateY(-1deg); /* less dramatic angle */
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 100%;
  box-sizing: border-box;
}

/* Message bubble close button */
.message-bubble-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.message-bubble-close:hover {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  transform: scale(1.05);
}


/* Text content area */
.message-bubble-text {
  flex: 1;
  min-width: 0;
}

/* Message bubble title */
.message-bubble-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin: 0 0 6px 0;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Message bubble description */
.message-bubble-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  margin: 0 0 10px 0; /* tighter spacing */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Call-to-action button */
.message-bubble-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.message-bubble-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 1);
  color: var(--primary-color);
  text-decoration: none;
}

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

/* Message bubble tail - positioned to connect with logo like speech bubble */
.message-bubble-tail {
  position: absolute;
  top: -10px; /* moved to top to point towards logo */
  right: 35px; /* positioned to align with logo center */
  width: 18px;
  height: 18px;
  background: var(--primary-gradient);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-right: none;
  border-bottom: none;
  border-radius: 4px 0 0 0;
  transform: rotate(45deg);
  z-index: -1;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

/* Bounce animation for entry */
@keyframes messageBubbleEntry {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.8) rotate(-2deg);
  }
  60% {
    opacity: 1;
    transform: translateY(5px) scale(1.05) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

/* Subtle pulse animation to draw attention */
@keyframes messageBubblePulse {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.02);
  }
}

/* Apply pulse animation when shown */
.contact-message-bubble.show .message-bubble-content {
  animation: messageBubblePulse 2s ease-in-out infinite;
  animation-delay: 1s;
}

/* Enhanced hover effects for 3D projection with dynamic theme colors */
.contact-message-bubble:hover .message-bubble-content {
  transform: perspective(500px) rotateX(1deg) rotateY(-0.5deg) translateY(-4px) scale(1.01);
  box-shadow: 
    0 25px 70px rgba(0, 0, 0, 0.3),
    0 12px 35px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.15),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.25)) brightness(1.05) saturate(1.1);
}

/* 平板端 - square logo button */
@media (max-width: 768px) {
  .page-logo-container {
    top: 15px;
    right: 15px;
    bottom: auto;
    width: 52px;
    height: 52px;
    border-radius: 0;
  }
  
  .page-logo-container:hover {
    transform: scale(1.05);
  }
  
  /* Logo Bottom Button - Tablet Responsive */
  .logo-bottom-button {
    top: 62px; /* Adjusted for smaller logo container */
    width: 40px;
    height: 40px;
  }

  /* Hide floating logos on mobile when sidebar is open */
  body.sidebar-open .page-logo-container,
  body.sidebar-open .logo-bottom-button {
    display: none !important;
    pointer-events: none !important;
  }
  
  .contact-message-bubble {
    top: 58px;
    right: 8px;
    width: 340px;
    max-width: 340px;
  }
  
  .message-bubble-tail {
    right: 45px;
    top: -8px;
  }
}

/* 手机端 - square logo button */
@media (max-width: 480px) {
  .page-logo-container {
    top: 90px;
    right: 10px;
    bottom: auto;
    width: 48px;
    height: 48px;
    border-radius: 0;
  }
  
  .page-logo-container:hover {
    transform: scale(1.04);
  }
  
  /* Logo Bottom Button - Mobile Responsive */
  .logo-bottom-button {
    top: 650px; /* Adjusted for smaller mobile logo container */
    width: 36px;
    height: 36px;
  }
  
  .logo-bottom-button svg {
    width: 18px;
    height: 18px;
  }
  
  .contact-message-bubble {
    top: 54px;
    width: 300px;
    max-width: 300px;
    right: 8px;
  }
  
  .message-bubble-tail {
    right: 50px;
    top: -7px;
  }
}

/* 超小屏幕 - square logo button */
@media (max-width: 360px) {
    /* Mobile: when left settings sidebar is open, hide floating logos */
  body.sidebar-open .page-logo-container,
  body.sidebar-open .logo-bottom-button {
    display: none !important;
    pointer-events: none !important;
  }
  .page-logo-container {
    width: 44px;
    height: 44px;
    padding: 0;
    top: 8px;
    right: 8px;
  }
  
  /* Logo Bottom Button - Extra Small Screen */
  .logo-bottom-button {
    top: 54px; /* Adjusted for extra small logo container */
    width: 32px;
    height: 32px;
  }
  
  .logo-bottom-button svg {
    width: 16px;
    height: 16px;
  }
  
  .contact-message-bubble {
    width: 260px;
    max-width: 260px;
    right: 0px;
    top: 52px;
  }
  
  .message-bubble-tail {
    right: 55px;
    top: -6px;
  }

/* Mobile responsiveness for message bubble */
@media (max-width: 768px) {
  /* Mobile: when left settings sidebar is open, hide floating logos */
  body.sidebar-open .page-logo-container,
  body.sidebar-open .logo-bottom-button {
    display: none !important;
    pointer-events: none !important;
  }
  .contact-message-bubble {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
  
  .message-bubble-content {
    padding: 16px;
    border-radius: 16px;
  }
  
  
  .message-bubble-title {
    font-size: 15px;
  }
  
  .message-bubble-description {
    font-size: 13px;
    margin-bottom: 12px;
  }
  
  .message-bubble-button {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 10px;
  }
  
  .message-bubble-tail {
    top: 20px;
    right: -7px;
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .message-bubble-content {
    padding: 14px;
    gap: 12px;
    border-radius: 14px;
  }
  
  
  .message-bubble-title {
    font-size: 14px;
  }
  
  .message-bubble-description {
    font-size: 12px;
    line-height: 1.4;
  }
  
  .message-bubble-button {
    padding: 7px 12px;
    font-size: 12px;
    gap: 6px;
  }
}

/* ================ CONTACT US BOTTOM RIGHT BUTTON ================ */

/* Contact Ad Container - Restored and visible */
.contact-ad-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999; /* Lower than page logo */
  font-family: 'Inter', sans-serif;
}

/* Disable legacy contact button to ensure only the new chat button is visible
   and movable via .chat-button-container bottom/right. */
.contact-ad-container { display: none !important; }

/* Contact Ad Trigger Button */
.contact-ad-trigger {
  width: 56px;
  height: 56px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: pulse-glow 3s infinite;
}

.contact-ad-trigger:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
  border-color: rgba(255, 255, 255, 0.4);
}

.contact-ad-trigger:active {
  transform: scale(0.95);
}

/* Contact Ad Popup */
.contact-ad-popup {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 280px;
  background: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.contact-ad-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Contact Ad Header */
.contact-ad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--background-color);
}

.contact-ad-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: -0.5px;
}

.contact-ad-close {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.contact-ad-close:hover {
  background: var(--border-color);
  color: var(--text-color);
  transform: scale(1.1);
}

/* Contact Ad Content */
.contact-ad-content {
  padding: 20px;
}

.contact-ad-content p {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Telegram Link */
.telegram-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--primary-gradient);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  border: 2px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  text-transform: none;
  letter-spacing: 0.3px;
}

.telegram-link::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.6s ease;
}

.telegram-link:hover {
  background: var(--primary-gradient);
  filter: brightness(1.1) saturate(1.1);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-xl);
  color: white;
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.25);
}

.telegram-link:hover::before {
  left: 100%;
}

.telegram-link:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: var(--shadow-lg);
}

.telegram-link svg {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
  color: white;
}

.telegram-link .telegram-text {
  flex-grow: 1;
  text-align: center;
}

.telegram-link:hover .telegram-icon-left {
  transform: translateX(-2px);
}

/* Telegram button auto-show animation */
.contact-ad-popup.show .telegram-link {
  animation: telegramButtonPulse 0.6s ease-in-out;
}

@keyframes telegramButtonPulse {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow-md);
  }
  50% {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--shadow-md);
  }
}

/* Pulse Animation */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: var(--shadow-lg);
    transform: scale(1);
  }
  50% {
    box-shadow: var(--shadow-xl);
    transform: scale(1.05);
    filter: brightness(1.1);
  }
}

/* Arrow pointer for popup */
.contact-ad-popup::before {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 20px;
  width: 16px;
  height: 16px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  box-shadow: 2px 2px 0 var(--surface-color);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .contact-ad-container {
    bottom: 80px; /* Above the chat widget on mobile */
    right: 16px;
  }

  .contact-ad-trigger {
    width: 48px;
    height: 48px;
  }

  .contact-ad-popup {
    width: 260px;
    bottom: 60px;
  }

  .contact-ad-content {
    padding: 16px;
  }

  .contact-ad-header {
    padding: 14px 16px;
  }

  .contact-ad-header h3 {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .contact-ad-container {
    bottom: 70px;
    right: 12px;
  }

  .contact-ad-trigger {
    width: 44px;
    height: 44px;
  }

  .contact-ad-popup {
    width: 240px;
    bottom: 56px;
  }

  .telegram-link {
    padding: 12px 16px;
    font-size: 14px;
    gap: 10px;
  }

  /* Mobile chat action buttons */
  .chat-action-button {
    padding: 10px 16px;
    font-size: 13px;
    min-width: 100px;
  }

  .chat-buttons-container {
    flex-direction: column;
    gap: 6px;
  }

  .chat-buttons-container .chat-action-button {
    min-width: auto;
    width: 100%;
  }

  .chat-action-button.small {
    padding: 8px 14px;
    font-size: 12px;
    min-width: 80px;
  }

  .chat-action-button.large {
    padding: 12px 20px;
    font-size: 14px;
    min-width: auto;
  }
}

/* ================ ADDITIONAL RESPONSIVE STYLES FOR SIDEBAR LOGO ================ */

/* Tablet sidebar logo optimization - Extra large image size */
@media (max-width: 768px) and (min-width: 481px) {
  .sidebar-logo {
    height: 100px !important; /* Tablet extra large logo image */
    width: 100px !important;
    max-width: 100px !important;
    min-width: 100px !important;
  }
  
  .sidebar-logo:hover {
    transform: scale(1.07);
  }

  .sidebar-logo-container {
    min-height: 110px !important;
  }

  .sidebar-header {
    min-height: 48px !important; /* shorter tablet header */
    padding: 0 12px;
  }
}

/* Dark Theme Compatibility */
[data-theme="dark"] .contact-ad-popup {
  background: var(--surface-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .contact-ad-popup::before {
  background: var(--surface-color);
  border-color: var(--border-color);
  box-shadow: 2px 2px 0 var(--surface-color);
}

[data-theme="dark"] .contact-ad-header {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .contact-ad-content p {
  color: var(--text-light);
}

/* ================ CHAT BUTTON - BOTTOM RIGHT CORNER ================ */

/* Chat Button Container */
.chat-button-container {
  position: fixed;
  /* Anchor to the very bottom-right of the viewport with safe-area support */
  bottom: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  bottom: calc(20px + constant(safe-area-inset-bottom));
  right: 20px;
  right: calc(20px + env(safe-area-inset-right));
  right: calc(20px + constant(safe-area-inset-right));
  z-index: 10002; /* above other floating elements */
  font-family: 'Inter', sans-serif;
}

/* Chat Button */
.chat-button {
  width: 56px;
  height: 56px;
  background: var(--primary-gradient);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  outline: none;
  position: relative;
  overflow: hidden;
}

/* Subtle shine effect */
.chat-button::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -1000%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(-45deg) translateY(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.chat-button:hover::before {
  transform: rotate(-45deg) translateY(100%);
}

/* Chat Button Hover Effects */
.chat-button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-xl);
  border-color: rgba(255, 255, 255, 0.2);
  filter: brightness(1.1);
}

.chat-button:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: var(--shadow-lg);
}

/* Chat Button Animation */
@keyframes chatButtonPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: var(--shadow-lg);
  }
  50% {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
  }
}

.chat-button {
  animation: chatButtonPulse 3s ease-in-out infinite;
}

.chat-button:hover {
  animation: none; /* Stop pulse on hover */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .chat-button-container {
    bottom: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    bottom: calc(20px + constant(safe-area-inset-bottom));
    right: 16px;
    right: calc(16px + env(safe-area-inset-right));
    right: calc(16px + constant(safe-area-inset-right));
  }

  .chat-button {
    width: 52px;
    height: 52px;
  }
  
  .chat-button svg {
    width: 24px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .chat-button-container {
    bottom: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    bottom: calc(20px + constant(safe-area-inset-bottom));
    right: 12px;
    right: calc(12px + env(safe-area-inset-right));
    right: calc(12px + constant(safe-area-inset-right));
  }

  .chat-button {
    width: 48px;
    height: 48px;
  }
  
  .chat-button svg {
    width: 22px;
    height: 22px;
  }
}

/* Dark Theme Compatibility */
[data-theme="dark"] .chat-button {
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .chat-button:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
}

/* Ensure logos remain visible on desktop even when sidebar is open */
@media (min-width: 769px) {
  body.sidebar-open .page-logo-container,
  body.sidebar-open .logo-bottom-button {
    display: flex !important;
    pointer-events: auto !important;
  }
}

/* ================ WATER BUBBLE BACKGROUND ANIMATION ================ */

.water-bubble {
  position: absolute;
  bottom: -10%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 255, 255, 0.8),
    rgba(var(--primary-rgb), 0.4) 50%,
    rgba(var(--primary-rgb), 0.1));
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.3),
    0 4px 12px rgba(var(--primary-rgb), 0.2);
  pointer-events: none;
  animation: bubbleRise var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
  opacity: 0;
}

@keyframes bubbleRise {
  0% {
    bottom: -10%;
    opacity: 0;
    transform: translateX(0) scale(0.8);
  }
  10% {
    opacity: 0.7;
  }
  25% {
    transform: translateX(-20px) scale(0.9);
  }
  50% {
    transform: translateX(15px) scale(1);
    opacity: 0.8;
  }
  75% {
    transform: translateX(-10px) scale(0.95);
    opacity: 0.5;
  }
  90% {
    opacity: 0.2;
  }
  100% {
    bottom: 110%;
    transform: translateX(5px) scale(0.7);
    opacity: 0;
  }
}

.water-bubble::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 15%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent 60%);
  border-radius: 50%;
  animation: shimmerBubble 2s ease-in-out infinite;
}

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

.water-bubble.small { width: 8px; height: 8px; }
.water-bubble.medium { width: 14px; height: 14px; }
.water-bubble.large { width: 22px; height: 22px; }
.water-bubble.xlarge { width: 32px; height: 32px; }

@media (max-width: 768px) {
  .water-bubble.xlarge,
  .water-bubble.large:nth-child(even) {
    display: none;
  }
}

[data-theme="dark"] .water-bubble {
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 255, 255, 0.3),
    rgba(var(--primary-rgb), 0.3) 50%,
    rgba(var(--primary-rgb), 0.05));
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.2),
    0 4px 12px rgba(var(--primary-rgb), 0.15);
}

/* ============ Account Details Styles ============ */
.account-details-container {
  padding: 20px;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.account-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  line-height: 1.4;
}

.account-detail-item:last-child {
  border-bottom: none;
}

.account-detail-label {
  font-weight: 600;
  color: var(--text-color);
  flex: 0 0 auto;
  margin-right: 16px;
  min-width: 140px;
}

.account-detail-value {
  font-weight: 400;
  color: var(--text-color);
  flex: 1;
  text-align: right;
  word-break: break-word;
}

.account-detail-value-container {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: var(--text-color);
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
}

.copy-btn:hover {
  opacity: 1;
  background: var(--hover-color, rgba(0, 0, 0, 0.1));
  transform: scale(1.1);
}

.copy-btn:active {
  transform: scale(0.95);
}

/* Dark theme support for copy button */
[data-theme="dark"] .copy-btn {
  color: var(--text-color);
}

[data-theme="dark"] .copy-btn:hover {
  background: var(--hover-color, rgba(255, 255, 255, 0.1));
}

/* Mobile responsive for account details */
@media (max-width: 480px) {
  .account-details-container {
    padding: 16px 12px;
  }

  .account-detail-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
  }

  .account-detail-label {
    margin-right: 0;
    margin-bottom: 4px;
    min-width: auto;
    font-size: 13px;
  }

  .account-detail-value {
    text-align: left;
    font-size: 13px;
  }

  .account-detail-value-container {
    justify-content: flex-start;
    gap: 6px;
  }

  .copy-btn {
    min-width: 20px;
    height: 20px;
    padding: 3px;
  }
}

/* Dark theme support for account details */
[data-theme="dark"] .account-details-container {
  background: var(--surface-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .account-detail-label,
[data-theme="dark"] .account-detail-value {
  color: var(--text-color);
}

[data-theme="dark"] .account-detail-item {
  border-bottom-color: var(--border-color);
}

/* ================ WELCOME SCREEN STYLES FOR NEW VISITORS ================ */

/* Welcome overlay for new visitors */
.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: welcomeFadeIn 0.5s ease-out;
}

.welcome-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(50, 50, 50, 0.7) 100%);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.welcome-content {
  position: relative;
  text-align: center;
  color: white;
  padding: 3rem 2rem; /* reduced overall padding */
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  max-width: clamp(320px, 84vw, 640px);
  animation: welcomeSlideIn 0.8s ease-out 0.3s both;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem; /* tighter spacing between components */
  transform-origin: top center; /* allow dynamic scale to keep within viewport */
}

@media (max-height: 760px) {
  .welcome-content {
    padding: 2.25rem 1.6rem; /* reduce further on shorter screens */
    gap: 1rem;
  }
}

@media (max-height: 640px) {
  .welcome-content {
    padding: 1.75rem 1.25rem;
    gap: 0.85rem;
  }
}

.welcome-language-selector {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.welcome-language-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
  margin: 0;
}

.welcome-language-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
  color: white;
}

.welcome-language-btn:hover,
.welcome-language-btn:focus {
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.45),
    0 14px 28px rgba(102, 126, 234, 0.25);
  transform: translateY(-1px);
}

.welcome-language-btn-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.welcome-language-btn .language-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.3);
}

.welcome-language-btn .language-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

#welcomeLanguageOptions {
  width: 100%;
  margin-top: 0.5rem;
  border-radius: 18px;
  padding: 0.75rem 0;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(16px);
}

#welcomeLanguageOptions .language-options {
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: rgba(255, 255, 255, 0.92);
}

#welcomeLanguageOptions .language-options:hover {
  background: rgba(102, 126, 234, 0.18);
}

#welcomeLanguageOptions .language-options img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

#welcomeLanguageOptions .language-options span {
  font-size: 0.92rem;
  font-weight: 500;
}

.welcome-language-selector .dropdown-arrow {
  transition: transform 0.2s ease;
  stroke: rgba(255, 255, 255, 0.8);
}

.welcome-language-btn[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.welcome-content::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.4), rgba(78, 205, 196, 0.4), rgba(69, 183, 209, 0.4));
  border-radius: 26px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.welcome-content:hover::before {
  opacity: 1;
}

.welcome-content:hover {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.welcome-logo {
  margin-bottom: -6rem; /* reduce spacing under logo */
}

.welcome-logo-img {
  width: 300px !important;
  max-width: 300px !important;
  height: auto !important;
  opacity: 0.95;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.welcome-title {
  font-size: clamp(1.6rem, 4.2vw, 3.2rem);
  margin-bottom: 1rem; /* tighter */
  font-weight: 600;
  background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #45b7d1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
}

.welcome-description {
  font-size: clamp(0.95rem, 2.2vw, 1.3rem);
  margin-bottom: 1.5rem; /* tighter */
  opacity: 0.85;
  line-height: 1.5;
  font-weight: 300;
}

.welcome-continue-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
  border: none;
  padding: clamp(12px, 2.2vh, 18px) clamp(24px, 3.6vh, 36px);
  border-radius: 16px;
  color: white;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
  position: relative;
  overflow: hidden;
}

.welcome-continue-btn::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.6s ease;
}

.welcome-continue-btn:hover::before {
  left: 100%;
}

.welcome-continue-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #5b21b6 100%);
}

.welcome-continue-btn:active {
  transform: translateY(-1px);
}

.welcome-continue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 50%, #4b5563 100%);
  box-shadow: 0 4px 15px rgba(156, 163, 175, 0.2);
}

.welcome-continue-btn:disabled:hover {
  transform: none;
  box-shadow: 0 4px 15px rgba(156, 163, 175, 0.2);
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 50%, #4b5563 100%);
}

/* Username input styles */
.username-input-container {
  margin-bottom: -2rem;
  position: relative;
  width: 100%;
  max-width: 640px; /* widen input area while staying responsive */
  box-sizing: border-box;
}

.welcome-username-input {
  width: 100%;
  max-width: 100%;
  padding: 16px 22px; /* slightly wider padding */
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  font-weight: 400;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.welcome-username-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.welcome-username-input:focus {
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.welcome-username-input:valid {
  border-color: rgba(34, 197, 94, 0.6);
}

.welcome-username-input.error {
  border-color: rgba(239, 68, 68, 0.8);
  background: rgba(239, 68, 68, 0.1);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.input-feedback {
  text-align: left !important;
  align-self: flex-start;
  margin-top: 8px;
  font-size: 0.875rem;
  min-height: 1.25rem;
  color: rgba(239, 68, 68, 0.9);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.input-feedback.show {
  opacity: 1;
}

.input-feedback.success {
  color: rgba(34, 197, 94, 0.9);
}

/* Enhanced Animations */
@keyframes welcomeFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(20px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(15px);
  }
}

@keyframes welcomeSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

.welcome-overlay {
  animation: welcomeFadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Welcome active state for body */
body.welcome-active {
  overflow: hidden;
}

/* Enhanced typography */
.welcome-title, .welcome-description {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Responsive design */
@media (max-width: 768px) {
  .welcome-content {
    padding: 2.5rem 2rem;
    margin: 1rem;
    max-width: none;
  }

  .welcome-title {
    font-size: 2.5rem;
  }

  .welcome-description {
    font-size: 1.1rem;
  }

  .welcome-logo {
    margin-bottom: -3rem; /* reduce spacing under logo */
  }
  .welcome-logo-img {
    width: 250px !important;
    max-width: 250px !important;
    height: auto !important;
  }
}

@media (max-width: 480px) {
  .welcome-content {
    padding: 2rem 1.5rem;
  }

  .welcome-title {
    font-size: 2rem;
  }

  .welcome-description {
    font-size: 1rem;
  }

  .welcome-logo-img {
    width: 200px !important;
    max-width: 200px !important;
    height: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .welcome-content {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid white;
  }

  .welcome-title {
    -webkit-text-fill-color: white;
    background: none;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .welcome-overlay,
  .welcome-content {
    animation: none;
  }

  .welcome-continue-btn {
    transition: none;
  }
}

/* ===== NEW USER TUTORIAL STYLES ===== */

/* Tutorial overlay - covers entire screen with semi-transparent backdrop */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in-out;
}

.tutorial-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  z-index: 9998;
  /* Add transform to create stacking context */
  transform: translateZ(0);
}

.tutorial-content {
  position: relative;
  z-index: 10000;
  background: white;
  border-radius: 16px;
  padding: 2rem 2.25rem 2.25rem;
  max-width: 420px; /* allow longer localized labels */
  width: 92vw;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideUp 0.3s ease-in-out;
}

.tutorial-step-content {
  margin-bottom: 1.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tutorial-step-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 26px;
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.35);
}

.tutorial-step-icon svg {
  width: 32px;
  height: 32px;
}

.tutorial-step-icon--button {
  background: none;
  width: auto;
  height: auto;
  box-shadow: none;
  border-radius: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tutorial-step-icon--button .tutorial-cloned-button {
  transform: scale(1);
  border-radius: inherit;
  overflow: visible;
  box-shadow: none !important;
  filter: none !important;
}

.tutorial-cloned-button * {
  pointer-events: none !important;
}

/* Ensure cloned New Chat text is readable on white tutorial card */
.tutorial-step-icon--button .restart-btn-elegant,
.tutorial-step-icon--button .restart-text {
  color: #1f2937 !important; /* slate-800 */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.tutorial-step-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.tutorial-step-description {
  font-size: 1rem;
  color: #718096;
  line-height: 1.6;
  margin-bottom: 1rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.tutorial-highlight-element {
  position: relative !important;
  z-index: 10002 !important;
  isolation: isolate;
  transition: transform 0.35s ease, filter 0.35s ease;
}

/* Ensure highlighted buttons have proper z-index */
.tutorial-highlight-element + * {
  z-index: 10003 !important;
}

.tutorial-highlight-glow::after {
  content: "";
  position: absolute;
  top: -12px;
  right: -12px;
  bottom: -12px;
  left: -12px;
  border-radius: calc(var(--tutorial-highlight-radius, 18px) + 12px);
  border: 3px solid rgba(255, 170, 0, 0.9);
  box-shadow: 0 0 30px rgba(255, 140, 0, 0.6), 
              0 8px 40px rgba(255, 115, 0, 0.4),
              inset 0 0 20px rgba(255, 200, 0, 0.2);
  pointer-events: none;
  opacity: 1;
  transform-origin: center;
  animation: tutorialHighlightHalo 2s ease-in-out infinite;
  z-index: -1;
}

.tutorial-highlight-glow {
  transition: filter 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
  transform: scale(1.05);
  filter: brightness(1.1);
}

@keyframes tutorialHighlightHalo {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.95;
    border-color: rgba(255, 170, 0, 0.85);
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
    border-color: rgba(255, 200, 0, 1);
  }
}

/* Independent highlight container - creates isolated rendering layer */
#tutorial-highlight-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 10004 !important;
  pointer-events: none !important;
  /* This container creates an isolated layer */
  transform: translateZ(0) !important;
  contain: layout style paint !important;
}


/* halo handled by JS class; keep pseudo element free */

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

.tutorial-highlight-element {
  position: relative !important;
  z-index: 10005 !important;
  filter: none !important;
  transition: box-shadow 0.35s ease, transform 0.35s ease, filter 0.35s ease;
  box-shadow: 0 8px 32px rgba(255, 140, 0, 0.5), 
              0 0 0 2px rgba(255, 170, 0, 0.4),
              0 12px 40px rgba(255, 115, 0, 0.25);
}

.tutorial-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.tutorial-progress {
  flex: 1;
}

.tutorial-step-counter {
  font-size: 0.875rem;
  color: #718096;
  font-weight: 500;
  white-space: nowrap; /* keep short block even in long locales */
}

.tutorial-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between; /* keep skip left, actions right */
}

.tutorial-skip-btn {
  background: none;
  border: none;
  color: #718096;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.tutorial-skip-btn svg {
  flex-shrink: 0;
}

.tutorial-skip-btn .tutorial-skip-text {
  display: inline-block;
}

.tutorial-skip-btn:hover {
  color: #4a5568;
  background: rgba(113, 128, 150, 0.1);
}

.tutorial-step-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tutorial-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-width: 108px;
}

.tutorial-btn .tutorial-prev-text,
.tutorial-btn #tutorialNextText {
  display: inline-block;
  white-space: nowrap;
}

.tutorial-btn svg {
  flex-shrink: 0;
}

.tutorial-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.tutorial-prev-btn {
  background: #e2e8f0;
  color: #4a5568;
}

.tutorial-prev-btn:hover {
  background: #cbd5e0;
  box-shadow: 0 4px 12px rgba(226, 232, 240, 0.3);
}

.tutorial-pointer {
  position: fixed;
  z-index: 10001;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
}

.tutorial-pointer-line {
  background: linear-gradient(180deg, 
    rgba(255, 188, 66, 0.6), 
    rgba(255, 140, 0, 0.9),
    rgba(255, 106, 0, 1)
  );
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s ease;
  opacity: 1;
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.5),
              0 0 24px rgba(255, 140, 0, 0.3);
}

.tutorial-pointer-line--horizontal {
  height: 4px;
}

.tutorial-pointer-line--vertical {
  width: 4px;
}

.tutorial-pointer-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(255, 255, 255, 0.85) 100%
  );
  box-shadow: 0 8px 24px rgba(255, 115, 0, 0.4),
              0 0 0 1px rgba(255, 200, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 2px solid rgba(255, 170, 0, 0.8);
  animation: tutorialArrowPulse 2s ease-in-out infinite;
}

.tutorial-pointer-arrow svg {
  width: 30px;
  height: 30px;
  color: #ff8c00;
  stroke: #ff8c00;
  filter: drop-shadow(0 2px 4px rgba(255, 140, 0, 0.4));
}

/* Tutorial animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes tutorialArrowPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(255, 115, 0, 0.4),
                0 0 0 1px rgba(255, 200, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 12px 32px rgba(255, 115, 0, 0.6),
                0 0 0 2px rgba(255, 200, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }
}

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

/* Tutorial responsive design */
@media (max-width: 480px) {
  .tutorial-content {
    padding: 1.5rem;
    max-width: 320px;
  }

  .tutorial-step-title {
    font-size: 1.25rem;
  }

  .tutorial-step-description {
    font-size: 0.875rem;
  }

  .tutorial-navigation {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .tutorial-buttons {
    justify-content: space-between;
  }

  .tutorial-step-buttons {
    gap: 0.5rem;
  }

  .tutorial-btn {
    padding: 0.625rem 1rem;
    font-size: 0.8rem;
  }
}

/* High contrast mode support for tutorial */
@media (prefers-contrast: high) {
  .tutorial-content {
    background: white;
    border: 2px solid black;
  }

  .tutorial-backdrop {
    background: rgba(0, 0, 0, 0.8);
  }
}

/* Reduced motion support for tutorial */
@media (prefers-reduced-motion: reduce) {
  .tutorial-overlay,
  .tutorial-content,
  .tutorial-pointer {
    animation: none;
  }

  .tutorial-btn {
    transition: none;
  }
}

