/* ============================================================================
   CSS Variables & Theme
   ============================================================================ */
:root {
  /* Colors - Modern dark theme with community-friendly accents */
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2332;
  --bg-elevated: #1f2937;
  --bg-hover: #25303f;

  --accent-primary: #10b981;
  --accent-secondary: #34d399;
  --accent-muted: #059669;
  --accent-glow: rgba(16, 185, 129, 0.15);
  --accent-glow-strong: rgba(16, 185, 129, 0.3);

  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --border-color: #374151;
  --border-light: #4b5563;

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --shadow-glow-strong: 0 0 30px var(--accent-glow-strong);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* Transitions */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 150ms ease;
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Mobile tabs height */
  --mobile-tabs-height: 40px;
}

/* ============================================================================
   Light Theme
   ============================================================================ */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --bg-hover: #cbd5e1;

  --accent-primary: #059669;
  --accent-secondary: #10b981;
  --accent-muted: #047857;
  --accent-glow: rgba(5, 150, 105, 0.12);
  --accent-glow-strong: rgba(5, 150, 105, 0.25);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --border-color: #e2e8f0;
  --border-light: #cbd5e1;

  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --shadow-glow-strong: 0 0 30px var(--accent-glow-strong);
}

/* Light theme body background override */
[data-theme="light"] body {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(5, 150, 105, 0.08), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.06), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(5, 150, 105, 0.03), transparent 70%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Light theme specific adjustments */
[data-theme="light"] .message.user .message-content {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: var(--accent-primary);
}

[data-theme="light"] .message.user .message-avatar {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

[data-theme="light"] .input-wrapper {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="light"] .event-card {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .event-card:hover {
  box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

/* ============================================================================
   Theme Toggle
   ============================================================================ */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text-secondary);
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

.theme-toggle-icon {
  font-size: 16px;
  line-height: 1;
  transition: transform var(--transition);
}

.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(20deg);
}

.theme-toggle-text {
  font-size: 12px;
  font-weight: 500;
}

/* Hide text on smaller screens */
/* @media (max-width: 600px) {
  .theme-toggle-text {
    display: none;
  }
  
  .theme-toggle {
    padding: 8px 10px;
  }
} */

/* ============================================================================
   Font Size Accessibility Control
   ============================================================================ */
.font-size-control {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.font-size-btn,
.font-size-btn-pop {
  width: 15px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.font-size-btn:hover,
.font-size-btn-pop:hover {
  /* background: var(--bg-hover);
  color: var(--accent-primary); */
  font-weight: 900;
  transform: scale(1.25);
}

.font-size-btn:active,
.font-size-btn-pop:active {
  transform: scale(0.90);
}

.font-size-btn:disabled,
.font-size-btn-pop:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.font-size-smaller {
  font-size: 10px;

}

.font-size-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 28px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 20px;
  margin-right: 20px;
}

/* Hide label on smaller screens */
/* @media (max-width: 600px) {
  .font-size-label {
    display: none;
  } */
}

/* ============================================================================
   Font Size Variations (Chat & Events Only)
   ============================================================================ */

/* Small */
[data-font-size="small"] .chat-messages .message-text {
  font-size: 13px;
}

[data-font-size="small"] .chat-messages .message-text li {
  font-size: 13px;
}

[data-font-size="small"] .sidebar-content .event-title {
  font-size: 14px;
}

[data-font-size="small"] .sidebar-content .event-description {
  font-size: 12px;
}

[data-font-size="small"] .sidebar-content .event-date,
[data-font-size="small"] .sidebar-content .event-time {
  font-size: 11px;
}

/* Medium (default) - no changes needed, uses base styles */

/* Large */
[data-font-size="large"] .chat-messages .message-text {
  font-size: 17px;
  line-height: 1.7;
}

[data-font-size="large"] .chat-messages .message-text li {
  font-size: 17px;
}

[data-font-size="large"] .sidebar-content .event-title {
  font-size: 18px;
}

[data-font-size="large"] .sidebar-content .event-description {
  font-size: 16px;
  line-height: 1.6;
}

[data-font-size="large"] .sidebar-content .event-date {
  font-size: 13px;
  padding: 5px 12px;
}

[data-font-size="large"] .sidebar-content .event-time {
  font-size: 15px;
}

/* Extra Large */
[data-font-size="x-large"] .chat-messages .message-text {
  font-size: 19px;
  line-height: 1.8;
}

[data-font-size="x-large"] .chat-messages .message-text li {
  font-size: 19px;
}

[data-font-size="x-large"] .sidebar-content .event-title {
  font-size: 20px;
}

[data-font-size="x-large"] .sidebar-content .event-description {
  font-size: 18px;
  line-height: 1.7;
}

[data-font-size="x-large"] .sidebar-content .event-date {
  font-size: 14px;
  padding: 6px 14px;
}

[data-font-size="x-large"] .sidebar-content .event-time {
  font-size: 16px;
}

/* ============================================================================
   Header Controls - Consistent Height
   ============================================================================ */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.font-size-control,
.theme-toggle,
.status-indicator {
  height: 24px;
  box-sizing: border-box;
}

.font-size-control {
  padding: 4px 6px;
}

.theme-toggle,
.status-indicator {
  padding: 0 12px;
}

/* ============================================================================
   Desktop/Mobile Controls Toggle
   ============================================================================ */
.desktop-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-settings {
  display: none;
  position: relative;
}

/* ============================================================================
   Settings Button (Mobile)
   ============================================================================ */
.settings-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition);
}

