/**
 * Confluence Chatbot - Modern CSS Architecture
 * A comprehensive stylesheet for the AI-powered chat interface
 */

/* =============================================================================
   CSS RESET & NORMALIZATION
   ============================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =============================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================================================= */

:root {
  /* Color Palette */
  --primary-purple: #a855f7;
  --primary-purple-light: #c084fc;
  --primary-purple-dark: #9333ea;
  
  /* Brand Colors */
  --brand-gradient: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-light));
  --brand-gradient-hover: linear-gradient(135deg, var(--primary-purple-dark), var(--primary-purple));
  
  /* Semantic Colors */
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #6366f1;
  
  /* Neutral Colors */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Theme Variables - Light */
  --bg-primary: #fdfdff;
  --bg-secondary: rgba(255, 255, 255, 0.95);
  --bg-tertiary: rgba(248, 250, 252, 0.98);
  --text-primary: #222;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  /* Layout & Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1);
  --shadow-purple: 0 8px 24px rgba(168, 85, 247, 0.15);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease;
  
  /* Typography */
  --font-family-base: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family-display: 'Inter', 'Orbitron', sans-serif;
  --font-family-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  
  /* Animation */
  --animation-duration-fast: 150ms;
  --animation-duration-base: 300ms;
  --animation-duration-slow: 500ms;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: rgba(15, 23, 42, 0.95);
  --bg-tertiary: rgba(30, 41, 59, 0.98);
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  
  /* Dark theme shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.8);
  --shadow-purple: 0 8px 24px rgba(168, 85, 247, 0.35);
}

/* =============================================================================
   BASE STYLES
   ============================================================================= */

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  background-image: linear-gradient(135deg, #f0e9ff, #fbeeff);
  background-size: cover;
  background-attachment: fixed;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: all var(--transition-slow);
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[data-theme="dark"] body {
  background-image: linear-gradient(135deg, #0f172a, #1e293b);
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family-display);
  background: var(--brand-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  white-space: nowrap;
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--spacing-lg);
}

h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-md);
}

h4 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-sm);
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =============================================================================
   LAYOUT COMPONENTS
   ============================================================================= */

.main-wrapper {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  gap: var(--spacing-xl);
  padding: var(--spacing-xl);
  box-sizing: border-box;
  align-items: stretch;
  justify-content: center;
}

.container {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 1400px;
  height: 100%;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-radius: var(--radius-3xl);
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-xl), var(--shadow-lg);
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: all var(--transition-slow);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Chat header */
.chat-header {
  flex-shrink: 0;
  margin-bottom: var(--spacing-lg);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

[data-theme="dark"] .chat-header {
  border-bottom-color: rgba(75, 85, 99, 0.3);
}

/* Chat section */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat footer */
.chat-footer {
  flex-shrink: 0;
}

[data-theme="dark"] .container {
  border-color: rgba(75, 85, 99, 0.2);
}

/* =============================================================================
   SIDEBAR COMPONENT
   ============================================================================= */

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  padding: 18px;
  box-shadow: var(--shadow-xl), var(--shadow-lg);
  border-radius: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: all var(--transition-slow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.sidebar::before {
  display: none;
}

[data-theme="dark"] .sidebar {
  border-color: rgba(75, 85, 99, 0.4);
}

/* Sidebar Header */
.sidebar-header {
  flex-shrink: 0;
  margin-bottom: var(--spacing-lg);
}

.sidebar h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: var(--font-weight-extrabold);
  background: var(--brand-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding-bottom: var(--spacing-lg);
  border-bottom: 2px solid rgba(168, 85, 247, 0.1);
  text-transform: uppercase;
}

[data-theme="dark"] .sidebar h3 {
  border-bottom-color: rgba(168, 85, 247, 0.2);
}

/* Sidebar Actions */
.sidebar-actions {
  flex-shrink: 0;
  margin-bottom: var(--spacing-lg);
}

/* Chat History Section */
.chat-history-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid rgba(168, 85, 247, 0.15);
  padding-top: var(--spacing-lg);
  margin-top: var(--spacing-md);
  position: relative;
}

.chat-history-section::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.3), transparent);
}

