:root{
  /* Dark theme by default */
  --bg:#0f1724;
  --panel:#0b1220;
  --accent:#6ee7b7;
  --muted:#9aa4b2;
  --bubble:#072033;
  --text-color: #e6eef6;
}

/* Global font style - System fonts for better performance and readability */
* {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Light theme overrides (applied when document.documentElement has data-theme="light") */
[data-theme="light"]{
  --bg: #f8fdfb;  /* Very light minty background for freshness */
  --panel: #ffffff;
  --accent: #10b981;  /* Green accent color */
  --accent-dark: #059669; /* Darker green for hover states */
  --muted: #52616b;  /* Softer gray-blue for readability */
  --bubble: #f0fdf4;  /* Very light green tint for bot bubbles */
  --text-color: #1e293b;  /* Slightly softer dark for less strain */
  --shadow-color: rgba(16, 185, 129, 0.06);  /* Subtle green-tinted shadows */
}

/* Light mode topbar */
[data-theme="light"] .topbar {
  background: linear-gradient(-45deg, #6ee7b7, #34d399, #a7f3d0, #10b981, #6ee7b7, #22c55e, #86efac, #16a34a, #06b6d4, #5eead4, #0891b2, #14b8a6, #34d399, #10b981, #047857) !important;
  background-size: 400% 400% !important;
  animation: headerGreenShift 15s ease-in-out infinite !important;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2) !important;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.15), 0 4px 20px rgba(52, 211, 153, 0.1) !important;
}

/* Light mode inputbar */
[data-theme="light"] .inputbar {
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Light mode sidebar */
[data-theme="light"] .sidebar {
  background: linear-gradient(-45deg, #6ee7b7, #34d399, #a7f3d0, #10b981, #6ee7b7, #22c55e, #86efac, #16a34a, #06b6d4, #5eead4, #0891b2, #14b8a6, #34d399, #10b981, #047857) !important;
  background-size: 400% 400% !important;
  animation: headerGreenShift 15s ease-in-out infinite !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.15), 0 4px 16px rgba(52, 211, 153, 0.1) !important;
}

/* Light mode menu items */
[data-theme="light"] .menu-item {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
  border: 1px solid #e2e8f0 !important;
  color: var(--text-color) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

[data-theme="light"] .menu-item:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
  color: white !important;
  border-color: var(--accent) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
  transform: translateX(4px) translateY(-2px);
}

/* Light mode bubbles */
[data-theme="light"] .bubble.bot {
  background: linear-gradient(135deg, #ffffff, #f8fafc) !important;
  border: 1px solid rgba(16, 185, 129, 0.1) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}

[data-theme="light"] .bubble.user {
  background: #dcf8c6 !important;
  color: #000000 !important;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13) !important;
}

/* Dark mode voice icon - dark color for visibility */
.send-btn.voice-icon {
  color: #181818 !important; /* Dark gray */
}

.send-btn.voice-icon.recording {
  color: #10b981 !important; /* Green when recording */
}

/* Light mode send button */
[data-theme="light"] .send-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
  color: white !important;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
}

/* Light mode tip icon - override send-btn background */
[data-theme="light"] .send-btn.tip-icon {
  background: transparent !important;
  box-shadow: none !important;
}

/* Light mode voice icon - override send-btn background (no green circle) */
[data-theme="light"] .send-btn.voice-icon {
  background: transparent !important;
  box-shadow: none !important;
  color: #181818 !important; /* Dark gray - same as dark mode */
}

[data-theme="light"] .send-btn.voice-icon.recording {
  color: #10b981 !important; /* Green when recording */
}

[data-theme="light"] .send-btn:hover {
  background: linear-gradient(135deg, var(--accent-dark), #047857) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35) !important;
}

[data-theme="light"] .send-btn.tip-icon:hover {
  background: transparent !important;
  box-shadow: none !important;
  transform: none;
}

[data-theme="light"] .send-btn.voice-icon:hover {
  background: transparent !important;
  box-shadow: none !important;
  transform: none;
}

[data-theme="light"] .send-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
}

[data-theme="light"] .send-btn.tip-icon:active {
  box-shadow: none !important;
}

[data-theme="light"] .send-btn.voice-icon:active {
  box-shadow: none !important;
}

/* Light mode toggle button */
[data-theme="light"] .mode-toggle {
  background: transparent !important;
  color: var(--accent) !important;
  border: 2px solid var(--accent) !important;
  transition: all 0.3s ease;
}

[data-theme="light"] .mode-toggle:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
}

/* Light mode inputbox */
[data-theme="light"] .inputbox {
  background: #ffffff !important;
  border: 2px solid transparent !important;
  color: #000000 !important;  /* Black text */
  transition: all 0.3s ease;
}

[data-theme="light"] .inputbox:focus {
  background: white !important;
  border-color: #86efac !important;  /* Light green on focus */
  box-shadow: none !important;
  outline: none !important;
}

/* Light mode main and messages */
[data-theme="light"] .main {
  background: transparent !important;
}

[data-theme="light"] .messages {
  background: transparent !important;
}