.settings-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

.settings-btn[aria-expanded="true"] {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
}

/* .settings-icon {
  margin-top:-1px;
  margin-left:1px;
  font-size: 24px;
  line-height: 1;
  color: var(--text-secondary);
  transition: transform var(--transition-smooth);
}

.settings-btn[aria-expanded="true"] .settings-icon {
  transform: rotate(90deg);
} */

.settings-icon {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-smooth);
}

.settings-btn[aria-expanded="true"] .settings-icon {
  transform: rotate(90deg);
}

.settings-btn:hover .settings-icon {
  transform: rotate(45deg);
}

.settings-btn[aria-expanded="true"]:hover .settings-icon {
  transform: rotate(135deg);
}

/* ============================================================================
   Settings Popover
   ============================================================================ */
.settings-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  animation: popoverIn 0.2s ease;
}

.settings-popover[hidden] {
  display: none;
}

@keyframes popoverIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }

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

.settings-popover-header {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.settings-group {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.settings-group:last-child {
  border-bottom: none;
}

.settings-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Make controls full-width in popover */
.settings-popover .font-size-control,
.settings-popover .theme-toggle {
  width: 100%;
  height: 28px;
  justify-content: center;
  box-sizing: border-box;
}

.settings-popover .theme-toggle-text {
  display: inline;
}

/* ============================================================================
   Responsive: Show/Hide Controls
   ============================================================================ */
@media (max-width: 600px) {
  .desktop-controls {
    display: none;
  }

  .mobile-settings {
    display: block;
  }
}

/* ============================================================================
   Reset & Base
   ============================================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.12), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(52, 211, 153, 0.1), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05), transparent 70%),
    linear-gradient(180deg, #0a0f1a 0%, #111827 100%);
}

/* ============================================================================
   Mobile Tab Switcher
   ============================================================================ */
.mobile-tabs {
  display: none;
  /* Hidden by default, shown only on mobile portrait */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-tabs-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  padding: 0;
}

.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  padding: 4px;
  position: relative;
}

.mobile-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--accent-primary);
  border-radius: 0 0 3px 3px;
  transition: width var(--transition);
}

.mobile-tab.active {
  color: var(--accent-primary);
}

.mobile-tab.active::before {
  width: 40px;
}

.mobile-tab:active {
  background: var(--bg-tertiary);
}

.tab-icon {
  font-size: 16px;
  line-height: 1;
}

.tab-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================================
   Layout
   ============================================================================ */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar (Events Panel) */