[data-theme="dark"] .chat-history-section {
  border-top-color: rgba(168, 85, 247, 0.2);
}

[data-theme="dark"] .chat-history-section::before {
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.4), transparent);
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
  box-sizing: border-box;
}

/* =============================================================================
   BUTTON COMPONENTS
   ============================================================================= */

/* Base Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Primary Button */
.btn-primary,
#new-chat-btn {
  background: var(--brand-gradient);
  color: white;
  box-shadow: var(--shadow-purple);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
  width: 100%;
  margin-bottom: var(--spacing-lg);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  border: none;
}

.btn-primary::before,
#new-chat-btn::before {
  display: none;
}

.btn-primary:hover,
#new-chat-btn:hover {
  background: var(--brand-gradient-hover);
}


.btn-primary:active,
#new-chat-btn:active {
  transform: none;
}

/* Secondary Button */
.btn-secondary,
.sidebar-btn {
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.8), rgba(248, 250, 252, 0.9));
  color: var(--gray-600);
  border: 1px solid rgba(148, 163, 184, 0.15);
  backdrop-filter: blur(8px);
  width: 100%;
  padding: 12px 16px;
  margin-bottom: var(--spacing-md);
  border-radius: var(--radius-lg);
  position: relative;
}

.sidebar-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-btn:hover {
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  box-shadow: var(--shadow-sm);
  border-color: rgba(168, 85, 247, 0.2);
}

.sidebar-btn:hover::before {
  opacity: 1;
}

/* Danger Button */
.btn-danger,
.sidebar-btn.danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.1));
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
  backdrop-filter: blur(8px);
  width: 100%;
  padding: 12px 16px;
  margin-bottom: var(--spacing-md);
  border-radius: var(--radius-lg);
  position: relative;
  transition: all var(--transition-base);
}

.sidebar-btn.danger::before {
  display: none;
}

.btn-danger:hover,
.sidebar-btn.danger:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(248, 113, 113, 0.15));
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: var(--shadow-sm);
}


[data-theme="dark"] .sidebar-btn.danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(248, 113, 113, 0.15));
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .sidebar-btn.danger:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(248, 113, 113, 0.2));
  border-color: rgba(239, 68, 68, 0.4);
}

/* Action Buttons */
.action-btn {
  background: rgba(0, 0, 0, 0.1);
  border: none;
  border-radius: var(--radius-md);
  padding: 6px 10px;
  cursor: pointer;
  font-size: var(--font-size-xs);
  transition: all var(--transition-base);
  color: var(--text-primary);
  transform: scale(0.9);
  opacity: 0.7;
}

.action-btn:hover {
  transform: scale(1);
  opacity: 1;
  background: rgba(168, 85, 247, 0.2);
}

[data-theme="dark"] .action-btn {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Chat Action Buttons */
.chat-action-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  font-size: var(--font-size-xs);
  transition: background var(--transition-fast);
}

.chat-action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Send Button */
.send-btn {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--brand-gradient);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.send-btn:hover {
  background: var(--brand-gradient-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.send-icon {
  width: 22px;
  height: 22px;
  stroke: white;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition-fast);
}

.send-btn:hover .send-icon {
  transform: translateX(2px);
}

/* =============================================================================
   FORM COMPONENTS
   ============================================================================= */

.message-form {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
  padding: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-3xl);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-xl);
  margin-top: var(--spacing-lg);
}

[data-theme="dark"] .message-form {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(75, 85, 99, 0.3);
}



.input-group {
  flex: 1;
  position: relative;
}

.message-input {
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius-2xl);
  border: 2px solid rgba(148, 163, 184, 0.2);
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--gray-700);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.message-input:focus {
  border-color: var(--primary-purple);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-purple);
  transform: translateY(-1px);
}

.message-input::placeholder {
  color: var(--gray-400);
}

[data-theme="dark"] .message-input {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-primary);
  border: 2px solid rgba(100, 116, 139, 0.3);
}

