/* Noor AI: Gemini Blue & White Design System (English & Urdu Bilingual AI) */

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

:root {
  /* Color Palette - Gemini Blue & White Theme */
  --canvas-bg: #FFFFFF;
  --surface-ice: #F0F4F9;
  --surface-cool-white: #F8FAFC;
  --surface-pill: #E8F0FE;
  --surface-hover: #E2E8F0;
  
  --brand-blue: #1A73E8;
  --brand-blue-deep: #0B57D0;
  --brand-blue-light: #4285F4;
  --brand-blue-soft: #8AB4F8;
  --brand-blue-glow: rgba(26, 115, 232, 0.16);

  --gradient-gemini: linear-gradient(135deg, #0B57D0 0%, #1A73E8 45%, #4285F4 75%, #8AB4F8 100%);
  --gradient-gemini-soft: linear-gradient(135deg, rgba(11, 87, 208, 0.08) 0%, rgba(26, 115, 232, 0.12) 100%);
  --gradient-voice-orb: radial-gradient(circle at 35% 35%, #8AB4F8 0%, #4285F4 35%, #1A73E8 70%, #0B57D0 100%);

  /* Typography Colors */
  --text-ink: #1F1F1F;
  --text-slate: #444746;
  --text-muted: #747775;
  --text-on-blue: #FFFFFF;

  /* Borders & Dividers */
  --border-subtle: #E1E6EF;
  --border-focus: #1A73E8;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px rgba(26, 115, 232, 0.07);
  --shadow-hover: 0 8px 24px rgba(26, 115, 232, 0.14);
  --shadow-float: 0 8px 32px rgba(11, 87, 208, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-orb: 0 0 50px rgba(66, 133, 244, 0.45), 0 0 100px rgba(26, 115, 232, 0.25);

  /* Fonts */
  --font-en: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ur: 'Noto Nastaliq Urdu', 'Gulzar', serif;
  --font-code: 'Fira Code', monospace;

  /* Sizing & Transitions */
  --sidebar-width: 280px;
  --header-height: 64px;
  --composer-max-w: 820px;
  --transition-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 250ms cubic-bezier(0.2, 0, 0, 1);
}

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

html, body {
  height: 100%;
  width: 100%;
  background-color: var(--canvas-bg);
  color: var(--text-ink);
  font-family: var(--font-en);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: transparent;
}

button {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

a {
  color: var(--brand-blue);
  text-decoration: none;
}

/* Bilingual Urdu Font Rule: generous line-height prevents ligature clipping */
.urdu-text, [lang="ur"], [dir="rtl"] {
  font-family: var(--font-ur);
  line-height: 2.05 !important;
  letter-spacing: 0.01em;
}

/* Automatic Directionality helper */
[dir="auto"] {
  unicode-bidi: plaintext;
}

/* App Container Layout */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
  background-color: var(--canvas-bg);
}

/* ==========================================================================
   A. Collapsible Left Navigation Sidebar (280px desktop)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background-color: var(--surface-ice);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-smooth), width var(--transition-smooth);
  z-index: 100;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: 0;
  transform: translateX(-100%);
  border-right: none;
  visibility: hidden;
}

/* Top Action Row */
.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-slate);
}

.sidebar-toggle-btn:hover {
  background-color: var(--surface-hover);
  color: var(--text-ink);
}

.btn-new-chat {
  flex: 1;
  height: 44px;
  background-color: var(--surface-pill);
  color: var(--brand-blue-deep);
  font-weight: 600;
  font-size: 14px;
  border-radius: 24px;
  padding: 0 16px;
  border: 1px solid rgba(26, 115, 232, 0.18);
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.06);
}

.btn-new-chat:hover {
  background-color: #dbe7fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.12);
}

/* Language & Voice Quick Switcher Card */
.sidebar-quick-card {
  margin: 0 16px 12px;
  background-color: var(--canvas-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.quick-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Segmented Response Mode Selector */
.segmented-control {
  display: flex;
  background-color: var(--surface-ice);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.segmented-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  color: var(--text-slate);
  text-align: center;
  justify-content: center;
}

.segmented-btn.active {
  background-color: var(--canvas-bg);
  color: var(--brand-blue-deep);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.sidebar-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-slate);
}

/* Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  transition: .25s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--brand-blue);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Conversation History List */
.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
}