.sidebar {
  width: 380px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 16px 20px 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.sidebar-header p {
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 1px;
}

.sidebar-filters {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 120px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-group select:hover {
  border-color: var(--border-light);
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-refresh {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
  height: 38px;
}

.btn-refresh:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: rotate(180deg);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.event-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.event-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.event-date {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-primary);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-secondary);
  margin-bottom: 10px;
}

.event-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.event-time {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.event-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Main Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
}

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

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

.logo-icon {
  font-size: 32px;
  line-height: 1;
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.logo-text p {
  font-size: 13px;
  color: var(--text-muted);
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
}

.status-indicator.connected {
  display: none;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse 2s infinite;
}

.status-indicator.connected .status-dot {
  background: var(--success);
  box-shadow: 0 0 2px var(--success);
  animation: none;
}

.status-indicator.error .status-dot {
  background: var(--error);
  box-shadow: 0 0 8px var(--error);
  animation: none;
}

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

.status-text:empty {
  display: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

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

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 2px solid var(--border-color);
}

.message.user .message-avatar {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: var(--accent-primary);
}

.message-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.message-content:hover {
  box-shadow: var(--shadow-md);
}

.message.user .message-content {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-elevated) 100%);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.message-text {
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
}

.message-text p {
  margin-bottom: 8px;
}

.message-text p:last-child {
  margin-bottom: 0;
}

.message-text ul {
  margin: 12px 0 12px 20px;
  padding: 0;
}

.message-text li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.message-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.message-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-pill {
  font-size: 11px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

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

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

/* Error Banner */
.error-banner {
  margin: 0 24px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius);
  color: var(--error);
  font-size: 14px;
  text-align: center;
}

/* Chat Input */
.chat-input-container {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.chat-form {
  max-width: 800px;
  margin: 0 auto;
}

.input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  transition: all var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-glow);
  transform: translateY(-1px);
}

#chat-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  resize: none;
  line-height: 1.5;
}

#chat-input::placeholder {
  color: var(--text-muted);
}

.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-send:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  transform: scale(1.08) rotate(5deg);
  box-shadow: 0 4px 16px var(--accent-glow-strong);
}

.btn-send:active:not(:disabled) {
  transform: scale(0.96) rotate(0deg);
  box-shadow: 0 1px 4px var(--accent-glow);
}

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

.suggestions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.suggestion-chip {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.suggestion-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
  transition: left var(--transition-smooth);
}

.suggestion-chip:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.suggestion-chip:hover::before {
  left: 100%;
}

/* Loading & Empty States */
.loading-state,
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.loading-state {
  gap: 16px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-state {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar {
  width: 8px;
}

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

.chat-messages::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ============================================================================
   Responsive Design
   ============================================================================ */
@media (max-width: 768px) {
  .sidebar {
    width: 280px;
  }

  .chat-header {
    padding: 12px 16px;
  }

  .logo-text h1 {
    font-size: 18px;
  }

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

  .chat-messages {
    padding: 16px;
    gap: 16px;
  }

  .message {
    max-width: 90%;
  }

  .chat-input-container {
    padding: 16px;
  }

  .suggestions {
    gap: 6px;
  }

  .suggestion-chip {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* Mobile Portrait Mode - Show tab switcher and toggle views */
@media (max-width: 480px) and (orientation: portrait) {
  .mobile-tabs {
    display: flex;
  }

  .app-container {
    height: calc(100vh - var(--mobile-tabs-height));
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 100%;
    border-right: none;
  }

  .sidebar.mobile-hidden {
    display: none;
  }

  .chat-container {
    width: 100%;
    height: 100%;
  }

  .chat-container.mobile-hidden {
    display: none;
  }

  /* Adjust sidebar content to not be cut off by tabs */
  .sidebar-content {
    padding-bottom: calc(20px + var(--mobile-tabs-height));
  }

  /* Adjust chat input area */
  .chat-input-container {
    padding-bottom: calc(4px + var(--mobile-tabs-height));
  }

  /* Hide the chat suggestions in mobile */
  .suggestions {
    display: none;
  }

  .logo-icon {
    font-size: 24px;
  }

  .logo-text h1 {
    font-size: 16px;
  }
}

/* Landscape mode on small devices - keep side-by-side layout */
@media (max-width: 480px) and (orientation: landscape) {
  .sidebar {
    width: 240px;
  }
}