[data-theme="dark"] .message-input:focus {
  border-color: var(--primary-purple);
  background: rgba(30, 41, 59, 0.95);
  box-shadow: var(--shadow-purple);
}

[data-theme="dark"] .message-input::placeholder {
  color: var(--gray-400);
}

/* =============================================================================
   CHAT COMPONENTS
   ============================================================================= */

.chat-box {
  flex-grow: 1;
  overflow-y: auto;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  border-radius: var(--radius-2xl);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(248, 250, 252, 0.6) 100%);
  box-shadow: inset 0 2px 16px rgba(168, 85, 247, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .chat-box {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.6) 0%, rgba(55, 65, 81, 0.8) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: inset 0 2px 16px rgba(168, 85, 247, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Message Containers */
.msg-container {
  margin: 10px 0;
  clear: both;
  position: relative;
  max-width: min(85%, 800px);
  opacity: 0;
  transform: translateY(20px);
  animation: messageSlideIn 0.4s ease-out forwards;
}

.msg-container.user {
  float: right;
  text-align: right;
}

.msg-container.bot {
  float: left;
  text-align: left;
}

@keyframes messageSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Messages */
.chat-msg {
  padding: 10px 14px;
  border-radius: var(--radius-2xl);
  word-wrap: break-word;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  max-width: min(85%, 800px);
  position: relative;
  backdrop-filter: blur(8px);
}

.chat-msg.user {
  background: var(--brand-gradient);
  color: white;
  float: right;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-2xl);
  box-shadow: var(--shadow-purple);
}

.chat-msg.bot {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  color: var(--gray-700);
  float: left;
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

[data-theme="dark"] .chat-msg.user {
  background: linear-gradient(135deg, #7c3aed 0%, var(--primary-purple) 100%);
  color: var(--gray-50);
}

[data-theme="dark"] .chat-msg.bot {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.9) 0%, rgba(71, 85, 105, 0.9) 100%);
  color: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Message Actions */
.msg-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  margin: 4px 0;
}

.msg-container.user .msg-actions {
  justify-content: flex-end;
}

.msg-container.bot .msg-actions {
  justify-content: flex-start;
}

.msg-container:hover .msg-actions {
  opacity: 1;
}

/* Message Timestamps */
.msg-timestamp {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.msg-container.user .msg-timestamp {
  justify-content: flex-end;
}

.msg-container.bot .msg-timestamp {
  justify-content: flex-start;
}

[data-theme="dark"] .msg-timestamp {
  color: var(--gray-400);
}

/* Message Status */
.msg-status {
  font-size: var(--font-size-xs);
  transition: color var(--transition-base);
}

.msg-status.sending {
  color: var(--warning-color);
  animation: pulse 1.5s infinite;
}

.msg-status.sent {
  color: var(--gray-500);
}

.msg-status.delivered {
  color: var(--success-color);
}

.msg-status.failed {
  color: var(--error-color);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Error Messages */
.chat-msg.error {
  background-color: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

[data-theme="dark"] .chat-msg.error {
  background-color: #451a1a;
  border: 1px solid #7f1d1d;
  color: #f87171;
}

.error-actions {
  margin-top: var(--spacing-sm);
  display: flex;
  justify-content: flex-start;
}

.retry-btn {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: background var(--transition-base);
}

.retry-btn:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
}

/* =============================================================================
   CHAT HISTORY COMPONENT
   ============================================================================= */

#chat-history {
  list-style: none;
  padding: 0;
  margin: 0;
}

#chat-history li {
  padding: 12px 14px;
  margin-bottom: var(--spacing-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(248, 250, 252, 0.8) 100%);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: var(--font-size-sm);
  word-break: break-word;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
  min-height: auto;
  width: 100%;
  box-sizing: border-box;
}

#chat-history li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--brand-gradient);
  border-radius: 14px 0 0 14px;
  transition: width var(--transition-base);
}

#chat-history li:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(192, 132, 252, 0.12) 100%);
  border-color: rgba(168, 85, 247, 0.25);
  box-shadow: var(--shadow-lg);
}

