@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* =============================================================================
   CSS RESET & ROOT VARIABLES
   ============================================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Chat-specific variables */
  --chat-font-size: 16px;

  /* Primary brand colors */
  --primary-color: #0078d4;
  --primary-hover: #106ebe;
  --success-color: #107c10;
  --danger-color: #d13438;
  --warning-color: #ff8c00;

  /* Dark Theme (Default) */
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #333333;
  --bg-overlay: rgba(0, 0, 0, 0.8);
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #999999;
  --border-color: #404040;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Light Theme Variables */
body.light {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #e0e0e0;
  --bg-overlay: rgba(0, 0, 0, 0.5);
  --text-primary: #1a1a1a;
  --text-secondary: #333333;
  --text-muted: #666666;
  --border-color: #d0d0d0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   GLOBAL BASE STYLES
   ============================================================================= */

body {
  margin: 0;
  font-family: 'Inter', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: all 0.3s ease;
}

/* ========================================
   UNIVERSAL GLASSMORPHISM CSS LIBRARY
   Updated to use HTML CSS Variables
   ======================================== */

/* Base Glassmorphism Foundation */
.glass-base {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.125);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   GLASS INTENSITY LEVELS
   ======================================== */

/* Subtle Glass Effect */
.glass-subtle {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Light Glass Effect */
.glass-light {
  background: var(--bg-secondary);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Medium Glass Effect */
.glass-medium {
  background: var(--bg-tertiary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Heavy Glass Effect */
.glass-heavy {
  background: var(--bg-tertiary);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ========================================
   DARK GLASS VARIANTS
   ======================================== */

.glass-dark-subtle {
  background: var(--bg-primary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass-dark-light {
  background: var(--bg-secondary);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-dark-medium {
  background: var(--bg-tertiary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-dark-heavy {
  background: var(--bg-tertiary);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ========================================
   COLORED GLASS VARIANTS
   ======================================== */

/* Primary Glass (using your primary color) */
.glass-primary {
  background: rgba(0, 120, 212, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--primary-color);
  box-shadow:
    0 8px 32px rgba(0, 120, 212, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Success Glass */
.glass-success {
  background: rgba(16, 124, 16, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--success-color);
  box-shadow:
    0 8px 32px rgba(16, 124, 16, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Danger Glass */
.glass-danger {
  background: rgba(209, 52, 56, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--danger-color);
  box-shadow:
    0 8px 32px rgba(209, 52, 56, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Warning Glass */
.glass-warning {
  background: rgba(255, 140, 0, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--warning-color);
  box-shadow:
    0 8px 32px rgba(255, 140, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Blue Glass */
.glass-blue {
  background: rgba(59, 130, 246, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow:
    0 8px 32px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Purple Glass */
.glass-purple {
  background: rgba(147, 51, 234, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(147, 51, 234, 0.2);
  box-shadow:
    0 8px 32px rgba(147, 51, 234, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Pink Glass */
.glass-pink {
  background: rgba(236, 72, 153, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(236, 72, 153, 0.2);
  box-shadow:
    0 8px 32px rgba(236, 72, 153, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Green Glass */
.glass-green {
  background: rgba(34, 197, 94, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(34, 197, 94, 0.2);
  box-shadow:
    0 8px 32px rgba(34, 197, 94, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Orange Glass */
.glass-orange {
  background: rgba(251, 146, 60, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(251, 146, 60, 0.2);
  box-shadow:
    0 8px 32px rgba(251, 146, 60, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Red Glass */
.glass-red {
  background: rgba(239, 68, 68, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow:
    0 8px 32px rgba(239, 68, 68, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ========================================
   SHAPE VARIANTS
   ======================================== */

.glass-rounded {
  border-radius: 12px;
}

.glass-rounded-lg {
  border-radius: 16px;
}

.glass-rounded-xl {
  border-radius: 20px;
}

.glass-rounded-2xl {
  border-radius: 24px;
}

.glass-rounded-full {
  border-radius: 9999px;
}

.glass-rounded-none {
  border-radius: 0;
}

/* ========================================
   INTERACTIVE STATES
   ======================================== */

/* Hover Effects */
.glass-hover:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: var(--primary-color);
}

.glass-hover-glow:hover {
  box-shadow:
    0 0 30px rgba(255, 255, 255, 0.3),
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.glass-hover-scale:hover {
  transform: scale(1.02);
}

.glass-hover-lift:hover {
  transform: translateY(-4px);
}

/* Active States */
.glass-active:active {
  transform: translateY(0) scale(0.98);
  transition: all 0.1s ease;
}

/* Focus States */
.glass-focus:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(0, 120, 212, 0.3),
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Transitions */
.glass-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-transition-fast {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-transition-slow {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hardware Acceleration */
.glass-accelerate {
  transform: translateZ(0);
  will-change: transform;
}

/* Overflow Hidden */
.glass-overflow-hidden {
  overflow: hidden;
}

/* ========================================
   COMPONENT SPECIFIC CLASSES
   ======================================== */

/* Glass Card */
.glass-card {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  color: var(--text-primary);
}

/* Glass Modal */
.glass-modal {
  background: var(--bg-secondary);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

/* Glass Button */
.glass-button {
  background: var(--bg-secondary);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
  color: var(--text-primary);
}

.glass-button:hover {
  transform: translateY(-2px);
  background: var(--bg-tertiary);
  border-color: var(--primary-color);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.glass-button:active {
  transform: translateY(0) scale(0.98);
}

/* Glass Input */
.glass-input {
  background: var(--bg-secondary);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.glass-input:focus {
  outline: none;
  background: var(--bg-tertiary);
  border-color: var(--primary-color);
  box-shadow:
    0 0 0 3px rgba(0, 120, 212, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.glass-input::placeholder {
  color: var(--text-muted);
}

/* Glass Navigation */
.glass-nav {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  color: var(--text-primary);
}

/* Glass Sidebar */
.glass-sidebar {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  color: var(--text-primary);
}

/* ========================================
   THEME AWARENESS
   ======================================== */

/* Light theme adjustments */
body.light .glass-base,
body.light .glass-light,
body.light .glass-medium,
body.light .glass-heavy {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

body.light .glass-card,
body.light .glass-modal,
body.light .glass-button,
body.light .glass-input,
body.light .glass-nav,
body.light .glass-sidebar {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* Dark theme adjustments */
body:not(.light) .glass-base,
body:not(.light) .glass-light,
body:not(.light) .glass-medium,
body:not(.light) .glass-heavy {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* Reduce effects on mobile for performance */
@media (max-width: 768px) {
  .glass-mobile-reduce {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .glass-mobile-disable {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-secondary);
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Respect user preferences for reduced motion */
@media (prefers-reduced-motion: reduce) {

  .glass-base,
  .glass-transition,
  .glass-transition-fast,
  .glass-transition-slow,
  .glass-button,
  .glass-input {
    transition: none;
  }

  .glass-hover:hover,
  .glass-hover-scale:hover,
  .glass-hover-lift:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {

  .glass-base,
  .glass-light,
  .glass-medium,
  .glass-heavy {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
  }

  .glass-dark-light,
  .glass-dark-medium,
  .glass-dark-heavy {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
  }
}

/* ========================================
   ADDITIONAL UTILITY CLASSES
   ======================================== */

/* Text color utilities */
.glass-text-primary {
  color: var(--text-primary);
}

.glass-text-secondary {
  color: var(--text-secondary);
}

.glass-text-muted {
  color: var(--text-muted);
}

/* Background utilities */
.glass-bg-primary {
  background: var(--bg-primary);
}

.glass-bg-secondary {
  background: var(--bg-secondary);
}

.glass-bg-tertiary {
  background: var(--bg-tertiary);
}

/* Border utilities */
.glass-border {
  border: 1px solid var(--border-color);
}

.glass-border-primary {
  border: 1px solid var(--primary-color);
}

.glass-border-success {
  border: 1px solid var(--success-color);
}

.glass-border-danger {
  border: 1px solid var(--danger-color);
}

.glass-border-warning {
  border: 1px solid var(--warning-color);
}

/* =============================================================================
   UNIVERSAL ANIMATIONS & KEYFRAMES
   ============================================================================= */

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInEdit {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes typingDots {
  0% {
    content: ".";
  }

  33% {
    content: "..";
  }

  66% {
    content: "...";
  }

  100% {
    content: ".";
  }
}

@keyframes pulse {
  50% {
    filter: brightness(1.2);
    transform: scale(1.1);
  }
}

/* Button Animation Keyframes */
@keyframes heartbeatPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 120, 212, 0.7);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(0, 120, 212, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 120, 212, 0);
  }
}

/* =============================================================================
   UNIVERSAL BUTTON ENHANCEMENTS
   ============================================================================= */

button {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

button:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  /* background: rgba(255, 255, 255, 0.25); */
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translate(-50%, -50%);
  z-index: 0;
}

button:hover:before {
  width: 120%;
  height: 120%;
}

button:active:before {
  width: 140%;
  height: 140%;
  transition: all 0.2s ease;
}

button>* {
  position: relative;
  z-index: 1;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

button:disabled:before {
  display: none;
}

/* =============================================================================
   AUTHENTICATION SYSTEM STYLES
   ============================================================================= */

/* Auth Overlay & Modal */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.5s ease-out;
}

.auth-modal {
  background: linear-gradient(145deg, #2d2d2d 0%, #1a1a1a 100%);
  border-radius: 20px;
  padding: 40px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  border: 1px solid #444;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0078d4, #00a1f1, #0078d4);
  background-size: 200% 100%;
  animation: gradientShift 3s ease-in-out infinite;
}

/* Auth Header */
.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header p {
  margin: 0;
  color: #b0b0b0;
  font-size: 16px;
  font-weight: 400;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 25px;
  background-color: #333;
  border-radius: 12px;
  padding: 4px;
  position: relative;
}

.auth-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  z-index: 1;
  overflow: hidden;
  transform: translateZ(0);
}

.auth-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.auth-tab:hover::before {
  left: 100%;
}

.auth-tab.active {
  color: white;
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  box-shadow: 0 4px 16px rgba(0, 120, 212, 0.4);
  transform: translateY(-2px) scale(1.02);
  animation: tabActivate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-tab:hover:not(.active) {
  color: #ccc;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.auth-tab:active {
  transform: translateY(0) scale(0.98);
  transition: all 0.1s ease;
}

@keyframes tabActivate {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
  }

  50% {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 120, 212, 0.6);
  }

  100% {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 120, 212, 0.4);
  }
}

/* Auth Forms */
.auth-form-container {
  position: relative;
  min-height: 200px;
}

.auth-form {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.auth-form.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Auth Input Groups */
.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-group input {
  width: 100%;
  padding: 16px 16px 12px 16px;
  border: 2px solid #444;
  border-radius: 12px;
  background-color: #2a2a2a;
  color: white;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.input-group input:focus {
  border-color: #0078d4;
  background-color: #333;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.input-group input:focus+label,
.input-group input:not(:placeholder-shown)+label {
  transform: translateY(-12px) scale(0.8);
  color: #0078d4;
}

.input-group label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 16px;
  pointer-events: none;
  transition: all 0.3s ease;
  background: #2a2a2a;
  padding: 0 4px;
}

/* Auth Buttons */
.auth-button {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.auth-button.primary {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(0, 120, 212, 0.3);
}

.auth-button.primary:hover {
  background: linear-gradient(135deg, #005a9e 0%, #004578 100%);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 30px rgba(0, 120, 212, 0.5);
  animation: authButtonRipple 0.4s ease;
}

.auth-button.primary:active {
  transform: translateY(-1px) scale(0.99);
  transition: all 0.1s ease;
}

.auth-button.secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.auth-button.secondary:hover {
  background: var(--border-color);
}

@keyframes authButtonRipple {
  0% {
    box-shadow: 0 12px 30px rgba(0, 120, 212, 0.5);
    background-size: 100% 100%;
  }

  50% {
    box-shadow: 0 16px 40px rgba(0, 120, 212, 0.7);
    background-size: 110% 110%;
  }

  100% {
    box-shadow: 0 12px 30px rgba(0, 120, 212, 0.5);
    background-size: 100% 100%;
  }
}

.auth-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Auth Button Loader */
.button-loader {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #444;
}

.auth-divider span {
  padding: 0 16px;
  color: #888;
  font-size: 14px;
  white-space: nowrap;
}

/* Social Auth Buttons */
.social-auth-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.auth-button.social {
  padding: 12px 16px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.auth-button.social.google:hover {
  background: rgba(66, 133, 244, 0.2);
  border-color: rgba(66, 133, 244, 0.4);
}

.auth-button.social.github:hover {
  background: rgba(51, 51, 51, 0.2);
  border-color: rgba(51, 51, 51, 0.4);
}

.auth-button.social.discord:hover {
  background: rgba(88, 101, 242, 0.2);
  border-color: rgba(88, 101, 242, 0.4);
}

/* Magic Link Section */
.magic-link-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #444;
}

/* Voice Button */
.voice-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  flex-shrink: 0;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.voice-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.voice-btn.listening {
  background: rgba(255, 0, 0, 0.3);
  border-color: rgba(255, 0, 0, 0.5);
  animation: pulse 1.5s infinite;
}

/* Rich Media Styles */
.chat-link {
  color: #0078d4;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
  font-weight: 500;
}

.chat-link:hover {
  color: #106ebe;
  border-bottom-color: #106ebe;
  text-decoration: none;
}

.code-block {
  background: rgba(30, 30, 30, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-language {
  font-size: 12px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
}

.copy-code-btn {
  background: rgba(0, 120, 212, 0.2);
  border: 1px solid rgba(0, 120, 212, 0.3);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.copy-code-btn:hover {
  background: rgba(0, 120, 212, 0.4);
  transform: scale(1.05);
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: transparent;
  border: none;
}

.code-block code {
  background: transparent;
  color: #f8f8f2;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
}

.inline-code {
  background: rgba(255, 255, 255, 0.1);
  color: #ff6b6b;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.9em;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Media Items */
.media-item {
  display: flex;
  gap: 16px;
  margin: 16px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.media-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 120, 212, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.video-thumbnail,
.article-thumbnail {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.media-content h4 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.4;
}

.media-content h4 a {
  color: #0078d4;
  text-decoration: none;
}

.media-content h4 a:hover {
  color: #106ebe;
  text-decoration: underline;
}

.media-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Weather Widget */
.weather-widget {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(41, 128, 185, 0.1));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  text-align: center;
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.temperature {
  font-size: 32px;
  font-weight: 700;
  color: #3498db;
}

.description {
  font-size: 18px;
  color: var(--text-primary);
  text-transform: capitalize;
}

.weather-details {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

/* News Items */
.news-item {
  margin: 16px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #0078d4;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.news-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.news-item h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  line-height: 1.4;
}

.news-item h4 a {
  color: var(--text-primary);
  text-decoration: none;
}

.news-item h4 a:hover {
  color: #0078d4;
  text-decoration: underline;
}

.news-item p {
  margin: 8px 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.news-item small {
  color: var(--text-muted);
  font-size: 12px;
}

/* Auth Footer */
.auth-footer {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #444;
}

.auth-footer p {
  margin: 0;
  color: #888;
  font-size: 14px;
}

/* =============================================================================
   AUTHENTICATION LIGHT MODE OVERRIDES
   ============================================================================= */

body.light .auth-overlay {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
}

body.light .auth-modal {
  background: linear-gradient(145deg, #ffffff 0%, #f5f5f5 100%);
  color: #333;
  border: 1px solid #e0e0e0;
}

body.light .auth-header h2 {
  background: linear-gradient(135deg, #333333 0%, #555555 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.light .auth-header p {
  color: #666;
}

body.light .auth-tabs {
  background-color: #e0e0e0;
}

body.light .auth-tab {
  color: #666;
}

body.light .auth-tab.active {
  color: white;
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
}

body.light .input-group input {
  background-color: #ffffff;
  color: #333;
  border: 2px solid #e0e0e0;
}

body.light .input-group input:focus {
  background-color: #f9f9f9;
  border-color: #0078d4;
}

body.light .input-group label {
  background: #ffffff;
  color: #666;
}

body.light .auth-footer {
  border-top: 1px solid #e0e0e0;
}

body.light .auth-footer p {
  color: #666;
}

/* Light mode auth enhancements */
body.light .auth-divider::before,
body.light .auth-divider::after {
  background: #e0e0e0;
}

body.light .auth-divider span {
  color: #666;
}

body.light .auth-button.social {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid #e0e0e0;
  color: #333;
}

body.light .magic-link-section {
  border-top: 1px solid #e0e0e0;
}

/* Light mode voice button */
body.light .voice-btn {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  color: #333;
}

body.light .voice-btn:hover {
  background: rgba(0, 0, 0, 0.15);
  border-color: #0078d4;
}

/* Light mode rich media */
body.light .chat-link {
  color: #0078d4;
}

body.light .code-block {
  background: rgba(248, 248, 248, 0.9);
  border: 1px solid #e0e0e0;
}

body.light .code-header {
  background: rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #e0e0e0;
}

body.light .code-language {
  color: #666;
}

body.light .code-block code {
  color: #333;
}

body.light .inline-code {
  background: rgba(0, 0, 0, 0.1);
  color: #d73a49;
  border: 1px solid #e0e0e0;
}

body.light .media-item {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid #e0e0e0;
}

body.light .media-item:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: #0078d4;
}

body.light .weather-widget {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.05));
  border: 1px solid rgba(52, 152, 219, 0.2);
}

body.light .news-item {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid #e0e0e0;
  border-left: 4px solid #0078d4;
}

body.light .news-item:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* =============================================================================
   SIGN OUT BUTTON
   ============================================================================= */

/* Sign Out Button */
.sign-out-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  background: rgba(255, 71, 87, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 71, 87, 0.4);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  box-shadow:
    0 4px 16px rgba(255, 71, 87, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  z-index: 1003;
}

.sign-out-btn:hover {
  background: rgba(255, 71, 87, 0.4);
  transform: translateY(-1px);
  box-shadow:
    0 6px 20px rgba(255, 71, 87, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 71, 87, 0.6);
}

/* =============================================================================
   MAIN CHAT LAYOUT
   ============================================================================= */

#chat-ui {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* =============================================================================
   SIDEBAR COMPONENTS
   ============================================================================= */

/* Sidebar Container */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #2b2b2b 0%, #1f1f1f 100%);
  padding: 15px;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #444;
  flex-shrink: 0;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  height: 100vh;
  position: relative;
}

/* Profile Section */
.profile-section {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-section:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 120, 212, 0.3);
  transform: translateY(-1px);
  box-shadow: 
    0 6px 20px rgba(0, 120, 212, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.profile-email {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.profile-status {
  font-size: 10px;
  color: #28a745;
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-status::before {
  content: "●";
  font-size: 8px;
  color: #28a745;
}

/* Light mode profile styles */
body.light .profile-section {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #333;
}

body.light .profile-section:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 120, 212, 0.3);
}

body.light .profile-avatar {
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
}

body.light .profile-name {
  color: #333;
}

body.light .profile-email {
  color: #666;
}

.sidebar.hidden {
  width: 0;
  padding: 0;
  border: none;
  box-shadow: none;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  position: fixed;
  top: 15px;
  left: 265.5px;
  width: 40px;
  height: 40px;
  border: none;
  background: #2b2b2b;
  color: white;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  font-size: 18px;
  z-index: 1002;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: #3a3a3a;
  transform: scale(1.05);
}

.sidebar-toggle.collapsed {
  left: 15px;
}

/* New Chat Button */
#new-chat {
  background: rgba(0, 120, 212, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 120, 212, 0.4);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow:
    0 4px 16px rgba(0, 120, 212, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

/* Add Set Button */
#add-set {
  background: rgba(40, 167, 69, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(40, 167, 69, 0.4);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 15px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow:
    0 4px 16px rgba(40, 167, 69, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

/* Chat History */
#chat-history {
  flex-grow: 1;
  overflow-y: auto;
  margin-top: 15px;
  padding-right: 5px;
}

#chat-history>div {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#chat-history>div:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

#chat-history button {
  margin-left: 10px;
  color: #bbb;
  font-size: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

#chat-history button:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

/* Struggle Tracker */
#struggle-tracker {
  margin-top: 0px;
  padding: 0px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 12px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

#struggle-tracker.hidden {
  display: none;
}

#struggle-tracker h4 {
  margin: 0 0 12px 0;
  color: #0078d4;
  font-size: 14px;
  font-weight: 600;
}

#struggle-list {
  line-height: 1.4;
}

#struggle-list>div {
  margin-bottom: 6px;
  padding: 4px 0;
  color: #e0e0e0;
  font-size: 11px;
}

/* =============================================================================
   SIDEBAR LIGHT MODE OVERRIDES
   ============================================================================= */

body.light .sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
  border-right: 2px solid #e0e0e0;
  color: #333;
}

body.light .sidebar-toggle {
  background: #ffffff;
  color: #333;
  border: 1px solid #e0e0e0;
}

body.light #chat-history>div {
  background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
  border: 1px solid #e0e0e0;
  color: #333;
}

body.light #chat-history>div:hover {
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
}

body.light #chat-history button {
  color: #666;
}

body.light #chat-history button:hover {
  color: #d32f2f;
  background: rgba(211, 47, 47, 0.1);
}

body.light #struggle-tracker {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  border: 1px solid #e0e0e0;
  color: #333;
}

body.light #struggle-list>div {
  color: #333;
}

/* =============================================================================
   MAIN CHAT AREA
   ============================================================================= */

/* Main Container */
.main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  transition: all 0.3s ease;
  overflow: hidden;
  margin-left: 0;
}

/* Chat Window */
#chat-window {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  background: rgba(18, 18, 18, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  overflow-anchor: auto;
}

/* Chat Placeholder */
.chat-placeholder {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Typing Animation */
.typing-animation {
  display: inline-block;
}

.typing-animation::after {
  content: "";
  animation: typingDots 1.5s infinite;
}

/* =============================================================================
   CHAT MESSAGES
   ============================================================================= */

/* Base Message Styles */
.chat-message {
  padding: 15px 18px;
  margin: 12px 0;
  border-radius: 18px;
  max-width: 75%;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
  animation: messageSlideIn 0.3s ease-out;
  position: relative;
}

/* User Messages */
.chat-message.user {
  background: rgba(0, 120, 212, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 120, 212, 0.4);
  align-self: flex-end;
  color: white;
  font-size: var(--chat-font-size);
  box-shadow:
    0 4px 16px rgba(0, 120, 212, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
}

/* Bot Messages */
.chat-message.bot {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  align-self: flex-start;
  color: #f1f1f1;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: var(--chat-font-size);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

/* Bot Message Content Styling */
.chat-message.bot pre {
  background-color: #1e1e1e;
  border-radius: 4px;
  padding: 12px;
  margin: 10px 0;
  overflow-x: auto;
  border: 1px solid #555;
  font-size: 14px;
}

.chat-message.bot code {
  background-color: #3d3d3d;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', Monaco, monospace;
  font-size: 14px;
  color: #f8f8f2;
}

.chat-message.bot pre code {
  background-color: transparent;
  padding: 0;
  color: #f8f8f2;
}

.chat-message.bot strong {
  font-weight: bold;
  color: #ffffff;
}

.chat-message.bot em {
  font-style: italic;
  color: #e0e0e0;
}

.chat-message.bot h1,
.chat-message.bot h2,
.chat-message.bot h3 {
  margin: 15px 0 10px 0;
  color: #0078d4;
  font-weight: bold;
}

.chat-message.bot h1 {
  font-size: 20px;
}

.chat-message.bot h2 {
  font-size: 18px;
}

.chat-message.bot h3 {
  font-size: 16px;
}

.chat-message.bot ul {
  margin: 10px 0;
  padding-left: 20px;
}

.chat-message.bot li {
  margin: 5px 0;
  list-style-type: disc;
}

/* =============================================================================
   MESSAGE ACTION BUTTONS (Edit & Copy)
   ============================================================================= */

/* Edit Button */
.edit-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chat-message.user:hover .edit-button {
  opacity: 1;
  transform: translate3d(-10px, 0, 0);
}

.edit-button:hover {
  background: rgba(0, 120, 212, 0.8);
  border-color: #0078d4;
  transform: scale(1.05);
  animation: pulse 0.7s infinite;
}

.edit-button.copied {
  background: rgba(40, 167, 69, 0.8);
  border-color: #28a745;
}

.edit-button.copied:hover {
  background: rgba(40, 167, 69, 0.9);
}

/* Copy Button */
.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.chat-message.bot:hover .copy-button {
  opacity: 1;
  transform: translate3d(-10px, 0, 0);
}

.copy-button:hover {
  background: rgba(0, 120, 212, 0.8);
  border-color: #0078d4;
  transform: scale(1.05);
}

.copy-button.copied {
  background: rgba(40, 167, 69, 0.8);
  border-color: #28a745;
}

.copy-button.copied:hover {
  background: rgba(40, 167, 69, 0.9);
}

/* =============================================================================
   EDIT INTERFACE
   ============================================================================= */

/* Edit Interface Container */
.edit-interface {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  animation: slideInEdit 0.3s ease-out;
}

/* Edit Textarea */
.edit-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: white;
  font-family: inherit;
  font-size: 0.9em;
  resize: vertical;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.edit-textarea::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.edit-textarea:focus {
  outline: none;
  border-color: #0078d4;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px rgba(0, 120, 212, 0.3);
}

/* Edit Buttons Container */
.edit-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Edit Action Buttons */
.save-button-edit,
.cancel-button {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.save-button-edit {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.4);
  color: white;
  box-shadow:
    0 4px 12px rgba(16, 185, 129, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.save-button-edit:hover {
  animation: pulse 0.7s infinite;
}

.cancel-button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* =============================================================================
   CHAT INPUT FORM (GLASSMORPHISM)
   ============================================================================= */

/* Form Container with Glass Effect */
form#chat-form {
  padding: 16px;
  background: rgba(255, 255, 255, 0.01);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

form#chat-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  z-index: 0;
}

/* Input Container with Glass Effect */
.input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  max-width: 100%;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.input-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  z-index: 0;
}

.input-container:focus-within {
  border-color: rgba(0, 120, 212, 0.6);
  background: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 0 20px rgba(0, 120, 212, 0.4),
    0 4px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.02);
}

/* Text Input with Glass Effect */
form#chat-form input[type="text"] {
  flex-grow: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  font-size: 14px;
  outline: none;
  min-width: 0;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

form#chat-form input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

form#chat-form input[type="text"]:focus {
  background: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 0 15px rgba(0, 120, 212, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

form#chat-form input[type="text"]:disabled {
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.05);
}

/* File Upload Button with Glass Effect */
.file-upload-btn {
  padding: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  flex-shrink: 0;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.file-upload-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.file-upload-btn:hover::before {
  left: 100%;
}

.file-upload-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.file-upload-btn:active {
  transform: translateY(0) scale(0.95);
  transition: all 0.1s ease;
}

/* Send Button with Glass Effect */
form#chat-form button {
  padding: 12px 20px;
  background: rgba(0, 120, 212, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 120, 212, 0.4);
  color: white;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow:
    0 4px 16px rgba(0, 120, 212, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-size: 14px;
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

form#chat-form button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
}

form#chat-form button:hover::before {
  left: 100%;
}

form#chat-form button:hover {
  background: rgba(0, 120, 212, 0.5);
  border-color: rgba(0, 120, 212, 0.7);
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 12px 40px rgba(0, 120, 212, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: sendButtonPulse 1s ease-in-out infinite;
}

form#chat-form button:active {
  transform: translateY(-1px) scale(0.98);
  animation: sendButtonRipple 0.4s ease-out;
  transition: all 0.1s ease;
}

form#chat-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  animation: none !important;
}

/* Send Button Animations */
@keyframes sendButtonPulse {

  0%,
  100% {
    box-shadow:
      0 12px 40px rgba(0, 120, 212, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }

  50% {
    box-shadow:
      0 16px 50px rgba(0, 120, 212, 0.8),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
}

@keyframes sendButtonRipple {
  0% {
    box-shadow:
      0 0 0 0 rgba(0, 120, 212, 0.7),
      0 12px 40px rgba(0, 120, 212, 0.6);
  }

  70% {
    box-shadow:
      0 0 0 10px rgba(0, 120, 212, 0),
      0 12px 40px rgba(0, 120, 212, 0.4);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(0, 120, 212, 0),
      0 12px 40px rgba(0, 120, 212, 0.6);
  }
}

/* =============================================================================
   CHAT LIGHT MODE OVERRIDES
   ============================================================================= */

body.light .main {
  background-color: #f5f5f5;
}

body.light #chat-window {
  background-color: #ffffff;
  color: #333;
}

body.light .chat-message.user {
  background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
  color: white;
}

body.light .chat-message.bot {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  color: #333;
  border: 1px solid #e0e0e0;
}

body.light .chat-message.bot pre {
  background-color: #f8f8f8;
  border: 1px solid #e0e0e0;
}

body.light .chat-message.bot code {
  background-color: #f0f0f0;
  color: #333;
}

body.light .chat-message.bot h1,
body.light .chat-message.bot h2,
body.light .chat-message.bot h3 {
  color: #0078d4;
}

body.light .chat-placeholder {
  color: #666;
}

/* Light Mode Overrides for Glassmorphism Chat Input */
body.light form#chat-form {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.light form#chat-form::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.15) 100%);
}

body.light .input-container {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.light .input-container::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
}

body.light .input-container:focus-within {
  border-color: rgba(0, 120, 212, 0.6);
  background: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 20px rgba(0, 120, 212, 0.3),
    0 4px 20px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light form#chat-form input[type="text"] {
  color: #333;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.light form#chat-form input[type="text"]::placeholder {
  color: rgba(0, 0, 0, 0.6);
}

body.light form#chat-form input[type="text"]:focus {
  background: rgba(255, 255, 255, 0.4);
  box-shadow:
    0 0 15px rgba(0, 120, 212, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.light .file-upload-btn {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #333;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.light .file-upload-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.light form#chat-form button {
  background: rgba(0, 120, 212, 0.2);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 120, 212, 0.3);
  box-shadow:
    0 4px 16px rgba(0, 120, 212, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.light form#chat-form button:hover {
  background: rgba(0, 120, 212, 0.3);
  border-color: rgba(0, 120, 212, 0.5);
  box-shadow:
    0 12px 40px rgba(0, 120, 212, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* =============================================================================
   SETTINGS SYSTEM
   ============================================================================= */

/* Settings Button */
#settings-button {
  position: fixed;
  top: 20px;
  right: 130px;
  padding: 10px 20px;
  background: rgba(0, 120, 212, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 120, 212, 0.4);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  box-shadow:
    0 4px 16px rgba(0, 120, 212, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1003;
  overflow: hidden;
  transform: translateZ(0);
}

#settings-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

#settings-button:hover::before {
  left: 100%;
}

#settings-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  /* background: rgba(255, 255, 255, 0.3); */
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
}

#settings-button:hover::after {
  width: 120%;
  height: 120%;
}

#settings-button>* {
  position: relative;
  z-index: 1;
}

#settings-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

#settings-button:hover {
  background: linear-gradient(135deg, #005a9e 0%, #004578 100%);
  transform: translateY(-4px) scale(1.05) rotateX(10deg);
  box-shadow: 0 12px 40px rgba(0, 120, 212, 0.6);
  animation: settingsButtonPulse 0.8s ease-in-out;
}

#settings-button:active {
  transform: translateY(-2px) scale(0.98);
  transition: all 0.15s ease;
  animation: settingsButtonRipple 0.6s ease-out;
}

@keyframes settingsButtonPulse {

  0%,
  100% {
    box-shadow: 0 12px 40px rgba(0, 120, 212, 0.6);
  }

  50% {
    box-shadow: 0 16px 50px rgba(0, 120, 212, 0.8);
  }
}

@keyframes settingsButtonRipple {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 120, 212, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(0, 120, 212, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 120, 212, 0);
  }
}

/* Settings Modal Overlay */
.settings-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  z-index: 2000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
  align-items: center;
  justify-content: center;
}

.settings-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Settings Modal Content */
.settings-modal-content {
  background: rgba(255, 255, 255, 0.33);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
  border: 1px solid var(--border-color);
  position: relative;
  /* Add this */
  backdrop-filter: blur(20px);
  /* Glassmorphism effect */
  -webkit-backdrop-filter: blur(20px);
  /* For Safari */
}

/* Settings Header */
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px 20px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.settings-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.close-button {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.close-button:hover {
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* Settings Body */
.settings-body {
  padding: 24px;
}

.setting-item {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.setting-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.setting-item label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

/* Theme Toggle */
.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-color, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.theme-toggle-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
}

.theme-toggle-container:hover::before {
  left: 100%;
}

.theme-toggle-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color, #3b82f6);
}

.theme-info {
  flex: 1;
  margin-right: 16px;
}

.theme-title {
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.4;
}

.theme-description {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  margin-top: 4px;
  line-height: 1.5;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.theme-toggle-container:hover .theme-description {
  opacity: 1;
}

.toggle-switch {
  position: relative;
  width: 64px;
  height: 32px;
  background: var(--toggle-bg, #e5e7eb);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.toggle-switch:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toggle-switch.active {
  background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--primary-dark, #2563eb));
  border-color: var(--primary-light, #60a5fa);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-slider::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--slider-icon, #d1d5db);
  transition: all 0.3s ease;
  opacity: 0.6;
}

.toggle-switch.active .toggle-slider {
  transform: translateX(32px);
  background: linear-gradient(135deg, #ffffff, #f0f9ff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.toggle-switch.active .toggle-slider::before {
  background: var(--primary-color, #3b82f6);
  opacity: 1;
}

/* Enhanced states */
.toggle-switch:focus-visible {
  outline: 2px solid var(--primary-color, #3b82f6);
  outline-offset: 2px;
}

.toggle-switch:active {
  transform: scale(0.95);
}

.toggle-switch.active:active {
  transform: scale(0.95);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .theme-toggle-container,
  .toggle-switch,
  .toggle-slider,
  .theme-description {
    transition: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .theme-toggle-container {
    background: var(--surface-color, #1f2937);
    border-color: var(--border-color, #374151);
  }

  .theme-title {
    color: var(--text-primary, #f9fafb);
  }

  .theme-description {
    color: var(--text-muted, #9ca3af);
  }

  .toggle-switch {
    background: var(--toggle-bg, #374151);
  }
}

/* Animation for initial load */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.theme-toggle-container {
  animation: slideIn 0.5s ease-out;
}

/* Ripple effect on click */
.toggle-switch {
  overflow: hidden;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.toggle-switch:active::after {
  width: 80px;
  height: 80px;
}

/* Range Sliders - Enhanced with increased length and visual appeal */
.range-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px; /* Increased horizontal padding */
  border-radius: 14px; /* Slightly more rounded */
  background: var(--surface-color, rgba(255, 255, 255, 0.08)); /* Softer base background */
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15)); /* Lighter border */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  gap: 18px; /* Slightly more spacing */
  margin-top: 14px; /* Increased spacing */
  width: 100%;
  backdrop-filter: blur(12px); /* Subtle blur */
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.1), /* Reduced shadow intensity */
    inset 0 1px 0 rgba(255, 255, 255, 0.08); /* Softer inset */
}

.range-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent); /* Subtler gradient */
  transition: left 0.5s ease;
}

.range-container:hover::before {
  left: 100%;
}

.range-container:hover {
  transform: translateY(-3px); /* Slightly larger lift on hover */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); /* Increased shadow on hover */
  border-color: var(--primary-color, rgba(59, 130, 246, 0.8)); /* Softer primary color on border */
}

#response-length,
#creativity,
#font-size {
  flex: 1;
  min-width: 220px; /* Further Increased minimum width */
  height: 18px; /* Further Increased height for better visibility */
  border-radius: 18px; /* More rounded */
  background: linear-gradient(135deg,
      rgba(0, 120, 212, 0.85) 0%,
      rgba(0, 120, 212, 0.7) var(--slider-value, 50%),
      rgba(255, 255, 255, 0.18) var(--slider-value, 50%),
      rgba(255, 255, 255, 0.1) 100%);
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: visible;
  /* Enhanced glassmorphism effect */
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 7px 22px rgba(0, 120, 212, 0.28),
    0 3px 9px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

#response-length:hover,
#creativity:hover,
#font-size:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

#response-length:focus,
#creativity:focus,
#font-size:focus {
  box-shadow:
    0 0 0 3px rgba(var(--primary-color-rgb, 59, 130, 246), 0.35),
    0 7px 22px rgba(0, 0, 0, 0.25);
}

/* Enhanced Webkit thumb styling */
#response-length::-webkit-slider-thumb,
#creativity::-webkit-slider-thumb,
#font-size::-webkit-slider-thumb {
  appearance: none;
  width: 30px;
  /* Increased size */
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg,
      var(--primary-color) 0%,
      var(--primary-hover, var(--primary-color)) 50%,
      rgba(255, 255, 255, 0.25) 100%);
  border: 3px solid rgba(255, 255, 255, 0.93);
  cursor: pointer;
  position: relative;
  box-shadow:
    0 7px 22px rgba(0, 120, 212, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#response-length::-webkit-slider-thumb:hover,
#creativity::-webkit-slider-thumb:hover,
#font-size::-webkit-slider-thumb:hover {
  background: linear-gradient(135deg, var(--primary-hover, var(--primary-color)), var(--primary-color));
  transform: scale(1.18);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.45),
    0 5px 11px rgba(0, 0, 0, 0.38),
    0 0 0 9px rgba(var(--primary-color-rgb, 59, 130, 246), 0.12);
}

#response-length::-webkit-slider-thumb:active,
#creativity::-webkit-slider-thumb:active,
#font-size::-webkit-slider-thumb:active {
  transform: scale(1.08);
  box-shadow:
    0 3px 9px rgba(0, 0, 0, 0.35),
    0 0 0 13px rgba(var(--primary-color-rgb, 59, 130, 246), 0.17);
}

/* Firefox thumb styling */
#response-length:-moz-range-thumb,
#creativity:-moz-range-thumb,
#font-size::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover, var(--primary-color)));
  border: 3px solid white;
  cursor: pointer;
  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.35),
    0 3px 5px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#response-length::-moz-range-thumb:hover,
#creativity::-moz-range-thumb:hover,
#font-size::-moz-range-thumb:hover {
  background: linear-gradient(135deg, var(--primary-hover, var(--primary-color)), var(--primary-color));
  transform: scale(1.18);
}

/* Firefox track styling */
#response-length::-moz-range-track,
#creativity::-moz-range-track,
#font-size::-moz-range-track {
  background: transparent;
  border: none;
  height: 14px;
  border-radius: 14px;
}

/* Enhanced value display with premium styling */
.range-value {
  min-width: 65px;
  /* Increased width */
  text-align: center;
  font-weight: 800;
  color: var(--text-primary);
  background: linear-gradient(135deg,
      rgba(0, 120, 212, 0.25) 0%,
      rgba(0, 120, 212, 0.15) 50%,
      rgba(255, 255, 255, 0.15) 100%);
  padding: 11px 18px;
  /* Increased padding */
  border-radius: 18px;
  /* Increased border radius */
  font-size: 16px;
  /* Slightly larger font */
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(0, 120, 212, 0.35);
  box-shadow:
    0 7px 22px rgba(0, 120, 212, 0.25),
    0 3px 9px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.range-value::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  transition: left 0.4s ease;
}

.range-value:hover::before {
  left: 100%;
}

.range-value:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Optional: Add a subtle pulse animation for active state */
#response-length:active::-webkit-slider-thumb,
#creativity:active::-webkit-slider-thumb,
#font-size:active::-webkit-slider-thumb {
  animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb, 59, 130, 246), 0.4);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(var(--primary-color-rgb, 59, 130, 246), 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb, 59, 130, 246), 0);
  }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {

  #response-length,
  #creativity,
  #font-size {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
}

/* Accessibility improvements */
#response-length:focus-visible,
#creativity:focus-visible,
#font-size:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

  #response-length,
  #creativity,
  #font-size,
  #response-length::-webkit-slider-thumb,
  #creativity::-webkit-slider-thumb,
  #font-size::-webkit-slider-thumb,
  #response-length::-moz-range-thumb,
  #creativity::-moz-range-thumb,
  #font-size::-moz-range-thumb,
  #response-length,
  #creativity,
  #font-size {
    transition: none;
  }

  #response-length:active::-webkit-slider-thumb,
  #creativity:active::-webkit-slider-thumb,
  #font-size:active::-webkit-slider-thumb {
    animation: none;
  }
}

/* Select Dropdown */
.custom-select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.custom-select:hover,
.custom-select:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* Enhanced dropdown styling */
#style {
  width: 100%;
  padding: 14px 20px; /* Increased padding */
  border: 2px solid var(--border-color); /* Using CSS variable */
  border-radius: 12px; /* More rounded corners */
  background: var(--bg-secondary); /* Using CSS variable */
  color: var(--text-primary); /* Using CSS variable */
  font-size: 16px; /* Slightly larger font size */
  outline: none;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23" +
    encodeURIComponent(getComputedStyle(document.documentElement).getPropertyValue('--text-muted').slice(1)) + "' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E"); /* Dynamic arrow color */
  background-position: right 16px center; /* Adjusted arrow position */
  background-repeat: no-repeat;
  background-size: 18px; /* Slightly larger arrow */
  padding-right: 45px; /* Adjusted padding for arrow */
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle inset shadow */
}

#style:focus {
  border-color: var(--primary-color); /* Using CSS variable */
  background: var(--bg-tertiary); /* Using CSS variable */
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.3);
  transform: translateY(-3px) scale(1.03); /* Enhanced focus effect */
}

#style:hover {
  border-color: var(--primary-color); /* Using CSS variable */
  background: var(--bg-tertiary); /* Using CSS variable */
  transform: translateY(-2px) scale(1.02); /* Enhanced hover effect */
  box-shadow: 0 6px 20px rgba(0, 120, 212, 0.3);
}

#style:active {
  transform: translateY(0) scale(1);
  transition: all 0.1s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle active shadow */
}

#style option {
  background-color: var(--bg-primary); /* Using CSS variable */
  color: var(--text-primary); /* Using CSS variable */
  font-size: 15px; /* Slightly larger option font */
  padding: 8px 12px; /* Padding for options */
}

/* Profile Section */
.profile-picture-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#profile-picture-preview {
  transition: all 0.3s ease;
  cursor: pointer;
}

#profile-picture-preview:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#change-picture-btn {
  transition: all 0.3s ease;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
}

#change-picture-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

#display-name-input {
  transition: all 0.3s ease;
  font-size: 14px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

#display-name-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

/* Light mode profile styles */
body.light #profile-picture-preview {
  border-color: var(--border-color);
  background: var(--bg-secondary);
}

body.light #change-picture-btn {
  background: var(--primary-color);
  color: white;
}

body.light #display-name-input {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* Settings Footer */
.settings-footer {
  padding: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: var(--bg-tertiary);
  border-radius: 0 0 16px 16px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* Success Message */
.success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--success-color);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  z-index: 3000;
}

.success-message.show {
  opacity: 1;
  transform: translateX(0);
}

/* =============================================================================
   SETTINGS LIGHT MODE OVERRIDES
   ============================================================================= */

body.light .settings-modal-content {
  background: linear-gradient(145deg, #ffffff 0%, #f5f5f5 100%);
  border: 1px solid #e0e0e0;
  color: #333;
}

body.light .settings-body {
  color: #333;
}

body.light .settings-footer {
  border-top: 1px solid #e0e0e0;
}

body.light .setting-item label {
  color: #333;
}

body.light #response-length {
  background-color: #ffffff;
  border: 2px solid #e0e0e0;
  color: #333;
}

body.light #response-length:focus {
  border-color: #0078d4;
  background-color: #f9f9f9;
}

body.light #style {
  background-color: #ffffff;
  border: 2px solid #e0e0e0;
  color: #333;
}

body.light #style:focus {
  border-color: #0078d4;
  background-color: #f9f9f9;
}

body.light #style option {
  background-color: #ffffff;
  color: #333;
}

body.light .slider {
  background-color: #ccc;
}

body.light input:checked+.slider {
  background-color: #0078d4;
}

/* =============================================================================
   LEARNING PROGRESS MODAL STYLES
   ============================================================================= */

/* Learning Progress Modal Overlay */
.learning-progress-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  z-index: 2500;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.4s ease;
  align-items: center;
  justify-content: center;
}

.learning-progress-overlay.show {
  display: flex;
}

/* Learning Progress Modal Content */
.learning-progress-modal {
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, 
    rgba(0, 120, 212, 0.1) 0%, 
    rgba(0, 120, 212, 0.05) 100%);
  border-radius: 20px 20px 0 0;
}

.modal-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Modal Body */
.modal-body {
  padding: 32px;
}

/* Progress Stats Grid */
.progress-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 
    0 8px 25px rgba(0, 120, 212, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Achievement Grid */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.achievement-card {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.08) 0%, 
    rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.achievement-card.unlocked {
  background: linear-gradient(135deg, 
    rgba(34, 197, 94, 0.15) 0%, 
    rgba(34, 197, 94, 0.08) 100%);
  border-color: rgba(34, 197, 94, 0.3);
}

.achievement-card.unlocked:hover {
  background: linear-gradient(135deg, 
    rgba(34, 197, 94, 0.2) 0%, 
    rgba(34, 197, 94, 0.1) 100%);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(34, 197, 94, 0.4);
  
}

.achievement-card.locked {
  opacity: 0.6;
  background: linear-gradient(135deg,
    rgba(255, 0, 0, 0.05) 0%,
    rgba(255, 0, 0, 0.02) 100%);
  border-color: rgba(255, 0, 0, 0.05);
}

.achievement-card.locked:hover {
  background: linear-gradient(135deg, 
    rgba(255, 0, 0, 0.2) 0%, 
    rgba(255, 0, 0, 0.1) 100%);
  box-shadow: 0 8px 25px rgba(255, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.4);

}

.achievement-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.achievement-info h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.achievement-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Topics Progress */
.topics-progress {
  margin-top: 32px;
}

.topic-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.topic-name {
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
}

.topic-stars {
  color: #ffd700;
  font-size: 16px;
}

/* Learning Progress Modal Button */
.learning-progress-btn {
  background: linear-gradient(135deg, 
    rgba(16, 124, 16, 0.3) 0%, 
    rgba(16, 124, 16, 0.2) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(16, 124, 16, 0.4);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 8px;
  display: block;
  width: 100%;
  box-shadow: 
    0 4px 12px rgba(16, 124, 16, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.learning-progress-btn:hover {
  background: linear-gradient(135deg, 
    rgba(16, 124, 16, 0.4) 0%, 
    rgba(16, 124, 16, 0.3) 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px rgba(16, 124, 16, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* =============================================================================
   MOBILE RESPONSIVE DESIGN
   ============================================================================= */

/* Mobile Overlay for Sidebar */
@media (max-width: 768px) {
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* Mobile sidebar adjustments */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 1001;
    transform: translateX(-100%);
    border-right: none;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
  }

  .sidebar:not(.hidden) {
    transform: translateX(0);
  }

  /* Mobile toggle positioning */
  .sidebar-toggle {
    left: 15px;
    top: 15px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  /* Mobile main area adjustments */
  .main {
    width: 100%;
    margin-left: 0;
  }

  /* Mobile chat window adjustments */
  #chat-window {
    padding: 15px 10px;
  }

  /* Mobile chat message adjustments */
  .chat-message {
    max-width: 85%;
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 15px;
  }

  /* Mobile input form adjustments */
  form#chat-form {
    padding: 10px 8px;
  }

  .input-container {
    gap: 6px;
    padding: 5px;
    border-radius: 10px;
  }

  form#chat-form input[type="text"] {
    padding: 10px 12px;
    font-size: 16px;
    /* Prevents zoom on iOS */
  }

  .file-upload-btn {
    min-width: 36px;
    height: 36px;
    font-size: 18px;
  }

  form#chat-form button {
    padding: 10px 14px;
    font-size: 14px;
  }

  /* Mobile edit/copy button adjustments */
  .edit-button,
  .copy-button {
    opacity: 1;
    /* Always visible on mobile */
    top: 6px;
    right: 6px;
    padding: 4px 6px;
    font-size: 11px;
  }

  /* Mobile struggle tracker adjustments */
  #struggle-tracker {
    padding: 12px;
    margin-top: 15px;
  }

  #struggle-list>div {
    font-size: 12px;
  }

  /* Mobile auth modal adjustments */
  .auth-modal {
    padding: 30px 25px;
    margin: 20px;
    max-width: none;
    width: calc(100% - 40px);
  }

  .auth-header h2 {
    font-size: 24px;
  }

  .input-group input {
    padding: 14px;
    font-size: 16px;
    /* Prevents zoom on iOS */
  }

  /* Mobile sign out button adjustments */
  .sign-out-btn {
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    font-size: 13px;
  }

  /* Mobile settings button adjustments */
  #settings-button {
    top: 15px;
    right: auto;
    left: 15px;
    padding: 8px 16px;
    font-size: 13px;
  }

  /* Mobile settings modal adjustments */
  .settings-modal-content {
    width: 95%;
    margin: 20px;
  }

  .settings-header,
  .settings-body,
  .settings-footer {
    padding: 16px;
  }

  .settings-footer {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
  .sidebar {
    width: 100vw;
    max-width: 320px;
  }

  #chat-window {
    padding: 10px 8px;
  }

  .chat-message {
    max-width: 90%;
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 12px;
    font-size: 14px;
  }

  form#chat-form {
    padding: 8px 6px;
  }

  .input-container {
    gap: 4px;
    padding: 4px;
  }

  form#chat-form input[type="text"] {
    padding: 8px 10px;
  }

  .file-upload-btn {
    min-width: 34px;
    height: 34px;
    font-size: 16px;
  }

  form#chat-form button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .edit-button,
  .copy-button {
    top: 4px;
    right: 4px;
    padding: 3px 5px;
    font-size: 10px;
  }

  #struggle-tracker {
    padding: 10px;
    margin-top: 12px;
    font-size: 11px;
  }

  #settings-button {
    left: auto;
  }
}

/* Heartbeat Animation to Buttons */
button:hover {
  animation: heartbeatPulse 1.5s ease infinite;
}

/* Center the Settings Modal */
.settings-modal-content {
  margin: auto;
  /* Center horizontally */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
