/* ==========================================
   Blue Sea AI — Premium Dark Ocean Theme
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --deep:         #040914;
  --navy:         #081225;
  --sidebar-bg:   #0a162b;
  --teal:         #0891b2;
  --cyan:         #06b6d4;
  --aqua:         #22d3ee;
  --foam:         #a5f3fc;
  --accent:       #00d2ff;
  --pro-purple:   #a855f7;
  --pro-gradient: linear-gradient(135deg, #00d2ff 0%, #3b82f6 50%, #9333ea 100%);
  --glass:        rgba(8, 22, 45, 0.65);
  --glass-light:  rgba(15, 38, 75, 0.45);
  --glass-border: rgba(0, 210, 255, 0.22);
  --glass-hover:  rgba(0, 210, 255, 0.12);
  --radius-lg:    16px;
  --radius:       12px;
  --radius-sm:    8px;
  --transition:   all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow:       0 12px 32px rgba(0, 0, 0, 0.55);
  --glow-cyan:    0 0 25px rgba(0, 210, 255, 0.35);
  --glow-pro:     0 0 30px rgba(168, 85, 247, 0.4);
  --text-primary: #f0f9ff;
  --text-secondary:#7dd3fc;
  --text-muted:   #38bdf8;
  --text-dim:     #527999;
  --font:         'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  /* Theme transition */
  --bg-page:      var(--deep);
  --bg-sidebar:   var(--sidebar-bg);
  --bg-chat:      transparent;
  --bg-input:     rgba(8,22,45,0.85);
  --border-color: var(--glass-border);
}

/* ==========================================
   THEME: MIDNIGHT OBSIDIAN (Dark Glass)
   ========================================== */
[data-theme="light"],
[data-theme="midnight"] {
  --deep:         #030712;
  --navy:         #0b1329;
  --sidebar-bg:   #060c1c;
  --cyan:         #38bdf8;
  --aqua:         #0ea5e9;
  --accent:       #00d2ff;
  --glass:        rgba(11, 23, 42, 0.7);
  --glass-light:  rgba(15, 30, 56, 0.5);
  --glass-border: rgba(56, 189, 248, 0.18);
  --glass-hover:  rgba(56, 189, 248, 0.1);
  --text-primary: #f8fafc;
  --text-secondary:#94a3b8;
  --text-muted:   #38bdf8;
  --text-dim:     #64748b;
  --shadow:       0 12px 32px rgba(0, 0, 0, 0.6);
  --glow-cyan:    0 0 20px rgba(56, 189, 248, 0.25);
  --bg-page:      #030712;
  --bg-sidebar:   #060c1c;
  --bg-input:     rgba(11, 23, 42, 0.85);
  --border-color: rgba(56, 189, 248, 0.18);
}

/* ==========================================
   THEME: OCEAN (Tropical)
   ========================================== */
[data-theme="ocean"] {
  --deep:         #042b2f;
  --navy:         #063d3f;
  --sidebar-bg:   #052e31;
  --cyan:         #10b981;
  --aqua:         #34d399;
  --accent:       #00f5a0;
  --glass:        rgba(4,43,47,0.75);
  --glass-light:  rgba(6,61,63,0.55);
  --glass-border: rgba(0,245,160,0.2);
  --glass-hover:  rgba(0,245,160,0.1);
  --text-primary: #ecfdf5;
  --text-secondary:#6ee7b7;
  --text-muted:   #34d399;
  --text-dim:     #4a8c70;
  --glow-cyan:    0 0 25px rgba(0,245,160,0.3);
  --bg-page:      #042b2f;
  --bg-sidebar:   #052e31;
}

[data-theme="ocean"] body { background: #042b2f; }
[data-theme="ocean"] .ocean-bg { filter: hue-rotate(120deg); }
[data-theme="ocean"] .mode-btn.active { background: rgba(0,245,160,0.2); color: #00f5a0; border-color: rgba(0,245,160,0.4); }
[data-theme="ocean"] .send-btn { background: linear-gradient(135deg, #10b981, #00f5a0); }

*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--deep);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================
   ANIMATED OCEAN BACKGROUND
   ========================================== */

.ocean-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(circle at 15% 85%, rgba(0, 210, 255, 0.12) 0%, transparent 55%),
              radial-gradient(circle at 85% 15%, rgba(147, 51, 234, 0.1) 0%, transparent 55%),
              #040914;
}

.wave {
  position: absolute;
  bottom: 0; left: 0;
  width: 200%;
  border-radius: 50% 50% 0 0;
  opacity: 0.035;
  animation: waveMove linear infinite;
}

.wave1 { height: 220px; background: linear-gradient(180deg, var(--cyan), var(--teal)); animation-duration: 18s; }
.wave2 { height: 170px; background: linear-gradient(180deg, var(--aqua), var(--cyan)); animation-duration: 24s; animation-delay: -6s; opacity: 0.025; }
.wave3 { height: 130px; background: linear-gradient(180deg, var(--foam), var(--aqua)); animation-duration: 30s; animation-delay: -12s; opacity: 0.02; }

@keyframes waveMove {
  0%   { transform: translateX(0) translateY(0); }
  50%  { transform: translateX(-25%) translateY(-12px); }
  100% { transform: translateX(-50%) translateY(0); }
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--cyan);
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-100vh) scale(0.6); opacity: 0; }
}

/* ==========================================
   LAYOUT
   ========================================== */

.main-container {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

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

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.25);
}

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  text-align: center;
  padding: 20px;
}

.welcome-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  background: transparent;
  border: none;
  box-shadow: none;
  max-width: 800px;
  width: 100%;
}

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

.welcome-icon {
  width: 110px;
  height: 110px;
  border-radius: 30px;
  background: linear-gradient(135deg, #0284c7, #06b6d4, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  line-height: 1;
  box-shadow: 0 0 50px rgba(6, 182, 212, 0.5), 0 0 80px rgba(139, 92, 246, 0.3);
  margin-bottom: 4px;
  animation: iconPulse 3s ease-in-out infinite alternate;
}

@keyframes iconPulse {
  0%   { transform: scale(1); box-shadow: 0 0 40px rgba(6, 182, 212, 0.4); }
  100% { transform: scale(1.05); box-shadow: 0 0 65px rgba(6, 182, 212, 0.7), 0 0 90px rgba(139, 92, 246, 0.5); }
}

.hero-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.4);
  padding: 5px 16px;
  border-radius: 30px;
  text-transform: uppercase;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #22d3ee; }
  50% { opacity: 0.5; box-shadow: 0 0 16px #22d3ee; }
}

/* Pulsing Orb Glow */
.welcome-orb-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-orb-glow {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.5) 0%, rgba(139, 92, 246, 0.3) 40%, transparent 70%);
  animation: orbGlow 4s ease-in-out infinite alternate;
  filter: blur(20px);
  pointer-events: none;
}