.sidebar-history::-webkit-scrollbar {
  width: 4px;
}
.sidebar-history::-webkit-scrollbar-thumb {
  background-color: #D1D5DB;
  border-radius: 4px;
}

.history-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 12px 6px;
}

.history-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-ink);
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 3px;
  transition: all var(--transition-fast);
}

.history-item:hover {
  background-color: #E6EDF6;
}

.history-item.active {
  background-color: var(--surface-pill);
  color: var(--brand-blue-deep);
  font-weight: 600;
}

.history-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3.5px;
  background-color: var(--brand-blue);
  border-radius: 0 4px 4px 0;
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}

.history-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-actions {
  display: none;
  align-items: center;
  gap: 4px;
}

.history-item:hover .history-actions {
  display: flex;
}

.history-action-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--text-muted);
}

.history-action-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: var(--text-ink);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--surface-ice);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-slate);
  background-color: var(--canvas-bg);
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-ring {
  to {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

.btn-sidebar-settings {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-slate);
}

.btn-sidebar-settings:hover {
  background-color: var(--surface-hover);
  color: var(--brand-blue-deep);
}

/* ==========================================================================
   B. Main Chat Viewport & Header
   ========================================================================== */
.main-content {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--canvas-bg);
  overflow: hidden;
}

/* Sticky Header */
.top-header {
  height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 50;
  position: sticky;
  top: 0;
}

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

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

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-gemini);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  background-color: var(--surface-pill);
  color: var(--brand-blue-deep);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(26, 115, 232, 0.2);
}

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

.btn-header-action {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  color: var(--text-slate);
  background-color: var(--surface-ice);
  border: 1px solid var(--border-subtle);
}

.btn-header-action:hover {
  background-color: #e5edf7;
  color: var(--brand-blue-deep);
}

.btn-header-action.active-voice {
  background-color: #E8F0FE;
  color: var(--brand-blue-deep);
  border-color: rgba(26, 115, 232, 0.3);
}

/* ==========================================================================
   C. Chat Container & Welcome Empty State
   ========================================================================== */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 20px 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-behavior: smooth;
}

.chat-viewport::-webkit-scrollbar {
  width: 6px;
}
.chat-viewport::-webkit-scrollbar-thumb {
  background-color: #D1D5DB;
  border-radius: 6px;
}

.chat-container {
  width: 100%;
  max-width: var(--composer-max-w);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Welcome Empty State */
.welcome-state {
  width: 100%;
  max-width: 760px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  animation: fadeIn 0.4s ease-out;
}

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

.welcome-sparkle-hero {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.welcome-sparkle-hero .gemini-hero-orb {
  width: 76px;
  height: 76px;
  background: var(--gradient-gemini);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(26, 115, 232, 0.35);
  animation: floatOrb 4s ease-in-out infinite;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-6px) scale(1.04); }
}

.welcome-sparkle-hero svg {
  width: 42px;
  height: 42px;
  fill: #FFFFFF;
}

.welcome-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-gemini);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  line-height: 1.3;
}

.welcome-subtitle-ur {
  font-size: 20px;
  font-family: var(--font-ur);
  color: var(--text-slate);
  margin-bottom: 36px;
  line-height: 1.95;
}

/* 4 Interactive Starter Cards */
.starter-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
}

.starter-card {
  background-color: var(--surface-ice);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-height: 130px;
  transition: all var(--transition-smooth);
  cursor: pointer;
}

.starter-card:hover {
  background-color: var(--canvas-bg);
  transform: translateY(-3px);
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-hover);
}

.starter-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.starter-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: var(--surface-pill);
  color: var(--brand-blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
}

.starter-card-arrow {
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition-fast);
}

.starter-card:hover .starter-card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--brand-blue);
}

.starter-card-en {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-ink);
  margin-bottom: 4px;
}

.starter-card-ur {
  font-size: 14px;
  font-family: var(--font-ur);
  color: var(--text-slate);
  line-height: 1.85;
}

/* ==========================================================================
   Conversation Stream (Messages)
   ========================================================================== */
.message-row {
  display: flex;
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

.message-row.user-row {
  justify-content: flex-end;
}

.message-row.ai-row {
  justify-content: flex-start;
  gap: 16px;
}

/* User Message Bubble */
.user-bubble-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 78%;
}