#chat-history li:hover::before {
  width: 4px;
}

#chat-history li.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(192, 132, 252, 0.2) 100%) !important;
  border: 2px solid rgba(168, 85, 247, 0.4) !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-purple) !important;
}

#chat-history li.active .chat-title {
  font-weight: var(--font-weight-bold);
  color: var(--primary-purple);
}

#chat-history li.active::before {
  width: 4px;
  opacity: 1;
}

[data-theme="dark"] #chat-history li {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.7) 0%, rgba(31, 41, 55, 0.8) 100%);
  color: var(--text-primary);
  border-color: rgba(75, 85, 99, 0.3);
}

[data-theme="dark"] #chat-history li:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(192, 132, 252, 0.15) 100%);
  border-color: rgba(168, 85, 247, 0.4);
}

[data-theme="dark"] #chat-history li.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(192, 132, 252, 0.25) 100%);
  border-color: rgba(168, 85, 247, 0.5);
}

[data-theme="dark"] #chat-history li.active .chat-title {
  color: var(--primary-purple-light);
}

.chat-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 0;
}

.chat-title {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-preview {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 3px;
}

.chat-time {
  font-weight: var(--font-weight-normal);
  font-size: 10px;
}

.chat-count {
  font-weight: var(--font-weight-medium);
  padding: 1px 5px;
  background: rgba(168, 85, 247, 0.08);
  border-radius: 6px;
  font-size: 9px;
  letter-spacing: 0.2px;
}

[data-theme="dark"] .chat-count {
  background: rgba(168, 85, 247, 0.15);
}

[data-theme="dark"] .chat-preview {
  color: var(--gray-400);
}

.chat-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  background: rgba(255, 255, 255, 0.9);
  padding: 4px;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .chat-actions {
  background: rgba(30, 41, 59, 0.9);
}

#chat-history li:hover .chat-actions {
  opacity: 1;
}

.chat-action-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
  transition: background var(--transition-fast);
  color: var(--text-muted);
}

.chat-action-btn:hover {
  background: rgba(168, 85, 247, 0.1);
  color: var(--primary-purple);
}

/* =============================================================================
   THEME TOGGLE COMPONENT
   ============================================================================= */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.theme-icon-wrapper {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  border-radius: var(--radius-sm);
  padding: 4px;
  background: transparent;
  border: none;
}

.theme-icon-wrapper:hover {
  background: rgba(168, 85, 247, 0.1);
  transform: scale(1.1);
}

[data-theme="dark"] .theme-icon-wrapper:hover {
  background: rgba(168, 85, 247, 0.15);
}

.theme-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all var(--transition-base);
}

/* Icon opacity based on active theme */
.left-icon .sun-icon {
  opacity: 1;
}

.right-icon .moon-icon {
  opacity: 0.4;
}

[data-theme="dark"] .left-icon .sun-icon {
  opacity: 0.4;
}

[data-theme="dark"] .right-icon .moon-icon {
  opacity: 1;
}

/* Icon colors */
.sun-icon {
  color: var(--warning-color);
}

.moon-icon {
  color: var(--info-color);
}

[data-theme="dark"] .sun-icon {
  color: #fbbf24;
}

[data-theme="dark"] .moon-icon {
  color: #a5b4fc;
}

.toggle-btn {
  width: 44px;
  height: 22px;
  background: #ccc;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition-base);
  border: none;
  outline: none;
}

.toggle-btn::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-base);
}

[data-theme="dark"] .toggle-btn {
  background: #555;
  border: none;
}

[data-theme="dark"] .toggle-btn::before {
  transform: translateX(22px);
}

/* =============================================================================
   LOADING & TYPING INDICATORS
   ============================================================================= */

.chat-msg.loading {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.9) 100%);
  border: 1px solid rgba(168, 85, 247, 0.15);
  padding: 16px 20px;
  border-radius: var(--radius-2xl);
  position: relative;
  min-width: 120px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-2xl);
  animation: loadingPulse 2s ease-in-out infinite;
}