@keyframes orbGlow {
  0%   { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* Animated Gradient Title */
.gradient-text {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #22d3ee 25%, #3b82f6 50%, #a855f7 75%, #22d3ee 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  letter-spacing: -0.5px;
  animation: gradientFlow 6s ease infinite;
}

@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.welcome-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.welcome-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 460px;
  line-height: 1.6;
  opacity: 0.85;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  z-index: 1;
}

.chip {
  background: rgba(10, 25, 48, 0.75);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #f0f9ff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chip:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(139, 92, 246, 0.3));
  border-color: rgba(6, 182, 212, 0.7);
  color: #ffffff;
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 14px rgba(6,182,212,0.45);
  flex-shrink: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--cyan), var(--foam));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sidebar-toggle:hover { color: var(--text-primary); background: var(--glass-light); }

.new-chat-btn {
  margin: 12px 12px 8px;
  padding: 9px 14px;
  background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(8,145,178,0.15));
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.new-chat-btn:hover {
  background: linear-gradient(135deg, rgba(6,182,212,0.35), rgba(8,145,178,0.25));
  border-color: rgba(6,182,212,0.5);
}

.social-action-btn:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
}

/* ========================================= */
/* INPUT ICON BUTTONS (MIC & ATTACHMENT) */
/* ========================================= */
.input-icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.input-icon-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan);
  transform: scale(1.1);
}
.input-icon-btn.recording {
  color: #ef4444;
  animation: pulseMic 1s infinite alternate;
}
@keyframes pulseMic {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.2); opacity: 0.7; }
}

/* ========================================= */
/* ARTIFACT WORKSPACE SIDE PANEL */
/* ========================================= */
.artifact-panel {
  width: 45%;
  min-width: 320px;
  height: 100vh;
  background: var(--navy);
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  animation: slideInRight 0.3s ease-out;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.artifact-header {
  padding: 12px 16px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.artifact-title {
  font-weight: 600;
  color: var(--cyan);
  font-size: 0.95rem;
}
.artifact-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.artifact-btn:hover {
  background: var(--cyan);
  color: #000;
}
.artifact-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 8px 16px 4px;
  flex-shrink: 0;
}

.history-list {
  flex: 1;
  padding: 4px 8px;
  overflow-y: auto;
}

.history-item {
  width: 100%;
  padding: 8px 12px;
  margin: 2px 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item:hover { background: var(--glass-light); color: var(--text-primary); }
.history-item.active {
  background: var(--glass);
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.footer-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.footer-btn:hover { 
  color: #fca5a5; 
  background: rgba(248, 113, 113, 0.1); 
}

.powered-by {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.65;
}

/* ==========================================
   CONTENT WRAPPER
   ========================================== */

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ==========================================
   TOP BAR
   ========================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(4, 12, 28, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(6, 182, 212, 0.22);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  gap: 14px;
  z-index: 10;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
}
.mobile-menu-btn:hover {
  color: var(--cyan);
}

.topbar-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #22d3ee, #a5f3fc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 20, 48, 0.65);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 14px;
  padding: 5px;
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  -webkit-overflow-scrolling: touch;
}

.mode-selector::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}
.mode-selector {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.mode-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mode-btn:hover { 
  color: var(--text-primary); 
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.25);
}
.mode-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3) 0%, rgba(59, 130, 246, 0.25) 100%);
  color: #ffffff;
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

#mode-replica {
  border-color: rgba(168, 85, 247, 0.25);
  color: #c084fc;
}
#mode-replica:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.45);
  color: #f3e8ff;
}
#mode-replica.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(99, 102, 241, 0.3) 100%);
  color: #ffffff;
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

/* ==========================================
   CHAT AREA
   ========================================== */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar { width: 4px; }
.messages-container::-webkit-scrollbar-track { background: transparent; }
.messages-container::-webkit-scrollbar-thumb { background: rgba(6,182,212,0.3); border-radius: 4px; }

/* ==========================================
   WELCOME SCREEN
   ========================================== */

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  padding: 48px 24px;
  gap: 16px;
}

.welcome-icon {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  background: linear-gradient(135deg, #0c3f6e, #0891b2, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  line-height: 1;
  box-shadow: 0 0 50px rgba(6,182,212,0.45), 0 12px 32px rgba(0,0,0,0.5);
  margin-bottom: 8px;
}

.welcome-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 40px 20px;
}

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  text-align: center;
  padding: 20px;
  width: 100%;
}

.welcome-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  background: transparent;
  border: none;
  box-shadow: none;
  max-width: 860px;
  width: 100%;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .suggestion-grid {
    grid-template-columns: 1fr;
  }
}

.suggestion-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(8, 20, 42, 0.6);
  border: 1px solid rgba(0, 210, 255, 0.18);
  border-radius: 14px;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  color: var(--text-primary);
  width: 100%;
}

.suggestion-card:hover {
  background: rgba(14, 32, 64, 0.85);
  border-color: rgba(0, 210, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(0, 210, 255, 0.15);
}

.card-icon, .card-icon-glow {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  transition: all 0.3s ease;
}

.suggestion-card:hover .card-icon-glow,
.suggestion-card:hover .card-icon {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.35);
}

.card-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.card-arrow {
  font-size: 1.1rem;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateX(-6px);
}

.suggestion-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--cyan);
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
  max-width: 560px;
}

.chip {
  padding: 10px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}
.chip:hover {
  background: var(--glass-light);
  border-color: rgba(6,182,212,0.4);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* ==========================================
   MESSAGES
   ========================================== */

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

.message-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeSlideIn 0.3s ease both;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 800px;
}

.message.user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.message.ai {
  align-self: flex-start;
}

.msg-time,
.msg-meta {
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  color: var(--text-dim) !important;
  opacity: 0.65 !important;
  margin-top: 4px !important;
  padding-left: 4px !important;
  letter-spacing: 0.2px;
  line-height: 1 !important;
}

.avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 17px;
  flex-shrink: 0;
}