.user-bubble {
  background-color: var(--brand-blue);
  color: var(--text-on-blue);
  padding: 14px 20px;
  border-radius: 20px 20px 4px 20px;
  font-size: 15px;
  line-height: 1.6;
  box-shadow: 0 4px 16px rgba(26, 115, 232, 0.22);
  word-break: break-word;
}

.user-bubble.urdu-bubble {
  font-family: var(--font-ur);
  line-height: 2.1 !important;
  font-size: 16.5px;
}

.user-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(26, 115, 232, 0.1);
  color: var(--brand-blue-deep);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* AI Message Container */
.ai-avatar-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-gemini);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.25);
  margin-top: 2px;
}

.ai-bubble-container {
  flex: 1;
  max-width: calc(100% - 52px);
  display: flex;
  flex-direction: column;
}

.ai-content {
  color: var(--text-ink);
  font-size: 15px;
  line-height: 1.75;
}

.ai-content.urdu-script {
  font-family: var(--font-ur);
  line-height: 2.1 !important;
  font-size: 16.5px;
}

.ai-content h1, .ai-content h2, .ai-content h3, .ai-content h4 {
  color: var(--brand-blue-deep);
  margin: 14px 0 8px;
  font-weight: 700;
}

.ai-content h3 {
  font-size: 16.5px;
}

.ai-content p {
  margin-bottom: 12px;
}

.ai-content ul, .ai-content ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

[dir="rtl"] ul, [dir="rtl"] ol {
  padding-left: 0;
  padding-right: 24px;
}

.ai-content li {
  margin-bottom: 6px;
}

.ai-content blockquote {
  border-left: 3.5px solid var(--brand-blue);
  background-color: var(--surface-ice);
  padding: 10px 16px;
  border-radius: 0 12px 12px 0;
  margin: 12px 0;
  color: var(--text-slate);
}

[dir="rtl"] .ai-content blockquote {
  border-left: none;
  border-right: 3.5px solid var(--brand-blue);
  border-radius: 12px 0 0 12px;
}

/* Syntax highlighted code styling */
.code-block-wrapper {
  background-color: #1E293B;
  color: #F8FAFC;
  border-radius: 14px;
  margin: 14px 0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  direction: ltr !important;
  text-align: left !important;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: #0F172A;
  font-family: var(--font-code);
  font-size: 12px;
  color: #94A3B8;
  border-bottom: 1px solid #334155;
}

.btn-copy-code {
  color: #CBD5E1;
  font-size: 12px;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
}
.btn-copy-code:hover {
  background-color: #334155;
  color: white;
}

.code-block-wrapper pre {
  padding: 14px 16px;
  font-family: var(--font-code);
  font-size: 13.5px;
  line-height: 1.6;
  overflow-x: auto;
}

/* Tables */
.ai-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.ai-content th, .ai-content td {
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  font-size: 13.5px;
}

.ai-content th {
  background-color: var(--surface-ice);
  font-weight: 700;
  color: var(--brand-blue-deep);
}

/* Message Bottom Action Toolbar */
.ai-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.ai-tool-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-slate);
  background-color: var(--surface-ice);
  border: 1px solid var(--border-subtle);
}

.ai-tool-btn:hover {
  background-color: #E2EAF8;
  color: var(--brand-blue-deep);
  border-color: rgba(26, 115, 232, 0.25);
}

.ai-tool-btn.speaking-active {
  background-color: var(--surface-pill);
  color: var(--brand-blue-deep);
  border-color: var(--brand-blue);
}

.mini-equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.eq-bar {
  width: 2.5px;
  background-color: var(--brand-blue);
  border-radius: 2px;
  animation: eqJump 0.8s ease-in-out infinite alternate;
}
.eq-bar:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.eq-bar:nth-child(2) { height: 12px; animation-delay: 0.3s; }
.eq-bar:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.eq-bar:nth-child(4) { height: 14px; animation-delay: 0.4s; }

@keyframes eqJump {
  0% { height: 4px; }
  100% { height: 14px; }
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
}
.btn-icon-only:hover {
  background-color: var(--surface-hover);
  color: var(--text-ink);
}
.btn-icon-only.active {
  color: var(--brand-blue);
  background-color: var(--surface-pill);
}