[data-theme="dark"] .chat-msg.loading {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.8) 0%, rgba(75, 85, 99, 0.9) 100%);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

@keyframes loadingPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.01);
  }
}

/* Modern Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--spacing-sm);
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gradient);
  animation: typingBounce 1.4s ease-in-out infinite;
  opacity: 0.4;
}

.typing-dot:nth-child(1) {
  animation-delay: 0ms;
}

.typing-dot:nth-child(2) {
  animation-delay: 160ms;
}

.typing-dot:nth-child(3) {
  animation-delay: 320ms;
}

.typing-text {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  font-style: italic;
  animation: typingTextPulse 2s ease-in-out infinite;
}

[data-theme="dark"] .typing-text {
  color: var(--gray-400);
}

@keyframes typingBounce {
  0%, 60%, 100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

@keyframes typingTextPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* =============================================================================
   EMPTY STATES
   ============================================================================= */

.empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-primary);
  opacity: 0;
  display: none;
  animation: fadeInUp 0.6s ease-out forwards;
}

.empty-state.show {
  opacity: 1;
}

.empty-state.main-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  max-width: 600px;
  margin: 0 auto;
  background: transparent;
  border-radius: 0;
  padding: var(--spacing-2xl);
  border: none;
  backdrop-filter: none;
}

[data-theme="dark"] .empty-state.main-empty {
  background: transparent;
  border-color: transparent;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-lg);
  opacity: 0.9;
  animation: floatingIcon 3s ease-in-out infinite;
  display: inline-block;
}

.empty-state h3 {
  margin: 0 0 var(--spacing-md) 0;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  background: var(--brand-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.empty-state p {
  margin: 0 0 var(--spacing-xl) 0;
  font-size: var(--font-size-lg);
  opacity: 0.8;
  line-height: 1.6;
  max-width: 400px;
}

.empty-state span {
  font-size: var(--font-size-sm);
  opacity: 0.6;
}

/* Sidebar Empty State */
.sidebar .empty-state {
  padding: var(--spacing-lg) var(--spacing-md);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, rgba(192, 132, 252, 0.08) 100%);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(168, 85, 247, 0.2);
  margin-top: var(--spacing-lg);
}

.sidebar .empty-state .empty-icon {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-sm);
  opacity: 0.6;
}

.sidebar .empty-state p {
  font-size: var(--font-size-sm);
  margin: 0;
  opacity: 0.7;
  line-height: 1.4;
}

.sidebar .empty-state span {
  font-size: var(--font-size-xs);
  opacity: 0.6;
  display: block;
  margin-top: var(--spacing-sm);
}

[data-theme="dark"] .sidebar .empty-state {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(192, 132, 252, 0.12) 100%);
  border-color: rgba(168, 85, 247, 0.3);
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 0.9;
    transform: translateY(0);
  }
}

@keyframes floatingIcon {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* =============================================================================
   EXAMPLE PROMPTS
   ============================================================================= */

.example-prompts {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
  width: 100%;
  max-width: 500px;
}

.example-prompt {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(192, 132, 252, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: var(--font-size-sm);
  text-align: left;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
}

.example-prompt:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(192, 132, 252, 0.25));
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.example-prompt:active {
  transform: translateY(-1px) scale(1.01);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .example-prompt {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(192, 132, 252, 0.2));
  border-color: rgba(168, 85, 247, 0.3);
}

[data-theme="dark"] .example-prompt:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(192, 132, 252, 0.3));
  border-color: rgba(168, 85, 247, 0.5);
}

/* =============================================================================
   NOTIFICATIONS
   ============================================================================= */

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: var(--font-weight-medium);
  z-index: var(--z-tooltip);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.notification.success {
  background: linear-gradient(135deg, var(--success-color), #059669);
}

.notification.error {
  background: linear-gradient(135deg, var(--error-color), #dc2626);
}

.notification.show {
  transform: translateX(0);
}

/* =============================================================================
   MOBILE NAVIGATION
   ============================================================================= */

.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: var(--z-fixed);
  background: rgba(168, 85, 247, 0.9);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-purple);
  transition: all var(--transition-base);
}