/* ========================================= */
/* MARKDOWN & CODE BLOCKS */
/* ========================================= */
.markdown-body { line-height: 1.6; }
.markdown-body p { margin-bottom: 12px; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { margin: 10px 0 10px 20px; }
.markdown-body code { font-family: Consolas, Monaco, monospace; background: rgba(0, 0, 0, 0.3); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

.ai-image-wrapper {
    margin: 16px 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.ai-generated-image {
    width: 100%;
    max-width: 680px;
    height: auto;
    border-radius: 12px;
    display: block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(0, 242, 254, 0.25);
    background: #111b24;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.ai-generated-image:hover {
    transform: scale(1.015);
    border-color: rgba(0, 242, 254, 0.6);
}

.code-block-wrapper {
    margin: 16px 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #282c34;
    border: 1px solid var(--glass-border);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.code-lang {
    font-size: 0.75rem;
    color: #abb2bf;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.copy-btn {
    background: none;
    border: none;
    color: #abb2bf;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.copy-btn.copied {
    color: #4ade80;
}

.code-block-wrapper pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-size: 0.9rem;
}

.code-block-wrapper pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.user-avatar {
  background: linear-gradient(135deg, rgba(6,182,212,0.35), rgba(8,145,178,0.25));
  border: 1px solid rgba(6,182,212,0.3);
}

.ai-avatar {
  background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(8,145,178,0.15));
  border: 1px solid rgba(6,182,212,0.2);
}

.msg-content {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.6;
  font-size: 16px;
  max-width: 75%;
  padding: 12px 18px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .msg-content {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.35);
}

.message.ai .msg-content {
  background: radial-gradient(circle at top left, rgba(6, 182, 212, 0.12), rgba(14, 30, 60, 0.8) 80%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.msg-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 44px;
  opacity: 0.7;
}

.message.user + .msg-meta,
.message-group .msg-meta {
  text-align: left;
}

/* ==========================================
   TYPING INDICATOR
   ========================================== */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeSlideIn 0.25s ease both;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(14, 30, 60, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 16px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ==========================================
   IMAGE / VIDEO
   ========================================== */

.generated-image-wrapper {
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  max-width: 400px;
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}
.generated-image-wrapper:hover { transform: scale(1.01); border-color: rgba(6,182,212,0.4); }
.generated-image-wrapper img { width: 100%; display: block; }

.image-caption {
  font-size: 11px;
  color: var(--text-dim);
  padding: 6px 10px;
  background: rgba(6,20,48,0.6);
  text-align: center;
}

/* ==========================================
   INPUT AREA
   ========================================== */

.input-area {
  padding: 16px 24px 20px;
  background: rgba(4, 9, 20, 0.85);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(6, 182, 212, 0.25);
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: rgba(8, 22, 45, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 18px;
  padding: 10px 14px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
}
.input-wrapper:focus-within {
  border-color: #06b6d4;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.4), 0 0 50px rgba(139, 92, 246, 0.25);
  transform: translateY(-2px);
}

#messageInput {
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  max-height: 160px;
  overflow-y: auto;
  outline: none;
  padding: 4px 0;
}

#messageInput::placeholder { color: var(--text-dim); }

.send-btn {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 12px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4), 0 0 20px rgba(139, 92, 246, 0.2);
  flex-shrink: 0;
}
.send-btn:hover { 
  transform: scale(1.08) translateY(-1px); 
  box-shadow: 0 6px 25px rgba(6, 182, 212, 0.6), 0 0 30px rgba(139, 92, 246, 0.4); 
  background-position: 100% 0;
}
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.input-hint {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
  opacity: 0.6;
}

/* ==========================================
   LIGHTBOX
   ========================================== */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 10000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 40px 14px;
}
.lightbox.open {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.lightbox-content {
  position: relative;
  max-width: 94vw;
  margin: auto !important;
  flex-shrink: 0;
}



/* ========================================= */
/* MARKDOWN & CODE BLOCKS */
/* ========================================= */
.markdown-body { line-height: 1.6; }
.markdown-body p { margin-bottom: 12px; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { margin: 10px 0 10px 20px; }
.markdown-body code { font-family: Consolas, Monaco, monospace; background: rgba(0, 0, 0, 0.3); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

think {
    display: block;
    margin: 15px 0;
    padding: 12px 16px;
    border-left: 3px solid #00d2ff;
    background: rgba(0, 210, 255, 0.05);
    border-radius: 0 8px 8px 0;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-style: italic;
}
think::before {
    content: "🧠 Thought Process:";
    display: block;
    font-style: normal;
    font-weight: 600;
    margin-bottom: 8px;
    color: #00d2ff;
    font-size: 1.1em;
}

.code-block-wrapper { margin: 16px 0; border-radius: var(--radius); overflow: hidden; background: #282c34; border: 1px solid var(--glass-border); }
.code-block-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; background: rgba(0,0,0,0.3); border-bottom: 1px solid rgba(255,255,255,0.1); }
.code-lang { font-size: 0.75rem; color: #abb2bf; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.copy-btn { background: none; border: none; color: #abb2bf; cursor: pointer; font-size: 0.8rem; padding: 4px 8px; border-radius: 4px; transition: all 0.2s; }
.copy-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.copy-btn.copied { color: #4ade80; }
.code-block-wrapper pre { margin: 0; padding: 16px; overflow-x: auto; font-size: 0.9rem; }
.code-block-wrapper pre code { background: transparent; padding: 0; border-radius: 0; }

/* Authentication Modal */
.auth-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-container {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#auth-title {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#auth-subtitle {
    color: #94a3b8;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

#auth-form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

#auth-form input:focus {
    outline: none;
    border-color: #00f2fe;
}

#auth-submit-btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

#auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.auth-error {
    color: #ff4757;
    font-size: 0.85rem;
    margin-bottom: 15px;
    min-height: 20px;
}

.auth-toggle {
    margin-top: 25px;
    font-size: 0.9rem;
    color: #94a3b8;
}

.auth-toggle a {
    color: #00f2fe;
    text-decoration: none;
    margin-left: 5px;
    font-weight: 500;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

/* ========================================= */
/* BLUE SEA CHESS TRAINER                    */
/* ========================================= */
.chess-container {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
    background: var(--bg-primary);
    overflow: hidden;
}

.chess-sidebar-left {
    flex: 0 0 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.chess-brand h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--cyan);
}
.chess-brand p {
    margin: 5px 0 20px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chess-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.chess-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    font-weight: 500;
}

.chess-menu-btn:hover {
    background: rgba(255,255,255,0.05);
}

.chess-menu-btn.active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
    border-left: 3px solid var(--cyan);
}

.chess-subpanel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chess-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at center, rgba(14,30,60,0.8) 0%, var(--bg-primary) 100%);
}

.board-wrapper {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1/1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 4px;
    overflow: hidden;
}

.board-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.board-actions button {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
}
.board-actions button:hover {
    background: rgba(255,255,255,0.1);
}

.chess-sidebar-right {
    flex: 0 0 300px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.chess-info h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-box {
    background: var(--glass);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    margin-bottom: 20px;
    font-weight: 500;
}

.eval-bar-container {
    width: 100%;
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}
.eval-fill {
    height: 100%;
    background: var(--cyan);
    width: 50%;
    transition: width 0.3s ease;
}
.eval-text {
    font-family: monospace;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.engine-thoughts {
    background: #000;
    color: #0f0;
    font-family: monospace;
    font-size: 11px;
    padding: 5px;
    border-radius: var(--radius-sm);
    height: 150px;
    overflow-y: auto;
    word-break: break-all;
}

.annotation-badge {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 20;
    transform: translate(50%, -50%);
}
.badge-brilliant { background-color: #1baca6; }
.badge-great { background-color: #5c8bb0; }
.badge-good { background-color: #96bc4b; }
.badge-inaccuracy { background-color: #f3ae16; }
.badge-mistake { background-color: #e58f2a; }
.badge-blunder { background-color: #ca3431; }

@media (max-width: 900px) {
    .chess-container {
        flex-direction: column;
        overflow-y: auto;
    }
    .chess-sidebar-left, .chess-sidebar-right {
        flex: auto;
        border: none;
        padding: 5px;
    }
    .chess-center {
        padding: 5px;
    }
    .chess-menu {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    .chess-menu-btn {
        flex: 0 0 auto;
        border-left: none !important;
        border-bottom: 3px solid transparent;
        border-radius: 0;
    }
    .chess-menu-btn.active {
        border-bottom: 3px solid var(--cyan);
        background: transparent;
    }
}




@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease;
        background: rgba(10, 25, 47, 0.95);
        backdrop-filter: blur(10px);
        border-right: 1px solid var(--glass-border);
    }
    .sidebar.active {
        left: 0;
    }
    .mobile-menu-btn {
        display: block !important;
    }
    .topbar {
        padding: 5px;
        min-height: 40px;
    }
    .topbar-title {
        font-size: 1rem;
    }
    .mode-selector {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }
    .mode-btn {
        flex: 0 0 auto;
        font-size: 11px;
        padding: 4px 8px;
        margin-right: 5px;
    }
    .input-area {
        padding: 5px;
        min-height: 50px;
    }
    #userInput {
        font-size: 14px;
        padding: 8px;
    }
    .send-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    .message {
        max-width: 98%;
        padding: 8px 12px;
        font-size: 13px;
    }
    .avatar {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
}


@media (max-width: 768px) {
    .music-player-widget {
        bottom: 80px !important;
        right: 5% !important;
        left: 5% !important;
        width: 90% !important;
    }
    .music-content iframe {
        width: 100% !important;
    }
}

/* ==========================================
   CODE BLOCK STYLING
   ========================================== */
.code-block-wrapper {
    position: relative;
    background: #1e1e1e;
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(6,182,212,0.2));
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
    padding: 6px 12px;
    font-size: 12px;
    color: #a3a3a3;
    border-bottom: 1px solid #444;
}

.code-lang {
    text-transform: uppercase;
    font-weight: 600;
}

.copy-btn {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #444;
    color: #fff;
}

.copy-btn.copied {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.code-block-wrapper pre {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
}

.code-block-wrapper code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* ==========================================
   SOCIAL HUB UI
   ========================================== */
.social-modal-content {
    background: linear-gradient(145deg, var(--sidebar-bg), var(--navy));
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(6, 182, 212, 0.05);
    max-width: 480px;
    width: 90%;
    padding: 30px;
}

.social-header h2 {
    font-size: 1.6rem;
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
    text-align: center;
}

.social-header p {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.social-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.social-search-bar input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(6, 13, 26, 0.6);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.social-search-bar input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
}

.social-search-btn {
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.social-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
    padding-bottom: 8px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-list {
    margin-bottom: 25px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.social-list::-webkit-scrollbar {
    width: 6px;
}
.social-list::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.3);
    border-radius: 10px;
}

.empty-list {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 15px 0;
}

.social-user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(14, 52, 96, 0.3);
    border: 1px solid rgba(6, 182, 212, 0.1);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.social-user-card:hover {
    background: rgba(14, 52, 96, 0.5);
}

.social-user-card span {
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-action-btn {
    background: var(--glass-light);
    color: var(--cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.social-action-btn:hover {
    background: var(--cyan);
    color: white;
}

/* ==========================================
   BLUE SEA STUDIO HERO & CRAFT CARDS
   ========================================== */

/* ==========================================
   WELCOME SCREEN & HERO SECTION
   ========================================== */
.welcome-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 24px 16px;
  animation: fadeIn 0.4s ease;
}

.welcome-hero-card {
  max-width: 740px;
  width: 100%;
  text-align: center;
  padding: 42px 36px;
  background: rgba(8, 22, 45, 0.75);
  border: 1.5px solid rgba(0, 210, 255, 0.25);
  border-radius: 28px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 45px rgba(0, 210, 255, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.12);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-orb-container {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-orb-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.4), rgba(59, 130, 246, 0.3));
  filter: blur(14px);
  animation: pulseGlow 3s infinite ease-in-out;
}

.welcome-icon {
  position: relative;
  z-index: 2;
  width: 58px;
  height: 58px;
  background: rgba(10, 25, 47, 0.9);
  border: 1.5px solid rgba(0, 210, 255, 0.5);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 210, 255, 0.3);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 24px;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.35);
  color: #00d2ff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.18);
}

.live-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00d2ff;
  box-shadow: 0 0 8px #00d2ff;
  animation: pulseGlow 1.5s infinite;
}

.welcome-title {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0 0 12px 0;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 25%, #7dd3fc 60%, #00d2ff 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 14px rgba(0, 210, 255, 0.35));
}

#typewriterWord {
  background: linear-gradient(135deg, #00d2ff 0%, #38bdf8 50%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  filter: drop-shadow(0 0 16px rgba(0, 210, 255, 0.6));
}

.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1.15em;
  background: #00d2ff;
  vertical-align: -2px;
  margin-left: 2px;
  border-radius: 2px;
  box-shadow: 0 0 10px #00d2ff;
  animation: blinkCursor 0.9s infinite;
}

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

.welcome-subtitle {
  font-size: 1.02rem;
  color: var(--text-secondary, #94a3b8);
  margin: 0 auto 20px;
  max-width: 560px;
  line-height: 1.5;
  font-weight: 400;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 22px 0 18px;
  flex-wrap: wrap;
}

.cat-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary, #94a3b8);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cat-tab:hover {
  background: rgba(0, 210, 255, 0.12);
  border-color: rgba(0, 210, 255, 0.35);
  color: #00d2ff;
  transform: translateY(-1px);
}

.cat-tab.active {
  background: rgba(0, 210, 255, 0.22);
  border-color: #00d2ff;
  color: #00d2ff;
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.25);
}

/* Suggestion Grid */
.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  text-align: left;
  margin-top: 14px;
}

.suggestion-card {
  background: rgba(10, 25, 47, 0.7);
  border: 1px solid rgba(0, 210, 255, 0.18);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.suggestion-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.08), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.suggestion-card:hover {
  background: rgba(13, 33, 62, 0.85);
  border-color: rgba(0, 210, 255, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 22px rgba(0, 210, 255, 0.25);
}

.suggestion-card:hover::before {
  opacity: 1;
}

.card-icon-glow {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00d2ff;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.suggestion-card:hover .card-icon-glow {
  background: rgba(0, 210, 255, 0.25);
  border-color: #00d2ff;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.4);
  transform: scale(1.08);
}

.card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.suggestion-card:hover .card-title {
  color: #00d2ff;
}

.card-desc {
  font-size: 0.79rem;
  color: var(--text-dim, #94a3b8);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-arrow {
  color: var(--text-dim, #64748b);
  font-size: 1.1rem;
  font-weight: 700;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.suggestion-card:hover .card-arrow {
  color: #00d2ff;
  transform: translateX(4px);
}


/* ==========================================
   MESSAGE REACTIONS (👍 / 👎)
   ========================================== */
.reaction-bar {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  margin-left: 46px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.message-group:hover .reaction-bar,
.msg-group:hover .reaction-bar {
  opacity: 1;
}
.reaction-btn {
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}
.reaction-btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.05); }
.reaction-btn.reacted-up { background: rgba(0,210,255,0.15); border-color: var(--cyan); color: var(--cyan); }
.reaction-btn.reacted-down { background: rgba(248,113,113,0.15); border-color: #f87171; color: #f87171; }

/* ==========================================
   THEME TOGGLE BUTTON
   ========================================== */
.theme-toggle-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.theme-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--glass-hover);
}

/* ==========================================
   CHAT HISTORY SESSION CARDS
   ========================================== */
.history-item {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  overflow: hidden;
}
.history-item:hover { background: var(--glass-hover); color: var(--text-primary); }
.history-item.active { background: rgba(0,210,255,0.12); color: var(--cyan); border-left: 2px solid var(--cyan); }
.history-item-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.history-item-date {
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.history-item-del {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: var(--transition);
  flex-shrink: 0;
}
.history-item:hover .history-item-del { opacity: 1; }
.history-item-del:hover { color: #f87171; background: rgba(248,113,113,0.15); }

/* ==========================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8,18,37,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}
.mobile-bottom-nav .mob-btn {
  flex: 1;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: var(--font);
}
.mobile-bottom-nav .mob-btn .mob-icon { font-size: 17px; }
.mobile-bottom-nav .mob-btn:hover,
.mobile-bottom-nav .mob-btn.active {
  background: rgba(0,210,255,0.12);
  border-color: var(--glass-border);
  color: var(--cyan);
}
.mobile-bottom-nav .mob-btn.mob-new {
  background: rgba(0,210,255,0.15);
  border-color: var(--glass-border);
  color: var(--cyan);
}
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  .chat-area { padding-bottom: 80px; }
  .input-area { bottom: 70px; }
}

/* ==========================================
   USAGE DASHBOARD MODAL
   ========================================== */
.stats-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
.stats-modal-overlay.open { display: flex; }
.stats-modal {
  background: linear-gradient(135deg, rgba(8,18,37,0.97) 0%, rgba(4,9,20,0.97) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow);
  position: relative;
}
.stats-modal h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* COLLAPSIBLE THINKING BLOCK (ANTHROPIC / CLAUDE 3.7 & DEEPSEEK STYLE) */
.thinking-block {
  background: rgba(8, 20, 42, 0.75);
  border: 1px solid rgba(0, 210, 255, 0.22);
  border-left: 3px solid #00d2ff;
  border-radius: 12px;
  margin: 12px 0 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.thinking-block:hover {
  border-color: rgba(0, 210, 255, 0.4);
  box-shadow: 0 6px 28px rgba(0, 210, 255, 0.15);
}

.thinking-block summary {
  padding: 10px 15px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #00d2ff;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  outline: none;
  background: rgba(0, 210, 255, 0.04);
  transition: background 0.2s ease;
}

.thinking-block summary:hover {
  background: rgba(0, 210, 255, 0.09);
  color: #7dd3fc;
}

.thinking-brain-icon {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.thinking-pulse {
  animation: thinkingBrainPulse 1.4s ease-in-out infinite alternate;
}

@keyframes thinkingBrainPulse {
  0% { transform: scale(0.95); opacity: 0.7; filter: drop-shadow(0 0 2px #00d2ff); }
  100% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 8px #00d2ff); }
}

.thinking-tag {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(0, 210, 255, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(0, 210, 255, 0.25);
}

.thinking-tag-live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
  animation: thinkingLiveGlow 1.5s infinite alternate;
}

@keyframes thinkingLiveGlow {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.thinking-content {
  padding: 12px 18px;
  border-top: 1px solid rgba(0, 210, 255, 0.12);
  color: #94a3b8;
  font-size: 0.86rem;
  line-height: 1.65;
  white-space: pre-wrap;
  font-style: italic;
  background: rgba(3, 10, 24, 0.45);
}

/* WEB SEARCH FILTER TOGGLE BUTTON */
.search-toggle-btn {
  font-size: 0.76rem !important;
  font-weight: 600;
  padding: 5px 12px !important;
  border-radius: 20px !important;
  background: rgba(6, 182, 212, 0.18) !important;
  color: var(--cyan) !important;
  border: 1px solid rgba(6, 182, 212, 0.45) !important;
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.search-toggle-btn:hover {
  background: rgba(6, 182, 212, 0.28) !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.search-toggle-btn.off {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-dim) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  opacity: 0.65;
}

.stats-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}
.stats-close-btn:hover { color: var(--text-primary); background: var(--glass-hover); }

/* ==========================================
   IMAGE PREVIEW THUMBNAIL
   ========================================== */
#imagePreviewBar {
  display: none;
  padding: 8px 12px;
  background: rgba(0,210,255,0.08);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  margin-bottom: 8px;
  align-items: center;
  gap: 10px;
}
#imagePreviewThumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--glass-border);
}
#imagePreviewLabel {
  flex: 1;
  font-size: 12px;
  color: var(--cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================
   USER IMAGE IN CHAT (vision messages)
   ========================================== */
.user-image-preview {
  max-width: 240px;
  max-height: 180px;
  border-radius: 12px;
  object-fit: cover;
  margin-top: 6px;
  border: 1px solid var(--glass-border);
  display: block;
}

/* ==========================================
   MARKDOWN & SEARCH IMAGES IN AI MESSAGES
   ========================================== */
.chat-embedded-img,
.msg-content img,
.markdown-body img {
  max-width: 100%;
  max-height: 420px;
  border-radius: 12px;
  margin: 12px 0;
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  display: block;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.chat-embedded-img:hover,
.msg-content img:hover,
.markdown-body img:hover {
  opacity: 0.92;
}

/* STREAMING TYPEWRITER CURSOR */
.typing-cursor {
  display: inline-block;
  color: var(--cyan);
  font-weight: 700;
  margin-left: 2px;
  animation: blinkCursor 0.75s infinite;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

/* ==========================================
   CHATGPT-STYLE VOICE MODE & SELECTION MODAL
   ========================================== */
.voice-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 350;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
}
.voice-modal-overlay.open { display: flex; }

.voice-modal-card {
  background: #171719;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 36px 28px 24px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.voice-close-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: var(--transition);
}
.voice-close-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }

/* FLUID ANIMATED GLOWING ORB */
.voice-orb-container {
  width: 180px;
  height: 180px;
  margin: 10px 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.voice-orb {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e0f2fe 0%, #38bdf8 35%, #6366f1 70%, #312e81 100%);
  box-shadow: 0 0 45px rgba(56, 189, 248, 0.5), inset 0 0 25px rgba(255, 255, 255, 0.6);
  position: relative;
  animation: orbFloat 4s ease-in-out infinite alternate, orbFluid 8s ease-in-out infinite;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.voice-orb:hover {
  transform: scale(1.05);
  box-shadow: 0 0 60px rgba(56, 189, 248, 0.7), inset 0 0 35px rgba(255, 255, 255, 0.8);
}
.voice-orb.speaking {
  animation: orbPulse 1.2s ease-in-out infinite alternate, orbFluid 4s linear infinite;
  box-shadow: 0 0 80px rgba(99, 102, 241, 0.85), inset 0 0 40px rgba(255, 255, 255, 0.9);
}

@keyframes orbFloat {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-8px) scale(1.03); }
}

@keyframes orbFluid {
  0% { background-position: 0% 50%; filter: hue-rotate(0deg); }
  50% { background-position: 100% 50%; filter: hue-rotate(40deg); }
  100% { background-position: 0% 50%; filter: hue-rotate(0deg); }
}

@keyframes orbPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

/* CAROUSEL & VOICE DETAILS */
.voice-carousel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
}
.carousel-arrow {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 50%;
  transition: var(--transition);
  user-select: none;
}
.carousel-arrow:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }

.voice-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.voice-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}
.voice-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

/* PAGINATION DOTS */
.voice-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.voice-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: var(--transition);
}
.voice-dot.active {
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  transform: scale(1.25);
}

/* BOTTOM BAR */
.voice-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.voice-lang-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}
.voice-lang-picker select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 4px 8px;
  color: #ffffff;
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
}
.voice-select-btn {
  background: #ffffff;
  color: #0d0d0d;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.voice-select-btn:hover {
  background: #f0f0f0;
  transform: scale(1.03);
}

/* LIVE VOICE MODE OVERLAY (CHATGPT STYLE) */
.voice-live-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #0d0d0d;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}
.voice-live-overlay.open { display: flex; }

.voice-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.voice-live-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}
.voice-live-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 50%;
  transition: var(--transition);
}
.voice-live-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.voice-live-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}
.live-orb {
  width: 220px;
  height: 220px;
  margin-bottom: 24px;
}
.voice-live-status {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.voice-live-footer {
  display: flex;
  justify-content: center;
  padding-bottom: 12px;
}
.voice-pill-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.pill-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 20px;
  transition: var(--transition);
}
.pill-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.pill-btn.mic-pill {
  background: rgba(255, 255, 255, 0.15);
  font-size: 1.2rem;
  padding: 8px 12px;
}
.pill-btn.mic-pill.recording {
  background: rgba(239, 68, 68, 0.3);
  color: #f87171;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}
.pill-btn.close-pill {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  padding: 8px 12px;
  font-size: 1rem;
}


/* ==========================================
   PREMIUM UPGRADE ADDITIONS — v5.0
   ========================================== */

/* --- Message Entry Animation --- */
@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.msg, .message, .msg-group, .message-group {
  animation: messageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* --- AI Thinking Dots --- */
@keyframes thinkingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-8px); opacity: 1; }
}
.thinking-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 0;
}
.thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
  animation: thinkingBounce 1.4s ease-in-out infinite both;
}
.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.thinking-dots span:nth-child(3) { animation-delay: 0s; }

/* --- Gradient Shimmer New-Chat Button --- */
@keyframes shimmerSlide {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.new-chat-btn {
  background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(8,145,178,0.15));
  border: 1px solid rgba(6,182,212,0.3);
  position: relative;
  overflow: hidden;
}
.new-chat-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.3s;
}
.new-chat-btn:hover::after {
  opacity: 1;
  animation: shimmerSlide 0.8s ease forwards;
}

/* --- Live Status Ping --- */
@keyframes statusPing {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.live-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  animation: statusPing 2s ease-out infinite;
  flex-shrink: 0;
}

/* --- Orb Float (Mobile) --- */
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-6px) scale(1.03); }
}