/* ==========================================================================
   D. Floating Bottom Composer & Voice Dock (Gemini-Style Pill Bar)
   ========================================================================== */
.composer-dock {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
  pointer-events: none;
  z-index: 60;
}

.composer-pill-card {
  width: 100%;
  max-width: var(--composer-max-w);
  background-color: var(--surface-ice);
  border-radius: 28px;
  border: 1.5px solid var(--border-subtle);
  box-shadow: var(--shadow-float);
  pointer-events: auto;
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
  padding: 8px 12px 8px 16px;
  position: relative;
}

.composer-pill-card:focus-within {
  background-color: var(--canvas-bg);
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--brand-blue-glow), var(--shadow-float);
}

/* Inline Soundwave Active Bar */
.inline-dictation-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--surface-pill);
  border-radius: 16px;
  margin-bottom: 6px;
  color: var(--brand-blue-deep);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(26, 115, 232, 0.2);
}

.inline-dictation-banner.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recording-dot {
  width: 9px;
  height: 9px;
  background-color: #EF4444;
  border-radius: 50%;
  animation: recordBlink 1s infinite;
}

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

#inlineWaveformCanvas {
  height: 22px;
  width: 120px;
}

.composer-main-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
}

.composer-left-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 4px;
}

.btn-attach {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-slate);
}
.btn-attach:hover {
  background-color: var(--surface-hover);
  color: var(--brand-blue-deep);
}

.chip-lang-input {
  height: 28px;
  padding: 0 8px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  background-color: var(--canvas-bg);
  border: 1px solid var(--border-subtle);
  color: var(--brand-blue-deep);
}
.chip-lang-input:hover {
  background-color: var(--surface-pill);
}

/* Expanding Textarea */
.composer-input-area {
  flex: 1;
  display: flex;
  align-items: center;
}

.composer-textarea {
  width: 100%;
  max-height: 160px;
  min-height: 24px;
  padding: 6px 0;
  resize: none;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-ink);
  background: transparent;
  border: none;
}

.composer-textarea::placeholder {
  color: var(--text-muted);
}

/* Right Voice & Send Controls */
.composer-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
}

.btn-dictation-mic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-slate);
}
.btn-dictation-mic:hover {
  background-color: var(--surface-hover);
  color: var(--brand-blue-deep);
}
.btn-dictation-mic.recording {
  background-color: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
}

/* Gemini Live Voice Mode button */
.btn-live-voice-mode {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-pill);
  color: var(--brand-blue-deep);
  border: 1px solid rgba(26, 115, 232, 0.25);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.1);
  transition: all var(--transition-fast);
}

.btn-live-voice-mode:hover {
  background: var(--gradient-gemini);
  color: #FFFFFF;
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.3);
}

/* Primary Send Button */
.btn-send-message {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--brand-blue);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(26, 115, 232, 0.35);
  transition: all var(--transition-fast);
  opacity: 0.5;
  pointer-events: none;
}

.btn-send-message.active {
  opacity: 1;
  pointer-events: auto;
}

.btn-send-message.active:hover {
  background-color: var(--brand-blue-deep);
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.45);
}

.composer-footer-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* ==========================================================================
   E. Full-Screen "Live Voice Mode" Overlay (Gemini Live Bolne/Sunne Wala Screen)
   ========================================================================== */
.live-voice-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, #E8F0FE 0%, #F4F7FC 40%, #FFFFFF 85%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 32px 24px 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.live-voice-overlay.open {
  opacity: 1;
  visibility: visible;
}

.voice-overlay-header {
  width: 100%;
  max-width: 800px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-blue-deep);
}

.btn-close-voice-overlay {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-slate);
  border: 1px solid var(--border-subtle);
}
.btn-close-voice-overlay:hover {
  background: white;
  color: var(--text-ink);
  transform: scale(1.05);
}

/* Centerpiece Glowing Liquid Orb */
.voice-orb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: 450px;
  margin: auto 0;
}

.glowing-liquid-orb {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--gradient-voice-orb);
  box-shadow: var(--shadow-orb);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  animation: orbMorph 8s ease-in-out infinite alternate;
}