.mobile-menu-toggle:hover {
  background: rgba(168, 85, 247, 1);
  transform: scale(1.05);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  margin: 3px 0;
  transition: var(--transition-base);
  border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.active {
  opacity: 1;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

/* Large Desktop Screens */
@media (min-width: 1600px) {
  .main-wrapper {
    padding: var(--spacing-2xl);
  }
  
  .container {
    max-width: 1600px;
  }
  
  .sidebar {
    width: 320px;
  }
}

/* Ultra-wide Screens */
@media (min-width: 2000px) {
  .container {
    max-width: 1800px;
  }
  
  .sidebar {
    width: 340px;
  }
  
  .chat-msg,
  .msg-container {
    max-width: min(80%, 900px);
  }
}

@media (min-width: 640px) {
  .example-prompts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .example-prompts {
    grid-template-columns: 1fr;
  }
}

/* Medium Desktop Screens */
@media (min-width: 1200px) and (max-width: 1599px) {
  .container {
    max-width: 1200px;
  }
  
  .main-wrapper {
    gap: var(--spacing-lg);
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  .main-wrapper {
    flex-direction: column;
    gap: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    z-index: var(--z-modal);
    border-radius: 0;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
    transition: left var(--transition-base);
    overflow-y: auto;
    padding: 16px;
  }

  .sidebar .chat-actions {
    top: 8px;
    right: 8px;
    padding: 4px;
  }

  .sidebar .chat-action-btn {
    padding: 5px;
    font-size: 12px;
    min-width: 28px;
    min-height: 28px;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar-overlay {
    display: block;
  }

  .container {
    width: 100%;
    height: 100vh;
    padding: 80px 16px 16px;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .chat-header {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) 0;
  }
  
  .chat-header h1 {
    font-size: var(--font-size-lg);
  }

  .chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .chat-box {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
  }

  .message-form {
    padding: var(--spacing-lg);
    margin: 0;
    border-radius: var(--radius-2xl);
    gap: var(--spacing-sm);
  }

  .message-input {
    padding: 16px 20px;
    font-size: var(--font-size-base);
    border-radius: var(--radius-xl);
  }

  .send-btn {
    padding: 16px;
    border-radius: var(--radius-xl);
  }

  .chat-msg {
    padding: 12px 16px;
    font-size: var(--font-size-sm);
    max-width: 85%;
    line-height: 1.5;
  }

  .msg-container {
    max-width: 85%;
    margin: 12px 0;
  }

  .example-prompts {
    max-width: 100%;
    gap: var(--spacing-sm);
  }

  .example-prompt {
    padding: 16px 20px;
    font-size: var(--font-size-base);
  }

  h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-lg);
  }

  .empty-state h3 {
    font-size: var(--font-size-xl);
  }

  .empty-state p {
    font-size: var(--font-size-base);
  }

  .empty-state.main-empty {
    padding: var(--spacing-xl);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 70px 12px 12px;
  }

  .chat-box {
    padding: var(--spacing-md);
  }

  .chat-msg {
    padding: 10px 14px;
    font-size: var(--font-size-xs);
    max-width: 90%;
    line-height: 1.4;
  }

  .msg-container {
    max-width: 90%;
  }

  .message-form {
    padding: var(--spacing-md);
    gap: var(--spacing-sm);
  }

  .message-input {
    padding: 14px 18px;
    font-size: var(--font-size-base);
  }

  .send-btn {
    padding: 14px;
    min-width: 48px;
  }

  .example-prompt {
    padding: 14px 16px;
    font-size: var(--font-size-sm);
  }

  .chat-header h1 {
    font-size: var(--font-size-base);
  }

  .sidebar {
    width: 300px;
    left: -300px;
    padding: 14px;
  }

  .sidebar #chat-history li {
    padding: 10px 12px;
    margin-bottom: var(--spacing-sm);
  }

  .sidebar .chat-title {
    font-size: var(--font-size-sm);
  }

  .sidebar .chat-preview {
    font-size: 11px;
  }

  .mobile-menu-toggle {
    top: 16px;
    left: 16px;
  }
}

/* =============================================================================
   ENHANCED MARKDOWN STYLING
   ============================================================================= */

.chat-msg pre {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  padding: var(--spacing-md);
  overflow-x: auto;
  margin: var(--spacing-sm) 0;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

[data-theme="dark"] .chat-msg pre {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.chat-msg code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
}

[data-theme="dark"] .chat-msg code {
  background: rgba(255, 255, 255, 0.1);
}

.chat-msg pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.chat-msg ul, .chat-msg ol {
  margin: var(--spacing-sm) 0;
  padding-left: 20px;
}

.chat-msg li {
  margin: 4px 0;
  line-height: 1.5;
}

.chat-msg blockquote {
  border-left: 4px solid var(--primary-purple);
  padding-left: var(--spacing-md);
  margin: var(--spacing-sm) 0;
  color: rgba(0, 0, 0, 0.7);
  font-style: italic;
}

[data-theme="dark"] .chat-msg blockquote {
  border-color: var(--primary-purple-light);
  color: rgba(255, 255, 255, 0.7);
}

.chat-msg h1, .chat-msg h2, .chat-msg h3, .chat-msg h4, .chat-msg h5, .chat-msg h6 {
  margin: var(--spacing-md) 0 var(--spacing-sm) 0;
  font-weight: var(--font-weight-semibold);
}

.chat-msg h1 { font-size: 1.5em; }
.chat-msg h2 { font-size: 1.3em; }
.chat-msg h3 { font-size: 1.2em; }
.chat-msg h4 { font-size: 1.1em; }

.chat-msg table {
  border-collapse: collapse;
  margin: var(--spacing-sm) 0;
  width: 100%;
  font-size: var(--font-size-sm);
}

.chat-msg th, .chat-msg td {
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
}

.chat-msg th {
  background: rgba(0, 0, 0, 0.05);
  font-weight: var(--font-weight-semibold);
}

[data-theme="dark"] .chat-msg th, 
[data-theme="dark"] .chat-msg td {
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .chat-msg th {
  background: rgba(255, 255, 255, 0.05);
}

.chat-msg a {
  color: var(--primary-purple);
  text-decoration: underline;
}

[data-theme="dark"] .chat-msg a {
  color: var(--primary-purple-light);
}

.chat-msg img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: var(--spacing-sm) 0;
}

/* =============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================= */

/* Focus indicators */
button:focus,
input:focus,
[role="button"]:focus {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}

[data-theme="dark"] button:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] [role="button"]:focus {
  outline-color: var(--primary-purple-light);
}

/* Keyboard navigation for theme toggle */
.theme-icon-wrapper:focus {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
  border-radius: 4px;
}

.toggle-btn:focus {
  outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .chat-msg {
    border: 2px solid currentColor;
  }
  
  button {
    border: 2px solid currentColor;
  }
}

/* =============================================================================
   SCROLLBAR STYLING
   ============================================================================= */

/* Webkit Scrollbars (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(192, 132, 252, 0.7));
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(192, 132, 252, 0.9));
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Dark theme scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.7), rgba(192, 132, 252, 0.8));
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(192, 132, 252, 1));
}

/* Firefox Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.6) rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] * {
  scrollbar-color: rgba(168, 85, 247, 0.7) rgba(255, 255, 255, 0.05);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes shimmer {
  0% {
    background-position: 0%;
  }
  100% {
    background-position: 200%;
  }
}

@keyframes shine {
  0% { background-position: 0%; }
  100% { background-position: 200%; }
}

/* =============================================================================
   DARK THEME OVERRIDES
   ============================================================================= */

[data-theme="dark"] .sidebar-btn {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.8), rgba(75, 85, 99, 0.9));
  color: var(--text-primary);
  border-color: rgba(75, 85, 99, 0.4);
}

[data-theme="dark"] .sidebar-btn:hover {
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.9), rgba(55, 65, 81, 0.8));
  border-color: rgba(168, 85, 247, 0.3);
}