/* --- AI Streaming Progress Bar --- */
.topbar-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4, #3b82f6, #8b5cf6, #06b6d4);
  background-size: 200% 100%;
  border-radius: 0 2px 2px 0;
  transition: width 0.4s ease;
  animation: progressShimmer 2s linear infinite;
  opacity: 0;
}
.topbar-progress.active {
  opacity: 1;
  width: 85%;
}
.topbar-progress.done {
  width: 100%;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.4s ease 0.3s;
}
@keyframes progressShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.topbar { position: relative; }

/* --- User Avatar Chip --- */
.user-avatar-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.45);
  border: 1.5px solid rgba(6, 182, 212, 0.5);
  transition: var(--transition);
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-avatar-chip:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.7);
}

/* --- Char Counter --- */
.char-counter {
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
  padding: 2px 4px 0;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  flex-shrink: 0;
}
.char-counter.visible { opacity: 1; }
.char-counter.warn { color: #f97316; }
.char-counter.danger { color: #ef4444; }

/* --- Slash Command Palette --- */
.slash-palette {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  right: 0;
  background: rgba(5, 13, 35, 0.97);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(6,182,212,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 12px;
  z-index: 200;
  display: none;
  overflow: hidden;
}
.slash-palette.open { display: block; animation: slashIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes slashIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.slash-palette-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #22d3ee;
  text-transform: uppercase;
  padding: 2px 8px 10px;
  border-bottom: 1px solid rgba(6,182,212,0.15);
  margin-bottom: 8px;
}
.slash-palette-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.slash-cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font);
}
.slash-cmd:hover, .slash-cmd.selected {
  background: rgba(6, 182, 212, 0.13);
  transform: translateX(2px);
}
.slash-cmd:active { transform: scale(0.98); }
.slash-cmd-icon {
  font-size: 16px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.slash-cmd-name {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.2;
}
.slash-cmd-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
  line-height: 1.2;
}


/* --- Sidebar Search --- */
.sidebar-search {
  margin: 0 10px 6px;
  position: relative;
  flex-shrink: 0;
}
.sidebar-search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.sidebar-search input:focus {
  border-color: rgba(6, 182, 212, 0.5);
  background: rgba(6, 182, 212, 0.1);
}
.sidebar-search input::placeholder { color: var(--text-dim); }
.sidebar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-dim);
  pointer-events: none;
}