*{box-sizing:border-box}
.html,body,#root{height:100%;margin:0;font-family:Inter,Segoe UI,Roboto,Arial}
body{
  /* Light mode: Soft pastel gradient with white and light green shades for visible color shifting */
  background: linear-gradient(-45deg, #ffffff, #d1fae5, #fce7f3, #ffffff, #dbeafe, #bbf7d0, #fef3c7, #ffffff, #e0e7ff, #ccfbf1, #ffffff, #ffe4e6, #f5d0fe, #ffffff, #d9f99d, #e0f2fe, #fef9c3, #fce4ec, #e8f5e9, #e1f5fe, #f3e5f5, #fff3e0, #e0f7fa, #f1f8e9, #ffffff);
  background-size: 400% 400%;
  animation: gradientShift 20s ease-in-out infinite;
  color:var(--text-color);
  transition: background 0.5s ease;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 100%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 0%; }
  100% { background-position: 0% 50%; }
}

/* Dark mode animated background with 5 dark colors */
[data-theme="dark"] body {
  background: linear-gradient(-45deg, #0a0a0a, #1a1a2e, #16213e, #0f3460, #1a1a2e);
  background-size: 400% 400%;
  animation: darkGradientShift 25s ease-in-out infinite;
}

@keyframes darkGradientShift {
  0% { background-position: 0% 50%; }
  20% { background-position: 50% 100%; }
  40% { background-position: 100% 50%; }
  60% { background-position: 50% 0%; }
  80% { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}
.typing {
  opacity: 0.85;
  position: relative;
}

.typing-dots::after {
  content: '';
  animation: typingDots 1.4s ease-in-out infinite;
  font-weight: bold;
  color: var(--accent);
}

@keyframes typingDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

@keyframes voiceBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.voice-icon.recording {
  animation: voiceBlink 1s ease-in-out infinite;
}
.app{
  display:flex;
  flex-direction:column;
  height:100vh;
  height:100dvh; /* Dynamic viewport height for mobile */
  padding-top:0;
}
/* Green gradient animation for header */
@keyframes headerGreenShift {
  0% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 50% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  75% {
    background-position: 50% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Tip icon blinking animation - cycles through white, yellow, green, red */
@keyframes tipBlink {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 12px #ffffff);
    transform: scale(1);
  }
  25% {
    filter: brightness(1.2) drop-shadow(0 0 8px #fbbf24) drop-shadow(0 0 12px #fbbf24);
    transform: scale(1.1);
  }
  50% {
    filter: brightness(1.1) drop-shadow(0 0 8px #10b981) drop-shadow(0 0 12px #10b981);
    transform: scale(1.15);
  }
  75% {
    filter: brightness(1.2) drop-shadow(0 0 8px #ef4444) drop-shadow(0 0 12px #ef4444);
    transform: scale(1.1);
  }
}

.tip-icon {
  transition: all 0.2s ease;
}

.tip-blinking {
  animation: tipBlink 2s ease-in-out infinite !important;
}

/* Sample question cards - base styles */
.sample-question-card {
  user-select: none;
  -webkit-tap-highlight-color: rgba(16, 185, 129, 0.3);
}

.sample-question-card:active {
  transform: translateY(0) scale(0.97) !important;
  animation: none !important;
}

.sample-question-card:hover .question-icon {
  transform: scale(1.15);
}

.sample-question-card:hover {
  animation: none !important;
}

/* Sample question card gentle shake animation - each card moves individually */
.sample-question-card {
  animation: cardShake1 3s ease-in-out infinite;
}

.sample-question-card:nth-child(2) {
  animation: cardShake2 3.5s ease-in-out infinite;
  animation-delay: 0.3s;
}

.sample-question-card:nth-child(3) {
  animation: cardShake3 4s ease-in-out infinite;
  animation-delay: 0.7s;
}

.sample-question-card:nth-child(4) {
  animation: cardShake1 3.2s ease-in-out infinite;
  animation-delay: 1.1s;
}

.sample-question-card:nth-child(5) {
  animation: cardShake2 3.8s ease-in-out infinite;
  animation-delay: 1.5s;
}

.sample-question-card:nth-child(6) {
  animation: cardShake3 3.3s ease-in-out infinite;
  animation-delay: 0.5s;
}

.sample-question-card:nth-child(7) {
  animation: cardShake1 3.6s ease-in-out infinite;
  animation-delay: 1.8s;
}

.sample-question-card:nth-child(8) {
  animation: cardShake2 4.2s ease-in-out infinite;
  animation-delay: 0.9s;
}

/* Different shake patterns for variety */
@keyframes cardShake1 {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(0);
  }
  75% {
    transform: translateX(4px);
  }
}

@keyframes cardShake2 {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(3px);
  }
  40% {
    transform: translateX(-2px);
  }
  60% {
    transform: translateX(2px);
  }
  80% {
    transform: translateX(-3px);
  }
}

@keyframes cardShake3 {
  0%, 100% {
    transform: translateX(0);
  }
  33% {
    transform: translateX(-3px);
  }
  66% {
    transform: translateX(3px);
  }
}

.topbar{
  display:flex;
  align-items:center;
  padding:16px 20px;
  padding-top: max(16px, env(safe-area-inset-top));
  margin: 8px 8px 0 8px;
  background: linear-gradient(-45deg, #10b981, #059669, #047857, #065f46, #064e3b, #0d9488, #14b8a6);
  background-size: 400% 400%;
  animation: headerGreenShift 15s ease-in-out infinite;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
  border: 1px solid rgba(16, 185, 129, 0.4);
  position: -webkit-sticky;
  position: sticky;
  top:0;
  left:0;
  right:0;
  z-index:1400;
  min-height: 66px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .topbar {
  background: linear-gradient(-45deg, #064e3b, #065f46, #047857, #059669, #0d9488, #115e59, #134e4a) !important;
  background-size: 400% 400% !important;
  animation: headerGreenShift 15s ease-in-out infinite !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(6, 95, 70, 0.3) !important;
}
.menu-btn{
  margin-right:14px;
  width: 42px;
  height: 42px;
  background: transparent;
  backdrop-filter: none;
  border: none;
  color:#ffffff;
  cursor:pointer;
  font-size:22px;
  border-radius: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  box-shadow: none;
}

.menu-btn:hover {
  background: transparent;
  transform: scale(1.1);
  box-shadow: none;
}

[data-theme="dark"] .menu-btn {
  background: transparent;
  border: none;
  color: #6ee7b7;
  text-shadow: none;
}

[data-theme="dark"] .menu-btn:hover {
  background: transparent;
}

[data-theme="dark"] .sidebar {
  background: linear-gradient(-45deg, #064e3b, #065f46, #047857, #059669, #0d9488, #115e59, #134e4a) !important;
  background-size: 400% 400% !important;
  animation: headerGreenShift 15s ease-in-out infinite !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 5px 15px rgba(6, 95, 70, 0.3) !important;
}

.title{
  font-weight:600;
  font-size:22px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.2px;
}

[data-theme="dark"] .title {
  color: #6ee7b7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.container{
  flex: 1;
  display: flex;
  gap: clamp(8px, 2vw, 16px);
  padding: clamp(12px, 2vw, 18px);
  position: relative;
  height: 100%;
  min-height: 400px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

/* Sidebar and overlay improvements */
.sidebar{
    width: clamp(240px, 30vw, 280px);
    max-width: min(90vw, 400px);
    min-width: min(240px, 90vw);
    background: linear-gradient(-45deg, #10b981, #059669, #047857, #065f46, #064e3b, #0d9488, #14b8a6);
    background-size: 400% 400%;
    animation: headerGreenShift 15s ease-in-out infinite;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3), 0 5px 15px rgba(5, 150, 105, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1502;
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Auto-hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Webkit browsers - hide scrollbar */
.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

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

.sidebar-overlay{
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background: rgba(2,6,23,0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 16px;
    padding-top: calc(64px + 16px); /* Header height + spacing */
    z-index: 1500;
    overflow-y: auto;
}

/* Menu items styling */
.menu-item {
    padding: 12px 14px;
    margin: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: clamp(12px, 2.5vw, 14px);
    font-weight: 500;
    display: block;
    width: 100%;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    box-sizing: border-box;
}

.menu-item:hover {
    background: var(--accent);
    color: #072033;
    transform: translateX(4px);
    border-color: var(--accent);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: clamp(8px, 2vw, 12px);
        gap: 12px;
    }
    
    /* Header - iPhone optimized */
    .topbar {
        margin: 6px;
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
        min-height: 62px;
        font-size: 21px; /* Bot name size - increased */
        border-radius: 12px;
    }
    
    .topbar h1, .topbar .bot-name {
        font-size: 21px; /* Header bot name - increased */
        font-weight: 600;
    }
    
    .title {
        font-size: 20px !important; /* Larger for better readability */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .topbar .bot-status, .topbar .status-text {
        font-size: 13px; /* Status text */
        opacity: 0.9;
    }
    
    /* Menu items */
    .menu-item {
        font-size: 15px; /* Menu size */
        padding: 14px 16px; /* Touch-friendly 44px+ height */
        min-height: 46px;
        white-space: normal;
        line-height: 1.5;
        background: rgba(255,255,255,0.1);
    }
    
    /* Menu button - touch friendly */
    .menu-btn {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    /* Chat bubbles */
    .bubble {
        max-width: 85%;
        font-size: 17px !important; /* Override base clamp - Readable chat text */
        line-height: 1.4;
        padding: 10px 14px;
    }
    
    /* Time stamps */
    .message-time, .bubble-time, .time {
        font-size: 11px; /* Time text */
    }
    
    /* Sample questions popup - mobile responsive */
    .sample-questions-popup {
        width: min(300px, calc(100vw - 40px)) !important;
        max-width: 300px !important;
        left: 16px !important;
        right: auto !important;
    }
    
    /* Input area */
    .inputbar {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 4px;
        gap: 2px;
    }
    
    .inputbar input, .inputbar textarea {
        font-size: 16px; /* Prevents iOS zoom */
        line-height: 1.5;
    }
    
    /* Send button - touch friendly */
    .send-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 20px;
    }
    
    /* Sidebar */
    .sidebar {
        width: min(85vw, 320px);
        max-width: 85vw;
        max-height: calc(100vh - 100px);
        background: var(--panel);
        border: 1px solid rgba(255,255,255,0.1);
        padding: 12px;
    }
    
    .messages {
        padding: 12px 8px;
        padding-bottom: 100px;
    }
    
    .sidebar-overlay {
        padding: 12px;
        padding-top: calc(64px + 12px);
        align-items: flex-start;
    }
}

/* Tablets and smaller laptops */
@media (max-width: 640px) {
    .sidebar {
        width: min(300px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        padding: 12px;
    }
    
    .menu-item {
        font-size: 12.5px;
        padding: 11px 12px;
    }
    
    .sidebar-overlay {
        padding: 10px;
        padding-top: calc(56px + 10px);
    }
}

/* Extra small screens (phones in portrait) - iPhone optimized */
@media (max-width: 480px) {
    .container {
        padding: 8px;
        gap: 8px;
        height: 100%;
    }
    
    /* Header */
    .topbar {
        margin: 6px;
        padding: 12px 14px;
        min-height: 62px;
    }
    
    .topbar h1, .topbar .bot-name {
        font-size: 21px; /* Bot name - increased */
    }
    
    .title {
        font-size: 19px !important; /* Larger with more space */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .topbar .bot-status, .topbar .status-text {
        font-size: 13px; /* Status */
    }
    
    /* Menu button - touch friendly */
    .menu-btn {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    /* Chat bubbles */
    .bubble {
        max-width: 85%;
        font-size: 17px !important; /* Readable */
        padding: 10px 14px;
        line-height: 1.4;
    }
    
    /* Time stamps */
    .message-time, .bubble-time, .time {
        font-size: 11px;
    }
    
    /* Sample questions popup - mobile responsive */
    .sample-questions-popup {
        width: calc(100vw - 20px) !important;
        max-width: 320px !important;
        left: 10px !important;
    }
    
    /* Input area */
    .inputbar {
        left: 8px;
        right: 8px;
        bottom: 10px;
        padding: 4px;
        gap: 2px;
    }
    
    .inputbar input, .inputbar textarea {
        font-size: 16px; /* Prevents zoom */
    }
    
    /* Send button - touch friendly */
    .send-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Menu items - touch friendly */
    .menu-item {
        font-size: 15px;
        padding: 14px 12px;
        min-height: 46px;
        background: rgba(255,255,255,0.12);
        margin: 3px 0;
        line-height: 1.4;
    }
    
    .sidebar {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 80px);
        padding: 10px;
        background: var(--panel);
        box-shadow: 0 20px 40px rgba(0,0,0,0.5);
        min-width: unset;
    }
    
    .sidebar-overlay {
        padding: 8px;
        padding-top: calc(56px + 8px);
        background: rgba(2,6,23,0.9);
    }
}

/* Very small screens - maintain readability */
@media (max-width: 360px) {
    .container {
        padding: 6px;
        gap: 6px;
    }
    
    /* Keep readable sizes even on small screens */
    .topbar {
        min-height: 58px;
    }
    
    .topbar h1, .topbar .bot-name {
        font-size: 16px; /* Slightly smaller but readable */
    }
    
    .title {
        font-size: 17px !important; /* Readable even on small screens */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .topbar .bot-status, .topbar .status-text {
        font-size: 12px;
    }
    
    .bubble {
        max-width: 90%;
        font-size: 16px; /* Keep 16px for readability */
        padding: 10px 12px;
    }
    
    .message-time, .bubble-time, .time {
        font-size: 11px;
    }
    
    .inputbar input, .inputbar textarea {
        font-size: 16px; /* Never below 16px to prevent zoom */
    }
    
    .menu-item {
        font-size: 15px; /* Keep readable */
        padding: 12px 10px;
        min-height: 44px;
    }
    
    .menu-btn, .send-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .sidebar {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        padding: 8px;
    }
    
    .sidebar-overlay {
        padding: 6px;
        padding-top: calc(52px + 6px);
    }
}

/* Landscape phones */
@media (max-width: 900px) and (max-height: 500px) {
    .sidebar {
        max-height: calc(100vh - 80px);
        width: min(280px, calc(100vw - 20px));
    }
    
    .menu-item {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .sidebar-overlay {
        padding: 8px;
        padding-top: calc(56px + 8px);
    }
}

.main{
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  min-height: 0;
  max-width: 100%;
  overflow: hidden;
  background: transparent;
}

.messages{
  flex:1;
  padding: clamp(12px, 3vw, 20px);
  padding-bottom: clamp(12px, 3vw, 20px);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 12px;
  background: transparent;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  margin-bottom: 10px;
  max-width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Auto-hide scrollbar for Sample Questions popup */
.sample-questions-popup {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sample-questions-popup::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Meta AI-style Welcome Screen */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.welcome-screen h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.welcome-screen p {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 32px 0;
  max-width: 400px;
  line-height: 1.5;
}

/* Welcome questions grid */
.welcome-screen > div:last-child {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 600px;
  padding: 0 10px;
}

@media (max-width: 600px) {
  .welcome-screen {
    padding: 20px 16px;
    min-height: auto;
  }
  
  .welcome-screen h1 {
    font-size: 24px;
  }
  
  .welcome-screen > div:last-child {
    grid-template-columns: 1fr;
  }
}

/* Auto-hide scrollbar for messages */
.messages {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.messages::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Beautiful WhatsApp-style chat bubbles */
.bubble {
  display: inline-block;
  padding: clamp(10px, 2vw, 14px) clamp(12px, 2.5vw, 16px);
  border-radius: clamp(8px, 1.5vw, 10px);
  margin: clamp(6px, 1.5vw, 8px) 0;
  max-width: min(85%, 600px);
  line-height: 1.5;
  font-size: clamp(17px, 3.5vw, 19px);
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
  animation: bubbleSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.2s ease;
}

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

/* User message bubbles - WhatsApp style */
.user {
  background: #dcf8c6;
  color: #000000;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
  border-radius: 8px;
  margin-left: auto;
  text-align: left;
  font-weight: 400;
  position: relative;
  overflow: visible;
}

.user::before {
  content: '';
  position: absolute;
  right: -8px;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 12px 8px;
  border-color: transparent transparent #dcf8c6 transparent;
}

[data-theme="dark"] .user {
  background: #056152;
  color: #ffffff;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .user::before {
  border-color: transparent transparent #056152 transparent;
}

.user .meta {
  display: block;
  text-align: right;
  color: rgba(0, 0, 0, 0.45);
  font-size: 11px;
  margin-top: 4px;
  margin-left: 12px;
  font-weight: 400;
  float: right;
  clear: both;
}

[data-theme="dark"] .user .meta {
  color: rgba(255, 255, 255, 0.5);
}

/* Bot message bubbles - WhatsApp style */
.bot {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
  border-radius: 8px;
  margin-right: auto;
  text-align: left;
  font-weight: 400;
  position: relative;
  overflow: visible;
}

.bot::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 12px 0;
  border-color: transparent #ffffff transparent transparent;
}

[data-theme="dark"] .bot {
  background: #262d31;
  color: #e9edef;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .bot::before {
  border-color: transparent #262d31 transparent transparent;
}

.bot .meta {
  display: block;
  text-align: right;
  color: rgba(0, 0, 0, 0.45);
  font-size: 11px;
  margin-top: 4px;
  margin-left: 12px;
  font-weight: 400;
  float: right;
  clear: both;
}

[data-theme="dark"] .bot .meta {
  color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .bot .meta {
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Typing animation for bot messages */
.bubble.typing {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #1e293b;
  padding: 16px 20px;
  animation: typingPulse 1.5s ease-in-out infinite;
}

[data-theme="dark"] .bubble.typing {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #e2e8f0;
}

@keyframes typingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Message container improvements */
.messages > div {
  animation: messageGroupSlide 0.3s ease-out;
}

@keyframes messageGroupSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Emoji tweaks in chat bubbles */
/* Note: Avoid non-standard properties; rely on font rendering */

.bubble img.emoji {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.1em;
}

/* Staff profile images in chat bubbles */
.bubble img:not(.emoji):not(.qa-photo),
.bubble .staff-profile-photo {
  display: block;
  max-width: 150px;
  max-height: 150px;
  margin: 0 auto 10px auto;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #2e7d32;  /* Dark green border for staff photos */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* QA/General photos with dark green border - centered at top, clickable */
.bubble img.qa-photo,
.bubble .qa-photo {
  display: block;
  max-width: 100%;
  max-height: 300px;
  margin: 0 auto 15px auto;  /* Centered horizontally */
  border-radius: 8px;
  object-fit: cover;
  border: 3px solid #2e7d32;  /* Dark green border */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;  /* Clickable for lightbox */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bubble img.qa-photo:hover,
.bubble .qa-photo:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Message spacing improvements */
.messages > div {
  margin-bottom: 12px;
  animation: messageSlide 0.4s ease-out;
}

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

/* Meta timestamp styling - WhatsApp style inside bubbles */
.meta {
  font-size: 11px;
  opacity: 1;
  letter-spacing: 0.2px;
  line-height: 1;
}

.inputbar {
  display: flex;
  padding: 0;
  align-items: center;
  gap: 2px;
  background: transparent;
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  border-radius: 0;
  box-shadow: none;
  z-index: 1300;
  border: none;
  box-sizing: border-box;
}
.inputbox{flex:1;padding:10px 14px;border-radius:24px;background:var(--panel);border:1px solid rgba(255,255,255,0.1);color:var(--text-color);box-shadow:0 2px 12px rgba(0,0,0,0.15);box-sizing:border-box;min-width:0}

/* Enhanced input text visibility - match container background */
[data-theme="dark"] .inputbox {
  background: #D3D3D3 !important;  /* Light gray background same as container */
  border: 2px solid transparent !important;
  color: #000000 !important;  /* Black text */
  transition: all 0.3s ease;
}

[data-theme="dark"] .inputbox::placeholder {
  color: #64748b !important;  /* Dark gray placeholder */
  opacity: 1;
}

[data-theme="dark"] .inputbox:focus {
  background: #D3D3D3 !important;  /* Keep same background on focus */
  border-color: #047857 !important;  /* Dark green on focus */
  box-shadow: none !important;
  outline: none !important;
}

[data-theme="light"] .inputbox::placeholder {
  color: #64748b;  /* Dark gray placeholder in light mode */
  opacity: 1;
}

.send-btn{background:#10b981;border:none;padding:8px 16px;border-radius:20px;color:#ffffff;font-weight:600;cursor:pointer;flex-shrink:0;min-width:fit-content;box-sizing:border-box;white-space:nowrap}
.small{font-size:12px;color:var(--muted)}
/* thinking animation - pulsing dots only, no frame */
.thinking{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:0;
  background:transparent;
}
.thinking span{
  width:8px;
  height:8px;
  background:var(--accent);
  border-radius:50%;
  animation:pulse 1.2s ease-in-out infinite;
}
.thinking span:nth-child(1){animation-delay:0s}
.thinking span:nth-child(2){animation-delay:0.2s}
.thinking span:nth-child(3){animation-delay:0.4s}
@keyframes pulse{
  0%,100%{transform:scale(0.8); opacity:0.5}
  50%{transform:scale(1.2); opacity:1}
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 0.9;
    transform: translateX(-50%) translateY(0);
  }
}
.menu-item{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.02);
}

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

/* Voice toggle switch styling */
.voice-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    cursor: pointer;
}

.voice-toggle input[type="checkbox"] {
    height: 0;
    width: 0;
    visibility: hidden;
    position: absolute;
}

.voice-toggle label {
    cursor: pointer;
    text-indent: -9999px;
    width: 46px;
    height: 24px;
    background: var(--muted);
    display: block;
    border-radius: 100px;
    position: relative;
}

.voice-toggle label:after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--panel);
    border-radius: 90px;
    transition: 0.3s;
}

.voice-toggle input:checked + label {
    background: var(--accent);
}

/* Light mode specific voice toggle */
[data-theme="light"] .voice-toggle label {
    background: #e2e8f0;
    border: 1px solid rgba(0,0,0,0.05);
}

[data-theme="light"] .voice-toggle input:checked + label {
    background: var(--accent);
    border-color: transparent;
}

[data-theme="light"] .voice-toggle label:after {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.voice-toggle input:checked + label:after {
    left: calc(100% - 2px);
    transform: translateX(-100%);
}

.voice-toggle label:active:after {
    width: 26px;
}

/* Voice selector dropdown styling */
.voice-selector {
    margin-right: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 2px solid var(--accent);
    background: var(--bg);
    color: var(--text-color);
    font-size: 13px;
    cursor: pointer;
    max-width: 200px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.voice-selector:hover {
    background: var(--panel);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(110, 231, 183, 0.2);
}

.voice-selector:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.3);
}

.voice-selector option {
    background: var(--panel);
    color: var(--text-color);
    padding: 8px;
}

/* Light mode voice selector */
[data-theme="light"] .voice-selector {
    background: white;
    border-color: var(--accent);
    color: var(--text-color);
}

[data-theme="light"] .voice-selector:hover {
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .voice-selector:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

[data-theme="light"] .voice-selector option {
    background: white;
    color: var(--text-color);
}

/* Global select and option dark mode styling with maximum specificity */
select,
select:not([multiple]),
.input-field select,
#departmentSelect,
#dataTypeSelect,
#departmentFilter,
#categoryFilter {
    background-color: var(--bg) !important;
    color: var(--text-color) !important;
    border-color: var(--muted) !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select option,
select:not([multiple]) option,
.input-field select option {
    background-color: var(--panel) !important;
    color: var(--text-color) !important;
    padding: 10px !important;
}

select option:hover,
select option:checked,
select option:focus,
select option:active {
    background-color: var(--accent) !important;
    color: #000 !important;
}

/* Light mode overrides */
[data-theme="light"] select,
[data-theme="light"] select:not([multiple]),
[data-theme="light"] .input-field select,
[data-theme="light"] #departmentSelect,
[data-theme="light"] #dataTypeSelect,
[data-theme="light"] #departmentFilter,
[data-theme="light"] #categoryFilter {
    background-color: white !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* Explicit dark theme overrides to ensure selects follow dark theme when data-theme is not 'light' */
[data-theme="dark"] select,
[data-theme="dark"] select:not([multiple]),
[data-theme="dark"] .input-field select,
[data-theme="dark"] #departmentSelect,
[data-theme="dark"] #dataTypeSelect,
[data-theme="dark"] #departmentFilter,
[data-theme="dark"] #categoryFilter {
  background-color: var(--panel) !important;
  color: var(--text-color) !important;
  border-color: var(--muted) !important;
}

/* Ensure filter-select (used on uploaded-files and other pages) respects theme */
.filter-select {
  background-color: var(--bg) !important;
  color: var(--text-color) !important;
  border: 1px solid var(--muted) !important;
}

/* Ensure voice-selector follows theme explicitly */
.voice-selector {
  background-color: var(--panel) !important;
  color: var(--text-color) !important;
  border-color: var(--accent) !important;
}

[data-theme="light"] select option,
[data-theme="light"] select:not([multiple]) option,
[data-theme="light"] .input-field select option {
    background-color: white !important;
    color: #0f172a !important;
}

[data-theme="light"] select option:hover,
[data-theme="light"] select option:checked,
[data-theme="light"] select option:focus,
[data-theme="light"] select option:active {
    background-color: #10b981 !important;
    color: white !important;
}

.modal{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);background:var(--panel);padding:20px;border-radius:10px;max-width:720px;width:90%;box-shadow:0 10px 30px rgba(0,0,0,0.6);z-index:2000}
.modal h3{margin-top:0}
.file-input{display:block}


/* Large screens optimization */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .bubble {
        max-width: min(70%, 700px);
        font-size: 15px;
    }
    
    .messages {
        padding: 20px clamp(20px, 5vw, 60px);
    }
}

/* Extra large screens */
@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
    
    .bubble {
        max-width: min(65%, 800px);
    }
}

/* responsive - Updated to work with hamburger menu */
@media(max-width:900px){
  /* Don't hide sidebar - it's controlled by menuOpen state now */
  .container{padding:12px}
  .inputbar{left:12px;right:12px;bottom:12px}
}

/* Welcome screen overlay - mobile responsive */
.welcome-screen-overlay {
  -webkit-overflow-scrolling: touch;
  /* Auto-hide scrollbar for welcome screen */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.welcome-screen-overlay::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Light mode scrollbar for welcome screen - also hidden */
[data-theme="light"] .welcome-screen-overlay {
  scrollbar-width: none;
}
[data-theme="light"] .welcome-screen-overlay::-webkit-scrollbar {
  display: none;
}

/* Mobile welcome screen adjustments - NO font-size overrides to respect customization */
@media (max-width: 480px) {
  .welcome-screen-overlay {
    padding: 12px 10px !important;
    bottom: 65px !important;
  }
}

@media (max-width: 360px) {
  .welcome-screen-overlay {
    padding: 10px 8px !important;
  }
}

/* Feedback Buttons - Style 8: Clean Links (no underline) */
.feedback-buttons {
  display: flex !important;
  gap: 16px !important;
  margin-top: 2px !important;  /* Directly under bubble */
  margin-left: 4px !important;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  border-width: 0 !important;
  box-shadow: none !important;
  padding: 2px 0 !important;
}

.feedback-btn,
button.feedback-btn,
.feedback-buttons button {
  all: unset !important;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  border-width: 0 !important;
  border-style: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 2px 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: color 0.2s ease !important;
  color: #888 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  text-decoration: none !important;
}

.feedback-btn:hover,
button.feedback-btn:hover,
.feedback-buttons button:hover {
  color: #333 !important;
  background: none !important;
  border: none !important;
  text-decoration: none !important;
}

.feedback-btn.up:hover,
.feedback-buttons button.up:hover {
  color: #28a745 !important;
}

.feedback-btn.down:hover,
.feedback-buttons button.down:hover {
  color: #dc3545 !important;
}

.feedback-btn:active,
button.feedback-btn:active,
.feedback-buttons button:active {
  transform: none !important;
}

.feedback-btn.active,
button.feedback-btn.active,
.feedback-buttons button.active {
  color: #333 !important;
}

.feedback-btn.active.up,
.feedback-buttons button.active.up {
  color: #28a745 !important;
}

.feedback-btn.active.down,
.feedback-buttons button.active.down {
  color: #dc3545 !important;
}

.feedback-btn:focus,
button.feedback-btn:focus,
.feedback-buttons button:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* Dark mode feedback buttons - same transparent styling */
[data-theme="dark"] .feedback-buttons {
  background: none !important;
  border: none !important;
}

[data-theme="dark"] .feedback-btn,
[data-theme="dark"] button.feedback-btn,
[data-theme="dark"] .feedback-buttons button {
  background: none !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  color: #aaa !important;
}

[data-theme="dark"] .feedback-btn:hover,
[data-theme="dark"] button.feedback-btn:hover {
  color: #eee !important;
  border-bottom-color: #eee !important;
}

[data-theme="dark"] .feedback-btn.up:hover {
  color: #5cb85c !important;
  border-bottom-color: #5cb85c !important;
}

[data-theme="dark"] .feedback-btn.down:hover {
  color: #d9534f !important;
  border-bottom-color: #d9534f !important;
}

[data-theme="dark"] .feedback-btn.active,
[data-theme="dark"] button.feedback-btn.active {
  color: #eee !important;
  border-bottom-color: #eee !important;
}

/* Feedback recorded animation */
@keyframes feedbackRecorded {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.feedback-recorded {
  animation: feedbackRecorded 0.4s ease-out forwards;
}

.feedback-recorded span:first-child {
  animation: checkmarkPop 0.3s ease-out 0.1s forwards;
}

.feedback-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  z-index: 9999;
  border-radius: 0 0 4px 0;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0 !important;
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Focus visible for all interactive elements */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Selection bubbles for multi-result selections (staff, items, etc.) */
.selection-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.selection-bubbles .bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #10b981, #059669);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.35), 
              0 1px 2px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: bubble-pulse 2s ease-in-out infinite;
}

@keyframes bubble-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(0.95); }
}

.selection-bubbles .bubble::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  right: 6px;
  height: 8px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
  border-radius: 50%;
}

.selection-bubbles .bubble:hover {
  transform: scale(1.15) translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5),
              0 2px 4px rgba(0, 0, 0, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: linear-gradient(145deg, #34d399, #10b981);
}

.selection-bubbles .bubble:active {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.selection-bubbles .bubble.selected {
  background: linear-gradient(145deg, #059669, #047857);
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4),
              0 3px 8px rgba(5, 150, 105, 0.4);
  animation: pulse-selected 1.5s ease-in-out infinite;
}

@keyframes pulse-selected {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4), 0 3px 8px rgba(5, 150, 105, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.2), 0 3px 8px rgba(5, 150, 105, 0.4); }
}

[data-theme="light"] .selection-bubbles .bubble {
  background: linear-gradient(145deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.4), 
              0 1px 2px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .selection-bubbles .bubble:hover {
  background: linear-gradient(145deg, #34d399, #10b981);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5),
              0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .selection-bubbles .bubble.selected {
  background: linear-gradient(145deg, #047857, #065f46);
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3),
              0 3px 8px rgba(4, 120, 87, 0.4);
}

/* ========================================
   Staff Profile Photo Lightbox/Popup
   ======================================== */
.staff-profile-photo {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.staff-profile-photo:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Image Lightbox Overlay */
.image-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: pointer;
}

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

/* Close button - top right corner */
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 25px;
  color: white;
  font-size: 45px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 10001;
  line-height: 1;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-close:hover {
  color: #ff6b6b;
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
}

/* Lightbox content container */
.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 90%;
  max-height: 85%;
}

.image-lightbox-overlay .lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  animation: lightboxZoomIn 0.3s ease;
  object-fit: contain;
}

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

/* Staff name and role caption below image */
.lightbox-caption {
  margin-top: 20px;
  text-align: center;
  animation: lightboxZoomIn 0.3s ease 0.1s both;
}

.lightbox-caption .staff-name {
  color: white;
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  display: block;
  margin-bottom: 6px;
}

.lightbox-caption .staff-role {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  font-style: italic;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  display: block;
}

/* Message Status Indicators - WhatsApp Style */
.message-status {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  margin-left: 4px;
}

/* ✓ Sent - single gray checkmark */
.message-status.sent {
  color: rgba(255, 255, 255, 0.6);
}

/* ⏳ Processing - animated */
.message-status.processing {
  color: rgba(255, 255, 255, 0.8);
  animation: pulse 1.5s ease-in-out infinite;
}

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

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

/* ✓✓ Delivered - double blue checkmark */
.message-status.delivered {
  color: #53bdeb; /* WhatsApp blue tick color */
  font-weight: bold;
}

/* ❌ Error - red */
.message-status.error {
  color: #ef4444;
}

/* Light mode status indicators */
[data-theme="light"] .message-status.sent {
  color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .message-status.processing {
  color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .message-status.delivered {
  color: #34b7f1; /* Slightly darker blue for light mode */
}

[data-theme="light"] .message-status.error {
  color: #dc2626;
}

/* Ping animation for online indicator (optional style) */
@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Link Confirmation Modal */
.link-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.link-confirm-overlay.active {
  opacity: 1;
  visibility: visible;
}

.link-confirm-modal {
  background: var(--panel);
  border-radius: 16px;
  padding: 28px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.25s ease;
  position: relative;
}

.link-confirm-overlay.active .link-confirm-modal {
  transform: scale(1) translateY(0);
}

.link-confirm-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  animation: modalIconBounce 0.5s ease;
}

.link-confirm-icon.website {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  box-shadow: 0 4px 20px rgba(52, 152, 219, 0.4);
}

.link-confirm-icon.phone {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  box-shadow: 0 4px 20px rgba(39, 174, 96, 0.4);
}

.link-confirm-icon.emergency {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
  animation: modalIconBounce 0.5s ease, emergencyPulse 2s ease-in-out infinite;
}

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

@keyframes emergencyPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(231, 76, 60, 0.8); }
}

.link-confirm-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
  color: var(--text);
}

.link-confirm-message {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text-secondary);
}

.link-confirm-url {
  background: var(--input-bg);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  word-break: break-all;
  margin-bottom: 24px;
  color: var(--text);
  border: 1px solid var(--border);
  max-height: 80px;
  overflow-y: auto;
}

.link-confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.link-confirm-btn {
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  min-width: 110px;
}

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

.link-confirm-btn.cancel:hover {
  background: var(--border);
  transform: translateY(-1px);
}

.link-confirm-btn.confirm {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.link-confirm-btn.confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

.link-confirm-btn.confirm.phone {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.link-confirm-btn.confirm.phone:hover {
  box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
}

.link-confirm-btn.confirm.emergency {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.link-confirm-btn.confirm.emergency:hover {
  box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

/* Light mode adjustments */
[data-theme="light"] .link-confirm-modal {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .link-confirm-url {
  background: #f5f5f5;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .link-confirm-modal {
    padding: 24px 20px;
    max-width: 95%;
  }
  
  .link-confirm-buttons {
    flex-direction: column;
  }
  
  .link-confirm-btn {
    width: 100%;
  }
}