@keyframes orbMorph {
  0% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; transform: scale(1); }
  33% { border-radius: 60% 40% 55% 45% / 45% 55% 45% 55%; transform: scale(1.05); }
  66% { border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%; transform: scale(0.98); }
  100% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; transform: scale(1.02); }
}

.glowing-liquid-orb.listening {
  animation: orbListenPulse 2.2s ease-in-out infinite alternate;
  box-shadow: 0 0 60px rgba(26, 115, 232, 0.5), 0 0 120px rgba(66, 133, 244, 0.3);
}

@keyframes orbListenPulse {
  0% { transform: scale(0.96); filter: brightness(0.95); }
  100% { transform: scale(1.12); filter: brightness(1.15); }
}

.glowing-liquid-orb.speaking {
  animation: orbSpeakWave 0.6s ease-in-out infinite alternate;
  box-shadow: 0 0 80px rgba(11, 87, 208, 0.6), 0 0 140px rgba(66, 133, 244, 0.4);
}

@keyframes orbSpeakWave {
  0% { transform: scale(1.02); }
  100% { transform: scale(1.22); }
}

.orb-inner-sparkle {
  color: white;
  animation: rotateSlow 16s linear infinite;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Orb Canvas Frequency Visualizer */
#liveVoiceCanvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  height: 240px;
  pointer-events: none;
  z-index: 1;
}

/* Live Bilingual Transcript Caption Box */
.live-transcript-box {
  width: 100%;
  max-width: 620px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 18px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  margin-top: 24px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.live-user-caption {
  font-size: 15px;
  color: var(--text-slate);
  font-style: italic;
}

.live-ai-caption {
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-blue-deep);
}

.live-ai-caption.urdu-caption {
  font-family: var(--font-ur);
  line-height: 2.1 !important;
  font-size: 18px;
}

/* Bottom Floating Voice Control Pill */
.voice-bottom-dock {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 10px 16px;
  border-radius: 36px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-float);
}

.btn-mute-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: white;
  box-shadow: 0 4px 16px rgba(26, 115, 232, 0.35);
  position: relative;
}

.btn-mute-toggle:hover {
  background: var(--brand-blue-deep);
  transform: scale(1.06);
}

.btn-mute-toggle.muted {
  background: #64748B;
  box-shadow: none;
}

.btn-end-call {
  height: 44px;
  padding: 0 18px;
  border-radius: 24px;
  background-color: #FEE2E2;
  color: #DC2626;
  font-weight: 600;
  border: 1px solid #FCA5A5;
}

.btn-end-call:hover {
  background-color: #FCA5A5;
  color: #991B1B;
}

/* ==========================================================================
   F. Modals & Toast System
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  width: 100%;
  max-width: 500px;
  background-color: var(--canvas-bg);
  border-radius: 24px;
  box-shadow: var(--shadow-float);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand-blue-deep);
}

.modal-body {
  padding: 20px 24px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-ink);
}

.setting-description {
  font-size: 12px;
  color: var(--text-muted);
}

.setting-input, .setting-select {
  width: 100%;
  height: 42px;
  background-color: var(--surface-ice);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text-ink);
}

.setting-input:focus, .setting-select:focus {
  border-color: var(--brand-blue);
  background-color: white;
}

.slider-with-val {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-with-val input[type="range"] {
  flex: 1;
  accent-color: var(--brand-blue);
}

.modal-footer {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background-color: var(--surface-ice);
  border-top: 1px solid var(--border-subtle);
}

.btn-modal-cancel {
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--text-slate);
  font-weight: 600;
}

.btn-modal-save {
  padding: 8px 18px;
  background: var(--brand-blue);
  color: white;
  border-radius: 10px;
  font-weight: 600;
}
.btn-modal-save:hover {
  background: var(--brand-blue-deep);
}

/* Floating Toast */
.toast-notice {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #1E293B;
  color: white;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
}

.toast-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .starter-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    transform: translateX(0);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .top-header {
    padding: 0 16px;
  }

  .brand-badge {
    display: none;
  }

  .chat-viewport {
    padding: 16px 12px 140px;
  }

  .user-bubble-container {
    max-width: 90%;
  }

  .ai-bubble-container {
    max-width: 100%;
  }

  .composer-dock {
    padding: 0 10px;
    bottom: 10px;
  }

  .glowing-liquid-orb {
    width: 140px;
    height: 140px;
  }
}