/* --- Mode Btn Active Glow Pulse --- */
@keyframes modePulse {
  0%, 100% { box-shadow: 0 0 16px rgba(6, 182, 212, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2); }
  50%       { box-shadow: 0 0 28px rgba(6, 182, 212, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.25); }
}
.mode-btn.active {
  animation: modePulse 2.5s ease-in-out infinite;
}

/* --- Active History Item Border --- */
.history-item.active {
  border-left: 2px solid var(--cyan);
  padding-left: 10px;
  background: rgba(6, 182, 212, 0.08);
}

/* --- Mobile Upgraded Suggestion Cards --- */
.mobile-suggestion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}
.mobile-suggestion-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 12px;
  background: rgba(8, 22, 45, 0.75);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 16px;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-primary);
  text-align: left;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  -webkit-tap-highlight-color: transparent;
}
.mobile-suggestion-card:hover, .mobile-suggestion-card:active {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.55);
  transform: scale(0.97);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.25);
}
.mobile-card-icon {
  font-size: 22px;
}
.mobile-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #f0f9ff;
}
.mobile-card-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* --- Mobile Bottom Nav Upgraded --- */
.mobile-bottom-nav {
  background: rgba(4, 9, 20, 0.9);
  border-top: 1px solid rgba(6, 182, 212, 0.2);
  backdrop-filter: blur(20px);
}
.mob-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}
.mob-btn:active { transform: scale(0.9); }
.mob-btn.active .mob-icon {
  filter: drop-shadow(0 0 8px var(--cyan));
}
.mob-btn.active span:not(.mob-icon) {
  color: var(--cyan);
}

/* --- Mobile Welcome Orb --- */
.mobile-welcome-orb-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.mobile-welcome-orb-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.5) 0%, rgba(139, 92, 246, 0.3) 50%, transparent 70%);
  filter: blur(18px);
  animation: orbGlow 4s ease-in-out infinite alternate;
  pointer-events: none;
}
.mobile-welcome-icon {
  font-size: 52px;
  line-height: 1;
  animation: orbFloat 5s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

/* --- Typewriter Cursor --- */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--cyan);
  margin-left: 2px;
  vertical-align: middle;
  animation: cursorBlink 0.8s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- Send Button Ripple --- */
.send-btn {
  position: relative;
  overflow: hidden;
}
.send-btn::after {
  content: '';
  position: absolute;
  inset: 50%;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s, opacity 0.5s;
  opacity: 0;
}
.send-btn:active::after {
  transform: translate(-50%, -50%) scale(3);
  opacity: 0;
  transition: 0s;
}

/* --- Sidebar Profile Block --- */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 8px 8px 4px;
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 12px;
  flex-shrink: 0;
}
.sidebar-profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}
.sidebar-profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-profile-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-role {
  font-size: 11px;
  color: var(--text-dim);
}
.sidebar-pro-badge {
  font-size: 10px;
  font-weight: 800;
  color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ==========================================
   AI GENERATED IMAGE — HIGH QUALITY DISPLAY
   ========================================== */

.ai-image-wrapper {
  margin: 12px 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.12);
  position: relative;
  background: rgba(8, 22, 45, 0.6);
  max-width: 100%;
  display: block;
}

.ai-image-wrapper::before {
  content: '\01F5BC\uFE0F  AI Generated';
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #22d3ee;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(6, 182, 212, 0.35);
  z-index: 2;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.ai-generated-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  /* Force high-quality rendering — no pixelation */
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  /* Loading reveal animation */
  animation: imageReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  cursor: zoom-in;
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}
.ai-generated-image:hover {
  transform: scale(1.008);
  filter: brightness(1.06) saturate(1.12) contrast(1.02);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.2);
}

@keyframes imageReveal {
  from {
    opacity: 0;
    filter: blur(10px) saturate(0.4);
    transform: scale(0.97) translateZ(0);
  }
  to {
    opacity: 1;
    filter: blur(0) saturate(1);
    transform: scale(1) translateZ(0);
  }
}

/* ==========================================
   CHATGPT-STYLE FLUID VOICE ORB STYLING
   ========================================== */
.voice-orb-container, .voice-live-center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}
.voice-orb {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #00f2fe 0%, #4facfe 50%, #08162e 100%);
    position: relative;
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.4);
    animation: orbPulse 3s ease-in-out infinite alternate;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.voice-orb:hover {
    transform: scale(1.08);
}
.voice-orb-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,242,254,0.4) 0%, rgba(79,172,254,0) 70%);
    animation: orbGlow 2s ease-in-out infinite alternate;
    pointer-events: none;
}
.voice-orb-inner {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 60%);
}

@keyframes orbPulse {
    0% { transform: scale(1) rotate(0deg); filter: hue-rotate(0deg); }
    50% { transform: scale(1.06) rotate(180deg); filter: hue-rotate(45deg); }
    100% { transform: scale(1) rotate(360deg); filter: hue-rotate(0deg); }
}

@keyframes orbGlow {
    0% { opacity: 0.5; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1.15); }
}

/* ==========================================
   PERPLEXITY-STYLE CITATIONS & RELATED PILLS
   ========================================== */
.citation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(0, 210, 255, 0.2);
    border: 1px solid rgba(0, 210, 255, 0.4);
    color: #00d2ff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    margin: 0 3px;
    vertical-align: super;
    cursor: pointer;
    transition: all 0.2s ease;
}
.citation-badge:hover {
    background: #00d2ff;
    color: #08162e;
    transform: scale(1.15);
}

.perplexity-related-box {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.related-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim, #8899aa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.related-pills {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.related-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    background: rgba(0, 210, 255, 0.06);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary, #e2e8f0);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.related-btn:hover {
    background: rgba(0, 210, 255, 0.15);
    border-color: rgba(0, 210, 255, 0.4);
    transform: translateX(4px);
}
.related-btn::after {
    content: "＋";
    color: #00d2ff;
    font-weight: bold;
}

/* =========================================
   OFFLINE BANNER & 3D CYBER SHOOTER STYLES
   ========================================= */

.offline-banner {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
    border-radius: 30px;
    padding: 10px 22px;
    animation: slideDown 0.4s ease-out;
}

.offline-banner-content {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
}

.offline-game-btn {
    background: #ffffff;
    color: #b91c1c;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
}

.offline-game-btn:hover {
    transform: scale(1.05);
    background: #fef2f2;
}

.shooter-game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background: rgba(4, 10, 20, 0.92);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.shooter-game-container {
    width: 95vw;
    max-width: 1100px;
    height: 85vh;
    max-height: 700px;
    background: #030712;
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 18px;
    box-shadow: 0 0 50px rgba(0, 210, 255, 0.25), inset 0 0 30px rgba(0, 210, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.shooter-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(0, 210, 255, 0.2);
}

.shooter-logo {
    font-weight: 800;
    font-size: 1.05rem;
    background: linear-gradient(135deg, #00d2ff, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

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

.shooter-controls-hint {
    font-size: 0.8rem;
    color: #94a3b8;
}

.shooter-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.shooter-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: scale(1.1);
}

.shooter-canvas-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    cursor: crosshair;
}

#shooterCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.shooter-gameover-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.shooter-gameover-box {
    background: #0b1528;
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
    border-radius: 18px;
    padding: 30px 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: scaleUp 0.3s ease;
}

.gameover-title {
    color: #ef4444;
    font-size: 1.6rem;
    margin: 0 0 8px 0;
    font-weight: 800;
}

.gameover-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0 0 20px 0;
}

.gameover-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #00d2ff;
}

.gameover-actions {
    display: flex;
    gap: 12px;
}

.gameover-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.gameover-btn.primary {
    background: linear-gradient(135deg, #00d2ff, #3b82f6);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.gameover-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

.gameover-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.gameover-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

@keyframes slideDown {
    from { transform: translate(-50%, -40px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================
   AUTHENTICATION & ACCOUNT MODAL STYLES
   ========================================== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 10, 24, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: rgba(8, 22, 45, 0.9);
    border: 1px solid rgba(0, 210, 255, 0.25);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 210, 255, 0.15);
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-close-btn {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-dim, #94a3b8);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}
.auth-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-logo {
    display: inline-flex;
    padding: 10px;
    background: rgba(0, 210, 255, 0.1);
    border-radius: 14px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    margin-bottom: 12px;
}
.auth-header h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px 0;
}
.auth-header p {
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0;
}

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    gap: 4px;
}
.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 9px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.auth-tab.active {
    background: rgba(0, 210, 255, 0.2);
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.4);
}

.auth-input-group {
    margin-bottom: 16px;
    text-align: left;
}
.auth-input-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #cbd5e1);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.auth-input-group input {
    width: 100%;
    background: rgba(3, 10, 24, 0.7);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.auth-input-group input:focus {
    border-color: #00d2ff;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-size: 0.85rem;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: left;
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #00d2ff, #3b82f6);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}
.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

.auth-guest-btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.auth-guest-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ==========================================
   3D CYBER SHOOTER & SPACECRAFT COMBAT STYLES
   ========================================== */
.shooter-game-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 8, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.25s ease;
}

.shooter-game-container {
    width: 100%;
    max-width: 980px;
    background: rgba(6, 18, 40, 0.95);
    border: 1.5px solid rgba(0, 210, 255, 0.4);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 50px rgba(0, 210, 255, 0.25);
    display: flex;
    flex-direction: column;
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.shooter-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(3, 10, 24, 0.85);
    border-bottom: 1px solid rgba(0, 210, 255, 0.2);
    gap: 12px;
    flex-wrap: wrap;
}

.shooter-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.shooter-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid rgba(0, 210, 255, 0.4);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #00d2ff;
    letter-spacing: 0.06em;
}

.shooter-pulse-dot {
    width: 7px;
    height: 7px;
    background: #00d2ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #00d2ff;
    animation: pulseGlow 1.5s infinite;
}

.shooter-logo {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.04em;
}

.shooter-target-types {
    display: flex;
    gap: 6px;
}

.target-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}
.target-tag.delta {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}
.target-tag.interceptor {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fbbf24;
}
.target-tag.dreadnought {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}

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

.shooter-controls-hint {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    font-family: monospace;
}

.shooter-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.shooter-close-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ef4444;
    transform: scale(1.05);
}

.shooter-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 560px;
    background: #020617;
    overflow: hidden;
}

#shooterCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.shooter-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: rgba(3, 10, 24, 0.9);
    border-top: 1px solid rgba(0, 210, 255, 0.15);
    font-size: 12px;
    color: var(--text-dim, #64748b);
    flex-wrap: wrap;
    gap: 8px;
}
.shooter-footer-info strong {
    color: var(--cyan, #00d2ff);
}

/* Game Over Modal */
.shooter-gameover-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 18, 0.88);
    backdrop-filter: blur(14px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.shooter-gameover-box {
    width: 100%;
    max-width: 440px;
    background: rgba(8, 20, 42, 0.95);
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 20px;
    padding: 32px 28px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(239, 68, 68, 0.2);
    animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   LIVE CODE RUNNER & DATA CHARTS
   ========================================= */

.code-block-wrapper {
    margin: 14px 0;
    border-radius: 12px;
    border: 1px solid rgba(0, 210, 255, 0.25);
    background: #081220;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 14px;
    background: rgba(0, 210, 255, 0.08);
    border-bottom: 1px solid rgba(0, 210, 255, 0.15);
}

.code-lang {
    font-size: 11px;
    font-weight: 700;
    color: #00d2ff;
    letter-spacing: 0.08em;
}

.code-actions {
    display: flex;
    gap: 6px;
}

.code-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.code-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.code-action-btn.run-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.35));
    border: 1px solid #10b981;
    color: #34d399;
}

.code-action-btn.run-btn:hover {
    background: #10b981;
    color: #000;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.5);
}

.code-block-wrapper pre {
    margin: 0 !important;
    border-radius: 0 !important;
    background: #060e1a !important;
    border: none !important;
    padding: 14px !important;
}

.code-terminal-output {
    background: #030812;
    border-top: 1px solid rgba(0, 210, 255, 0.25);
    animation: fadeIn 0.2s ease;
}

.terminal-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dots {
    display: flex;
    gap: 5px;
}

.term-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.term-dot.red { background: #ef4444; }
.term-dot.yellow { background: #f59e0b; }
.term-dot.green { background: #10b981; }

.term-title {
    font-size: 11px;
    color: #00d2ff;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.term-close-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}
.term-close-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
}

.terminal-body {
    padding: 12px 14px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12.5px;
}

.term-stdout {
    color: #34d399;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.term-stderr {
    color: #f87171;
    margin: 4px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.term-empty {
    color: #94a3b8;
    font-style: italic;
    font-size: 12px;
}

.term-chart-box {
    margin: 10px 0;
    padding: 10px;
    background: #0a192f;
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 8px;
    text-align: center;
}

.term-chart-label {
    font-size: 11px;
    color: #00d2ff;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.term-chart-img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.term-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #64748b;
}

.term-status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.05em;
}
.term-status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.term-status-badge.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* =========================================
   LONG-TERM MEMORY (RAG) MODAL STYLES
   ========================================= */

.memory-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s ease;
}

.memory-item-card:hover {
    background: rgba(0, 210, 255, 0.05);
    border-color: rgba(0, 210, 255, 0.25);
    transform: translateY(-1px);
}

.memory-item-text {
    flex: 1;
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.45;
}

.memory-item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #64748b;
}

.memory-category-tag {
    background: rgba(0, 210, 255, 0.12);
    color: #00d2ff;
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
}

.memory-del-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: 6px;
    transition: 0.2s;
}

.memory-del-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

