/* Modern CSS Variables for Light/Dark Themes */
:root[data-theme="light"] {
  /* Colors */
  --primary-color: #0066ff;
  --primary-hover: #0052cc;
  --secondary-color: #6b7280;
  --accent-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;

  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-chat: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #e2e8f0;

  /* Text */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  /* Borders */
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-strong: #94a3b8;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-chat: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

:root[data-theme="dark"] {
  /* Colors */
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --secondary-color: #9ca3af;
  --accent-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;

  /* Backgrounds */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-chat: #1e293b;
  --bg-sidebar: #0f172a;
  --bg-input: #334155;
  --bg-hover: #334155;
  --bg-active: #475569;

  /* Text */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #0f172a;

  /* Borders */
  --border-light: #334155;
  --border-medium: #475569;
  --border-strong: #64748b;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-chat: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Layout */
.app {
  display: flex;
  height: 100vh;
  background: var(--bg-primary);
}

/* Mobile Header */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem; /* Reduced vertical padding to fit 60px */
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  z-index: 100;
  height: 60px; /* Fixed height for consistent calculation */
  box-sizing: border-box; /* Include padding in height calculation */
}

.mobile-header h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.menu-toggle, .theme-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.menu-toggle:hover, .theme-toggle:hover {
  background: var(--bg-hover);
}

.menu-toggle i, .theme-toggle i {
  font-size: 1.25rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Sidebar */
.sidebar {
  width: 320px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 10;
  user-select: none;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 64px;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.sidebar-collapse-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-collapse-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-collapse-btn i {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.desktop-theme-toggle {
  display: block;
}

.sidebar-actions {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.new-chat-btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  background: var(--gradient-primary);
  color: var(--text-inverse);
  border: none;
  padding: 0;
  border-radius: 0.75rem;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.new-chat-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.conversations-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-container {
  position: relative;
  flex: 1;
}

.search-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-icon {
  position: absolute;
  right: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.5rem 0.5rem;
}

.conversation-item {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 1px;
  gap: 0.5rem;
  height: 32px;
}

.conversation-item:hover {
  background: var(--bg-hover);
}

.conversation-item.active {
  background: var(--bg-active);
}

.conversation-icon {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.conversation-item.active .conversation-icon,
.conversation-item:hover .conversation-icon {
  color: var(--primary-color);
}

.conversation-title {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.conversation-time {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
  opacity: 0.7;
}

.conversation-item:hover .conversation-time {
  display: none;
}

.conversation-actions {
  display: none;
  gap: 0.125rem;
}

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

.action-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.action-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.delete-btn:hover {
  color: var(--danger-color);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-tertiary);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-chat);
  overflow: hidden;
}

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

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Welcome Screen */
.welcome-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.welcome-content {
  text-align: center;
  max-width: 600px;
}

.welcome-icon {
  margin-bottom: 2rem;
}

.welcome-icon i {
  font-size: 4rem;
  color: var(--primary-color);
}

.welcome-content h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.welcome-content p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 3rem;
}

.welcome-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.mode-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-light);
  border-radius: 1rem;
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.mode-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.mode-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: auto;
}

.mode-card.disabled:hover {
  border-color: var(--border-light);
  transform: none;
  box-shadow: none;
}

.mode-card i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.mode-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.mode-card p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.3;
  margin: 0;
}

/* Welcome Modules Section */
.welcome-modules-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.welcome-modules-divider {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 0 auto 1.5rem;
}

.welcome-modules-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.welcome-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
}

.welcome-module-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 2rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

.welcome-module-card:hover {
  background: var(--bg-secondary);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.welcome-module-card i {
  font-size: 1.125rem;
  color: var(--primary-color);
}

.welcome-module-card .module-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Messages */
.message {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

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

.message-avatar {
  width: 2rem;
  height: 2rem;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--primary-color);
  color: var(--text-inverse);
}

.message.assistant .message-avatar {
  background: var(--accent-color);
  color: var(--text-inverse);
}

.message-avatar i {
  font-size: 1rem;
}

/* Edit source thumbnail - circular mini preview */
.edit-source-thumbnail {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--primary-color);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.edit-source-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message.has-edit-thumbnail {
  gap: 0.5rem;
}

.message.has-edit-thumbnail .message-avatar {
  display: none;
}

.message-content {
  flex: 1;
  max-width: 70%;
  position: relative;
}

.message.user .message-content {
  text-align: right;
}

/* Processing Indicator for long operations */
.processing-message {
  animation: fadeIn 0.3s ease;
}

.processing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(79, 70, 229, 0.1));
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: 12px;
  color: var(--text-color);
  font-size: 14px;
}

.processing-indicator i {
  font-size: 20px;
  color: #9333ea;
}

.processing-indicator span {
  opacity: 0.9;
}

/* Model Info Badge - Mini subtle tag */
.model-info-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  opacity: 0.6;
  transition: all 0.2s ease;
  cursor: help;
  z-index: 100;
  pointer-events: all;
  backdrop-filter: blur(4px);
}

.model-info-badge:hover {
  opacity: 1;
  transform: scale(1.2);
  background: rgba(0, 0, 0, 0.7);
}

.model-info-badge i {
  font-size: 14px;
  color: #ffffff;
}

/* Model Tooltip */
.model-tooltip {
  position: absolute;
  bottom: -32px;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.model-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 6px;
  border: 5px solid transparent;
  border-bottom-color: rgba(0, 0, 0, 0.9);
}

.model-info-badge:hover .model-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-4px);
}

.message-text {
  background: var(--bg-secondary);
  padding: 0.875rem 1rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-primary) !important; /* Force text color */
  word-wrap: break-word;
  margin-bottom: 0.25rem;
}

/* Ensure all text inside message-text uses correct color */
.message-text * {
  color: inherit;
}

/* Markdown Styles for Assistant Messages */
.message.assistant .message-text {
  white-space: normal;
}

.message.assistant .message-text h1,
.message.assistant .message-text h2,
.message.assistant .message-text h3,
.message.assistant .message-text h4,
.message.assistant .message-text h5,
.message.assistant .message-text h6 {
  margin: 1rem 0 0.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.message.assistant .message-text h1:first-child,
.message.assistant .message-text h2:first-child,
.message.assistant .message-text h3:first-child {
  margin-top: 0;
}

.message.assistant .message-text h1 { font-size: 1.5rem; }
.message.assistant .message-text h2 { font-size: 1.3rem; }
.message.assistant .message-text h3 { font-size: 1.1rem; }
.message.assistant .message-text h4 { font-size: 1rem; }

.message.assistant .message-text p {
  margin: 0.5rem 0;
}

.message.assistant .message-text ul,
.message.assistant .message-text ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.message.assistant .message-text li {
  margin: 0.25rem 0;
}

.message.assistant .message-text code {
  background: var(--bg-tertiary);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
}

.message.assistant .message-text pre {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}

.message.assistant .message-text pre code {
 
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
 
}


.message.assistant .message-text blockquote {
  border-left: 3px solid var(--primary-color);
  margin: 0.75rem 0;
  padding-left: 1rem;
  color: var(--text-secondary);
}

.message.assistant .message-text strong {
  font-weight: 600;
}

.message.assistant .message-text em {
  font-style: italic;
}

.message.assistant .message-text a {
  color: var(--primary-color);
  text-decoration: underline;
}

.message.assistant .message-text a:hover {
  color: var(--primary-hover);
}

.message.assistant .message-text hr {
  margin: 1rem 0;
  border: none;
  border-top: 1px solid var(--border-light);
}

.message.assistant .message-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
}

.message.assistant .message-text th,
.message.assistant .message-text td {
  padding: 0.5rem;
  border: 1px solid var(--border-light);
  text-align: left;
}

.message.assistant .message-text th {
  background: var(--bg-tertiary);
  font-weight: 600;
}

.message.user .message-text {
  background: var(--gradient-primary);
  color: #ffffff !important;
  border-bottom-right-radius: 0.25rem;
  white-space: pre-wrap;
}

.message.user .message-text * {
  color: #ffffff !important;
}

.message.assistant .message-text {
  border-bottom-left-radius: 0.25rem;
}

.message-image {
  position: relative;
  display: flex;
  justify-content: center;
  border-radius: 0.75rem;
  margin: 0.5rem 0;
  padding: 0.25rem;
  box-shadow: var(--shadow-md);
}

.message-image img {
  max-width: 500px;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.75rem;
}

.image-download-btn {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
}

.image-download-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.image-download-btn i {
  font-size: 1rem;
}

/* Multimedia Content Styles */
.message-media {
  margin-bottom: 0.5rem;
}

.message-video {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--bg-tertiary);
  margin: 0.5rem auto;
  max-width: 800px;
}

.message-video video {
  width: 480px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Vertical videos (portrait) should be smaller */
.message-video.video-vertical {
  max-width: 350px;
}

.message-video.video-vertical video {
  max-width: 350px;
}

.message-audio {
  background: var(--bg-tertiary);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  max-width: 400px;
}

.message-audio audio {
  width: 100%;
  margin-bottom: 0.5rem;
}

/* WaveSurfer Player Styles */
.wavesurfer-player {
  background: linear-gradient(135deg,
    rgba(15, 15, 25, 0.95) 0%,
    rgba(20, 20, 35, 0.95) 50%,
    rgba(15, 15, 25, 0.95) 100%);
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.3);
  position: relative;
  box-shadow:
    0 0 20px rgba(99, 102, 241, 0.15),
    0 0 40px rgba(139, 92, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.wavesurfer-player::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg,
    #6366f1, #8b5cf6, #a855f7, #d946ef,
    #ec4899, #f43f5e, #f97316, #eab308,
    #22c55e, #14b8a6, #06b6d4, #3b82f6, #6366f1);
  background-size: 400% 400%;
  border-radius: 0.85rem;
  z-index: -1;
  animation: rgbBorderFlow 8s ease infinite;
  opacity: 0.6;
  filter: blur(8px);
}

.wavesurfer-player::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
    rgba(15, 15, 25, 0.98) 0%,
    rgba(20, 20, 35, 0.98) 50%,
    rgba(15, 15, 25, 0.98) 100%);
  border-radius: 0.75rem;
  z-index: -1;
}

.wavesurfer-player.is-playing::before {
  opacity: 0.9;
  animation: rgbBorderFlow 3s ease infinite;
  filter: blur(12px);
}

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

.ws-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(15, 15, 30, 0.8);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
  z-index: 1;
}

.ws-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ws-play-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.ws-play-btn i {
  font-size: 1.1rem;
}

.ws-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: monospace;
  min-width: 90px;
}

.ws-volume-btn {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: auto;
}

.ws-volume-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ws-waveform {
  padding: 0.5rem 1rem;
  min-height: 48px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  background: rgba(10, 10, 20, 0.5);
}

.ws-media-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(15, 15, 30, 0.8);
  border-top: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
  z-index: 1;
}

.ws-media-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-download-btn {
  width: 28px;
  height: 28px;
  border-radius: 0.375rem;
  border: none;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.ws-download-btn:hover {
  background: var(--primary-hover);
}

.ws-download-btn i {
  font-size: 0.9rem;
}

.media-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.05);
}

.media-name {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-download-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  flex-shrink: 0;
}

.media-download-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}

.media-download-btn i {
  font-size: 0.875rem;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

.message.user .message-time {
  text-align: right;
}

/* Transcription and Video Analysis Styling */
.transcription-section,
.video-section {
  margin-top: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.video-section {
  border-color: var(--primary-color);
}

.transcription-header {
  background: var(--accent-color);
  color: var(--text-inverse);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.video-section .transcription-header {
  background: var(--primary-color);
}

.transcription-header i {
  font-size: 0.875rem;
}

.transcription-item {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.transcription-item:last-child {
  border-bottom: none;
}

.transcription-filename {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.transcription-filename::before {
  content: "🎵";
  font-size: 0.75rem;
}

.transcription-text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  padding: 0.5rem;
  border-radius: 0.375rem;
  border-left: 3px solid var(--accent-color);
}

.video-section .transcription-text {
  border-left-color: var(--primary-color);
}

/* Code Block */
.code-block-container {
  margin: 1rem 0;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--bg-secondary);
}

.code-tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
  padding: 0;
}

.code-tab-btn {
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.code-tab-btn:hover {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.05);
}

.code-tab-btn.active {
  color: var(--primary-color);
  background: var(--bg-primary);
  border-bottom-color: var(--primary-color);
}

.code-tab-content {
  position: relative;
}

.code-tab-panel {
  display: none;
}

.code-tab-panel.active {
  display: block;
}

.code-tab-panel[data-panel="preview"] {
  padding: 0;
  background: white;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.preview-resolution-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 0.375rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-resolution-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.preview-resolution-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.preview-resolution-btn i {
  font-size: 1rem;
}

.preview-resolution-label {
  font-weight: 500;
  min-width: 52px;
  text-align: center;
}

.preview-iframe-container {
  width: 100%;
  height: 750px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #e5e7eb;
  overflow: auto;
  padding: 1rem;
}

.preview-iframe-container iframe {
  height: 100%;
  border: none;
  display: block;
  background: white;
  transition: width 0.3s ease, box-shadow 0.3s ease;
}

.preview-iframe-container.desktop iframe {
  width: 100%;
}

.preview-iframe-container.tablet iframe {
  width: 768px;
  max-width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  border-radius: 8px;
}

.preview-iframe-container.mobile iframe {
  width: 375px;
  max-width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  border-radius: 8px;
}

.code-tab-panel[data-panel="code"] {
  background: var(--bg-primary);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.code-lang {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-action-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: 0.5rem;
}

.code-action-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.code-action-btn.success {
  background: var(--success-color);
  color: white;
  border-color: var(--success-color);
}

.code-tab-panel[data-panel="code"] pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  background: var(--bg-primary);
}

.code-tab-panel[data-panel="code"] code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
  display: block;
  white-space: pre;
}

/* Share Panel Styles */
.share-container {
  padding: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.share-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.share-section h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-section h4 i {
  color: var(--primary-color);
}

.share-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.option-row label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
}

.password-input-row {
  margin-top: -0.5rem;
}

.password-input-row input,
.share-password-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.password-input-row input:focus,
.share-password-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.expiration-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 150px;
}

.btn-generate-link {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-generate-link:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-generate-link:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.generated-link {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.link-display {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.share-link-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

.btn-copy-link {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-copy-link:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.link-info {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.link-info span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.email-share {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.email-input,
.email-message {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.2s;
}

.email-input:focus,
.email-message:focus {
  outline: none;
  border-color: var(--primary-color);
}

.email-message {
  resize: vertical;
  min-height: 80px;
}

.btn-send-email {
  padding: 0.75rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-send-email:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

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

.share-footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-tertiary);
}

.share-footer i {
  margin-right: 0.25rem;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  opacity: 0.9;
  --typing-color: #10b981;
  --typing-speed: 1.4s;
}

.typing-indicator .typing-avatar {
  width: 2rem;
  height: 2rem;
  background: var(--accent-color);
  color: var(--text-inverse);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.typing-indicator .typing-avatar i {
  font-size: 1rem;
}

.typing-content {
  flex: 1;
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.typing-text {
  color: var(--typing-color);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.5rem 0;
}

.typing-dots {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  padding: 0.5rem 0;
}

.typing-dots span {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--typing-color);
  border-radius: 50%;
  animation: typing var(--typing-speed) infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Input Area */
.input-area {
  background: var(--bg-input);
  border-top: 1px solid var(--border-light);
  padding: 1rem;
}

.input-container {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.mode-selector {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mode-selector-trigger {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.mode-selector-trigger:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mode-selector-panel {
  position: absolute;
  bottom: 100%;
  margin-bottom: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-lg);
  z-index: 9;
}

.mode-selector.expanded .mode-selector-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-btn:hover {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
}

.mode-btn.active {
  background: var(--primary-color);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

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

.mode-btn.disabled:hover,
.mode-btn:disabled:hover {
  color: var(--text-secondary);
  background: transparent;
}

.mode-btn i {
  font-size: 1.125rem;
}

.input-form {
  flex: 1;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 0.25rem;
  transition: all 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

#messageInput {
  flex: 1;
  background: none;
  border: none;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  min-height: 24px;
  max-height: 150px;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

#messageInput:focus {
  outline: none;
}

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

#messageInput::-webkit-scrollbar {
  width: 6px;
}

#messageInput::-webkit-scrollbar-track {
  background: transparent;
}

#messageInput::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, rgba(155, 155, 155, 0.5));
  border-radius: 3px;
}

.send-btn {
  background: var(--primary-color);
  color: var(--text-inverse);
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.send-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

/* Auto Tools Button */
.auto-tools-btn {
  background: rgba(150, 150, 150, 0.15);
  color: rgba(150, 150, 150, 0.6);
  border: 1px solid rgba(150, 150, 150, 0.2);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-right: 0.5rem;
}

.auto-tools-btn:hover:not(.active) {
  background: rgba(150, 150, 150, 0.25);
  color: rgba(150, 150, 150, 0.8);
  transform: scale(1.05);
}

.auto-tools-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  animation: pulse-glow 2s ease-in-out infinite;
}

.auto-tools-btn.active:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.auto-tools-btn i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.auto-tools-btn.active i {
  transform: rotate(15deg);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
  }
}

/* File Upload Button */
.file-upload-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1.25rem;
  margin-right: 0.5rem;
}

.file-upload-btn:hover {
  background: var(--bg-hover);
  color: var(--primary-color);
  transform: scale(1.05);
}

.file-upload-btn.uploading {
  color: var(--primary-color);
  animation: pulse 2s infinite;
}

/* Web Search Button */
.web-search-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1.25rem;
  margin-right: 0.5rem;
  position: relative;
}

.web-search-btn:hover {
  background: var(--bg-hover);
  color: var(--primary-color);
  transform: scale(1.05);
}

.web-search-btn.active {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
}

.web-search-btn.active:hover {
  background: rgba(99, 102, 241, 0.15);
}

.web-search-btn.searching {
  color: var(--primary-color);
  animation: pulse 2s infinite;
}

/* Only show web search button in chat mode */
body:not([data-mode="chat"]) .web-search-btn {
  display: none;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Drag & Drop Styles */
.chat-container {
  position: relative;
}

.drag-drop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(59, 130, 246, 0.1);
  backdrop-filter: blur(4px);
  border: 3px dashed var(--primary-color);
  border-radius: 1rem;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s ease;
}

.drag-drop-overlay.active {
  display: flex;
}

.drag-drop-content {
  text-align: center;
  padding: 2rem;
  background: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.drag-drop-content i {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: block;
}

.drag-drop-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.drag-drop-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

.chat-container.drag-over {
  background: rgba(59, 130, 246, 0.05);
}

.chat-container.drag-over .drag-drop-overlay {
  display: flex;
  animation: dragPulse 1s infinite ease-in-out;
}

@keyframes dragPulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.02);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}

.send-btn:disabled {
  background: var(--text-tertiary);
  cursor: not-allowed;
  transform: none;
}

.send-btn i {
  font-size: 1.125rem;
}

.clear-btn {
  background: var(--danger-color);
  color: var(--text-inverse);
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.clear-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.clear-btn i {
  font-size: 1.125rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 400px;
  animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.modal-body input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  justify-content: flex-end;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-color, #ef4444);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Delete Conversation Modal - Minimal */
.delete-modal-content {
  max-width: 360px;
  border-radius: 0.75rem;
  overflow: hidden;
}

.delete-modal-body {
  padding: 0;
}

.delete-modal-body textarea {
  width: 100%;
  height: 140px;
  padding: 1rem;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.6;
  resize: none;
  font-family: inherit;
  border-radius: 0;
}

.delete-modal-body textarea:focus {
  outline: none;
}

/* Scrollbar for delete preview */
.delete-modal-body textarea::-webkit-scrollbar {
  width: 4px;
}

.delete-modal-body textarea::-webkit-scrollbar-track {
  background: transparent;
}

.delete-modal-body textarea::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.2);
  border-radius: 2px;
}

.delete-countdown-bar {
  height: 3px;
  background: var(--bg-tertiary);
}

.delete-countdown-progress {
  height: 100%;
  background: var(--danger-color, #ef4444);
  width: 100%;
  transition: width 0.1s linear;
}

.delete-modal-actions {
  display: flex;
  border-top: 1px solid var(--border-light);
}

.delete-action-btn {
  flex: 1;
  padding: 0.875rem;
  border: none;
  background: none;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.delete-action-btn.cancel {
  color: var(--text-secondary);
  border-right: 1px solid var(--border-light);
}

.delete-action-btn.cancel:hover {
  background: var(--bg-hover);
}

.delete-action-btn.confirm {
  color: var(--danger-color, #ef4444);
}

.delete-action-btn.confirm:hover {
  background: rgba(239, 68, 68, 0.1);
}

.delete-action-btn.confirm span {
  font-variant-numeric: tabular-nums;
}

/* Mobile responsive for delete modal */
@media (max-width: 768px) {
  .delete-modal-content {
    max-width: calc(100% - 2rem);
  }

  .delete-modal-body textarea {
    height: 120px;
  }
}

/* Maintenance Modal */
.maintenance-modal-content {
  max-width: 320px;
  text-align: center;
  padding: 2rem 1.5rem;
}

.maintenance-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.maintenance-icon i {
  font-size: 1.75rem;
  color: #f59e0b;
}

.maintenance-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.maintenance-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.maintenance-text strong {
  color: var(--text-primary);
}

.maintenance-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.maintenance-btn:hover {
  background: var(--primary-hover);
}

/* Delete Message Toast */
.delete-message-toast {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  z-index: 100;
  animation: toastSlideIn 0.2s ease;
  overflow: hidden;
}

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

.delete-toast-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.delete-toast-seconds {
  font-weight: 600;
  color: var(--danger-color, #ef4444);
  font-variant-numeric: tabular-nums;
}

.delete-toast-cancel {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.delete-toast-cancel:hover {
  background: var(--bg-hover);
}

.delete-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--danger-color, #ef4444);
  width: 100%;
  transition: width 0.1s linear;
}

/* Adjust toast position for user messages (right-aligned) */
.message.user .delete-message-toast {
  right: auto;
  left: 0;
}

/* Image Edit Functionality Styles */
.image-buttons {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: all 0.3s ease;
}

.message-image:hover .image-buttons {
  opacity: 1;
}

.image-action-btn {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
}

.image-action-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.05);
}

.edit-image-preview {
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
}

.edit-image-preview img {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.modal-body textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.modal-body textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    max-height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  /* REORDER SIDEBAR ITEMS in mobile */
  .sidebar-header {
    order: 0; /* Logo FIRST */
  }

  .user-profile-section {
    order: 1; /* User profile SECOND */
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem; /* Compact padding */
    border-top: none;
    border-bottom: 1px solid var(--border-light);
  }

  /* Make user profile more minimalist in mobile */
  .user-profile-section.collapsed .user-avatar {
    width: 32px;
    height: 32px;
  }

  .user-profile-section.collapsed .user-avatar i {
    font-size: 16px;
  }

  .user-profile-section .user-name {
    font-size: 14px;
    font-weight: 500;
  }

  .user-profile-section .plan-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .user-profile-compact-stats {
    font-size: 12px;
  }

  .user-profile-compact-stats i {
    font-size: 14px;
  }

  .sidebar-actions {
    order: 2;
  }

  .conversations-section {
    order: 3;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem; /* Space for last item in mobile */
  }

  /* Reset conversations-list padding */
  .conversations-list {
    padding-bottom: 0.5rem;
  }

  /* Add margin to last conversation item */
  .conversation-item:last-child {
    margin-bottom: 1.5rem;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-top: 0;
    height: calc(100vh - 60px); /* Subtract mobile header height */
    max-height: calc(100vh - 60px);
    padding-bottom: 0; /* Remove bottom padding since input-area is fixed */
  }

  .chat-container {
    padding-bottom: 0; /* Remove padding since input-area is fixed */
  }

  .desktop-theme-toggle {
    display: none;
  }

  .input-container {
    gap: 0.375rem;
    align-items: center;
  }

  .mode-selector {
    order: 1;
  }

  .mode-selector-trigger .mode-btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
  }

  .mode-selector-trigger .mode-btn i {
    font-size: 1rem;
  }

  .input-form {
    flex: 1;
    min-width: 0;
    order: 2;
  }

  .input-wrapper {
    padding: 0.125rem;
  }

  .file-upload-btn,
  .web-search-btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    font-size: 1rem;
    margin-right: 0.125rem;
  }

  .send-btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
  }

  .send-btn i {
    font-size: 1rem;
  }

  #messageInput {
    font-size: 0.9rem;
    padding: 0.5rem 0.375rem;
  }

  .clear-btn {
    order: 3;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    font-size: 1rem;
  }

  .welcome-modes {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-width: 100%;
  }

  .mode-card {
    padding: 0.75rem 0.5rem;
    aspect-ratio: auto;
    min-height: 100px;
  }

  .mode-card i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .mode-card h3 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }

  .mode-card p {
    font-size: 0.7rem;
    line-height: 1.2;
  }

  .message-content {
    max-width: 85%;
  }

  .welcome-content {
    padding: 1rem;
  }

  .welcome-screen {
    padding: 1rem;
  }

  .welcome-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .welcome-content > p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  /* Welcome Modules Mobile */
  .welcome-modules-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
  }

  .welcome-modules-section h3 {
    font-size: 0.85rem;
  }

  .welcome-modules {
    gap: 0.5rem;
  }

  .welcome-module-card {
    padding: 0.5rem 0.75rem;
  }

  .welcome-module-card i {
    font-size: 1rem;
  }

  .welcome-module-card .module-name {
    font-size: 0.8rem;
  }

  .message-video video {
    width: 90%;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 280px;
  }

  .input-area {
    padding: 0.75rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg-input);
    border-top: 1px solid var(--border-light);
  }

  .chat-messages {
    padding: 0.75rem;
    padding-bottom: 140px; /* Add space for fixed input-area */
  }

  .modal-content {
    margin: 1rem;
    max-width: none;
  }

  .welcome-screen {
    padding: 0.75rem;
    padding-bottom: 140px; /* Add space for fixed input-area */
  }

  .welcome-modes {
    gap: 0.5rem;
  }

  .mode-card {
    padding: 0.625rem 0.375rem;
    min-height: 90px;
    border-radius: 0.75rem;
  }

  .mode-card i {
    font-size: 1.25rem;
    margin-bottom: 0.375rem;
  }

  .mode-card h3 {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .mode-card p {
    font-size: 0.65rem;
    line-height: 1.15;
  }

  .welcome-content h2 {
    font-size: 1.25rem;
  }

  .welcome-content > p {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
  }
}

/* Scrollbar Styling */
.conversations-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.conversations-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.conversations-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}

.conversations-list::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Theme Transition */
* {
  transition-property: background-color, border-color, color, fill, stroke, box-shadow;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* Attached Files UI */
.attached-files {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  max-width: 100%;
}

.attached-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Base attached file styles */
.attached-file {
  position: relative;
  border-radius: 8px;
  transition: all 0.2s;
  overflow: hidden;
}

.attached-file:hover {
  transform: scale(1.02);
}

/* Image thumbnails */
.attached-file-image {
  width: 64px;
  height: 64px;
  border: 2px solid var(--border-light);
  background: var(--bg-tertiary);
}

.attached-file-image:hover {
  border-color: var(--primary-color);
}

.file-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Document files */
.attached-file-doc {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  height: 64px;
  min-width: 80px;
  max-width: 140px;
}

.attached-file-doc:hover {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
}

.attached-file-doc > i {
  color: var(--primary-color);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.attached-file-doc .file-name {
  flex: 1;
  font-size: 0.7rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Remove button (X) */
.remove-file-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0;
  font-size: 10px;
}

.attached-file:hover .remove-file-btn {
  opacity: 1;
}

.remove-file-btn:hover {
  background: var(--danger-color);
  transform: scale(1.1);
}

/* Document files need different button positioning */
.attached-file-doc .remove-file-btn {
  position: static;
  background: none;
  color: var(--text-tertiary);
  opacity: 1;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.attached-file-doc .remove-file-btn:hover {
  background: var(--bg-hover);
  color: var(--danger-color);
}

/* Clear all button */
.clear-all-btn {
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-light);
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 1.2rem;
}

.clear-all-btn:hover {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: white;
}

/* Responsive adjustments for attached files */
@media (max-width: 768px) {
  .attached-file-image {
    width: 56px;
    height: 56px;
  }

  .attached-file-doc {
    height: 56px;
    min-width: 70px;
  }

  .clear-all-btn {
    width: 56px;
    height: 56px;
  }
}

/* Image Lightbox Styles */
#imageLightboxModal {
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
}

.lightbox-content {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2001;
  transition: all 0.3s ease;
  //color: var(--text-primary);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.lightbox-close i {
  font-size: 1.5rem;
}

.lightbox-image-container {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-container img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-xl);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.lightbox-image-container img:active {
  cursor: grabbing;
}

/* Make message images clickable */
.message-image img {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.message-image img:hover {
  transform: scale(1.02);
}

/* Mobile responsive for lightbox */
@media (max-width: 768px) {
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  .lightbox-close i {
    font-size: 1.25rem;
  }

  .lightbox-content {
    padding: 1rem;
  }

  .lightbox-image-container {
    max-width: 95vw;
    max-height: 95vh;
  }

  /* Smaller images on mobile */
  .message-image img {
    max-width: 280px;
  }
}

/* HTML Preview Modal */
.html-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.html-preview-modal.show {
  opacity: 1;
  visibility: visible;
}

.html-preview-modal-content {
  background: var(--bg-primary);
  border-radius: 0.75rem;
  width: 95vw;
  height: 95vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.html-preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.html-preview-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.html-preview-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.html-preview-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.html-preview-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.html-preview-close i {
  font-size: 1.5rem;
}

.html-preview-modal-body {
  flex: 1;
  overflow: hidden;
  background: #e5e7eb;
}

/* Modal iframe container with resolution support */
.modal-iframe-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  padding: 1rem;
  background: #e5e7eb;
}

.modal-iframe-container iframe {
  height: 100%;
  border: none;
  display: block;
  background: white;
  transition: width 0.3s ease, box-shadow 0.3s ease;
}

.modal-iframe-container.desktop iframe {
  width: 100%;
  height: 100%;
}

.modal-iframe-container.tablet iframe {
  width: 768px;
  max-width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  border-radius: 8px;
}

.modal-iframe-container.mobile iframe {
  width: 375px;
  max-width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  border-radius: 8px;
}

/* Authentication Pages */
.auth-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem 1rem;
  overflow-x: hidden;
}

:root[data-theme="dark"] .auth-container {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.auth-card {
  background: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 450px;
  padding: 2.5rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.auth-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--bg-tertiary);
  padding: 0.375rem;
  border-radius: 0.75rem;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-tab:hover {
  background: var(--bg-hover);
}

.auth-tab.active {
  background: var(--bg-primary);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.auth-tab i {
  font-size: 1.25rem;
}

.auth-form-container {
  display: none;
}

.auth-form-container.active {
  display: block;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.form-group label i {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.form-group input {
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border-light);
  border-radius: 0.5rem;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-input);
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group select {
  padding: 0.875rem 2.5rem 0.875rem 1rem;
  border: 1.5px solid var(--border-light);
  border-radius: 0.5rem;
  font-size: 1rem;
  color: var(--text-primary);
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.form-group select:hover {
  border-color: var(--primary-color);
  background-color: var(--bg-secondary);
}

.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group select option {
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-group small,
.form-group .form-help {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.link-text {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.link-text:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.btn {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  animation: slideDown 0.3s ease;
}

.alert i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

:root[data-theme="dark"] .alert-error {
  background: #7f1d1d;
  color: #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border-left: 4px solid #10b981;
}

:root[data-theme="dark"] .alert-success {
  background: #14532d;
  color: #bbf7d0;
}

.form-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  line-height: 1.5;
}

.demo-credentials {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

.demo-credentials p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.demo-credentials p:first-child {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

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

/* Modules Section in Sidebar - Compact Grid */
.modules-section {
  padding: 0.375rem;
  border-top: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.modules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  border-radius: 0.375rem;
  transition: background 0.2s ease;
}

.modules-header:hover {
  background: var(--bg-hover);
}

.modules-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.modules-count {
  background: var(--primary-color);
  color: white;
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  font-weight: 600;
}

.modules-toggle-icon {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.modules-section:not(.collapsed) .modules-toggle-icon {
  transform: rotate(180deg);
}

.modules-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem;
  overflow: hidden;
  transition: all 0.3s ease;
  max-height: 200px;
  padding-top: 0.375rem;
}

.modules-section.collapsed .modules-list {
  max-height: 0;
  padding-top: 0;
  opacity: 0;
}

.module-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.375rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  background: var(--bg-secondary);
  border: 1px solid transparent;
}

.module-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.module-item:active {
  background: var(--bg-active);
  transform: scale(0.98);
}

.module-icon {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.module-info {
  text-align: left;
  min-width: 0;
  flex: 1;
}

.module-name {
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

/* Mobile: modules section - horizontal scroll or 3 columns */
@media (max-width: 768px) {
  .modules-section {
    order: 10;
    margin-top: auto;
    padding: 0.5rem;
  }

  .modules-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .module-item {
    padding: 0.625rem 0.375rem;
  }

  .module-icon {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .module-name {
    font-size: 0.65rem;
  }
}

/* User Profile Section in Sidebar - Compact Single Row */
.user-profile-section {
  margin-top: auto;
  padding: 0.5rem;
  border-top: 1px solid var(--border-light);
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Collapsed state */
.user-profile-section.collapsed {
  padding: 0.5rem;
}

.user-profile-section.collapsed .user-profile-expanded {
  display: none;
}

.user-profile-section.collapsed .user-profile-info {
  margin-bottom: 0;
}

/* Header styling - Single row compact */
.user-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: var(--bg-secondary);
}

.user-profile-header:hover {
  background: var(--bg-hover);
}

.user-profile-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

/* Compact stats for collapsed state */
.user-profile-compact-stats {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
}

.compact-counter {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg-primary);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
}

.compact-counter.warning {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

.compact-counter.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.profile-toggle-icon {
  color: var(--text-tertiary);
  transition: transform 0.3s ease;
  font-size: 0.75rem;
}

.user-profile-section:not(.collapsed) .profile-toggle-icon {
  transform: rotate(180deg);
}

/* Expanded content */
.user-profile-expanded {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

/* Compact avatar */
.user-avatar {
  width: 1.5rem;
  height: 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  display: flex;
  align-items: center;
}

/* Compact plan badge */
.plan-badge {
  display: inline-block;
  padding: 0.1rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.plan-badge.freemium {
  background: var(--surface-secondary);
  color: var(--text-secondary);
}

.plan-badge.premium {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.plan-badge.pro {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.plan-badge.admin {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

/* Compact expanded section - single row */
.user-stats {
  display: none; /* Hidden - stats shown in compact row below */
}

.user-stats-label {
  color: var(--text-tertiary);
  font-size: 0.65rem;
}

.user-stats-value {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.7rem;
}

.unlimited-badge {
  color: var(--success-color, #10b981);
  font-size: 0.6rem;
  font-weight: 500;
}

/* Single row: stats + actions */
.user-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Compact stats inline with actions */
.user-actions-stats {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-primary);
  border-radius: 0.25rem;
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-right: auto;
}

.user-actions-stats i {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.user-action-btn {
  padding: 0.375rem 0.5rem;
  background: transparent;
  border: none;
  border-radius: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.user-action-btn i {
  font-size: 0.85rem;
}

.user-action-btn span {
  display: none; /* Hide text, show only icons */
}

.user-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.user-action-btn.logout-btn {
  color: var(--text-tertiary);
}

.user-action-btn.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Profile Page */
.profile-page {
  min-height: 100vh;
  background: var(--bg-secondary);
  padding: 2rem 1rem;
}

.profile-container {
  max-width: 900px;
  margin: 0 auto;
}

.profile-header {
  margin-bottom: 2rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.back-btn:hover {
  color: var(--primary-color);
  transform: translateX(-3px);
}

.back-btn i {
  font-size: 1.125rem;
}

.profile-header h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.profile-header h1 i {
  font-size: 2.25rem;
  color: var(--primary-color);
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-card {
  background: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.profile-card h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1.5rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.profile-card h2 i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-item label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.info-value i {
  font-size: 1.125rem;
  color: var(--primary-color);
  flex-shrink: 0;
}

.badge-admin {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-user {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.action-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.action-link:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.action-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: white;
  border-radius: 0.75rem;
  flex-shrink: 0;
}

.action-icon i {
  font-size: 1.5rem;
}

.action-content {
  flex: 1;
}

.action-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.action-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.action-arrow {
  font-size: 1.25rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.action-link:hover .action-arrow {
  color: var(--primary-color);
  transform: translateX(4px);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-form .form-group small {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: -0.25rem;
}

.form-message {
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.form-message.success {
  background: #f0fdf4;
  color: #166534;
  border-left: 4px solid #10b981;
}

:root[data-theme="dark"] .form-message.success {
  background: #14532d;
  color: #bbf7d0;
}

.form-message.error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

:root[data-theme="dark"] .form-message.error {
  background: #7f1d1d;
  color: #fecaca;
}

/* Responsive */
@media (max-width: 768px) {
  .profile-page {
    padding: 1rem;
  }

  .profile-header h1 {
    font-size: 1.5rem;
  }

  .profile-header h1 i {
    font-size: 1.75rem;
  }

  .profile-card {
    padding: 1.25rem;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* SuperAdmin Panel */
.superadmin-page {
  min-height: 100vh;
  background: var(--bg-secondary);
  padding: 1rem;
}

.superadmin-container {
  max-width: 1400px;
  margin: 0 auto;
}

.superadmin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.superadmin-header h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.superadmin-header h1 i {
  font-size: 2.25rem;
  color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon i {
  color: white !important;
}

.stat-icon.users {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.messages {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.conversations {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon.admins {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.stat-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-trend .trend-up {
  color: #10b981;
}

.stat-trend .trend-down {
  color: #ef4444;
}

.stat-trend i {
  font-size: 0.875rem;
}

/* Dashboard Stats Container */
.dashboard-stats-container {
  margin-bottom: 2rem;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.dashboard-title i {
  color: var(--primary-color);
}

.period-filters {
  display: flex;
  gap: 0.5rem;
}

.period-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.period-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.chart-card {
  background: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.chart-header {
  margin-bottom: 1rem;
}

.chart-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.chart-header h3 i {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.chart-body {
  height: 200px;
  position: relative;
}

/* Top Users Card */
.top-users-card {
  background: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-top: 1.5rem;
}

.top-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.top-user-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.top-user-item:hover {
  background: var(--bg-hover);
}

.top-user-rank {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.top-user-info {
  flex: 1;
  min-width: 0;
}

.top-user-email {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-user-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.top-user-stats {
  flex-shrink: 0;
}

.top-user-messages {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

/* Top Models List */
.top-models-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.top-model-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.top-model-item:hover {
  background: var(--bg-hover);
}

.top-model-rank {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.top-model-info {
  flex: 1;
  min-width: 0;
}

.top-model-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.375rem;
}

.top-model-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.top-model-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.top-model-stats {
  flex-shrink: 0;
}

.top-model-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.loading-placeholder i {
  animation: spin 1s linear infinite;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.empty-state i {
  font-size: 2rem;
  opacity: 0.5;
}

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

/* Responsive: Charts */
@media (max-width: 992px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-stats-container {
    padding: 1rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .dashboard-title {
    font-size: 1.25rem;
  }

  .period-filters {
    width: 100%;
  }

  .period-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.875rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .stat-detail {
    font-size: 0.65rem;
  }

  .stat-trend {
    font-size: 0.65rem;
  }

  .chart-card {
    padding: 1rem;
  }

  .chart-header h3 {
    font-size: 0.9rem;
  }

  .top-user-item,
  .top-model-item {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .top-user-rank,
  .top-model-rank {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.65rem;
  }

  .top-user-email,
  .top-model-name {
    font-size: 0.75rem;
  }

  .top-user-name {
    font-size: 0.65rem;
  }

  .top-user-messages,
  .top-model-count {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.75rem 0.5rem;
  }

  .stat-icon {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
    border-radius: 0.5rem;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .stat-detail {
    font-size: 0.6rem;
  }

  .period-btn {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* Navigation Cards Grid */
.nav-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.nav-card:hover .nav-card-arrow {
  display: none;
}

.nav-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-card-icon i {
  font-size: 1.25rem;
  color: white;
}

.nav-card-icon.users {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.nav-card-icon.plans {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.nav-card-icon.invitations {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.nav-card-icon.config {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.nav-card-icon.preferences {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.nav-card-icon.plugins {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.nav-card-icon.customization {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.nav-card-content {
  min-width: 0;
}

.nav-card-content h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.125rem 0;
}

.nav-card-content p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.3;
}

.nav-card-stat {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.nav-card-stat .stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-card-stat .stat-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.nav-card-arrow {
  display: none;
}

@media (max-width: 992px) {
  .nav-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .nav-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .nav-card {
    padding: 1rem 0.75rem;
  }

  .nav-card-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .nav-card-icon i {
    font-size: 1.25rem;
  }

  .nav-card-content h3 {
    font-size: 0.85rem;
  }

  .nav-card-content p {
    display: none;
  }
}

/* Customization Tab Styles */
.customization-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.customization-section h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.customization-form .form-group {
  margin-bottom: 1.25rem;
}

.customization-form .form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.customization-form .form-group input,
.customization-form .form-group textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border 0.2s;
  background: var(--bg-input);
  color: var(--text-primary);
}

.customization-form .form-group input:focus,
.customization-form .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.customization-form .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.customization-form .form-group small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.customization-form .form-actions {
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  text-align: right;
}

/* Brand Grid */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.brand-item {
  text-align: center;
}

.brand-item h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.brand-preview-box {
  background: var(--bg-tertiary);
  border: 2px dashed var(--border-medium);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  margin-bottom: 0.75rem;
}

.brand-preview-box.dark {
  background: #1e293b;
}

.brand-preview-box img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.brand-preview-box.empty {
  opacity: 0.5;
}

.brand-status {
  margin-bottom: 0.5rem;
}

.brand-status .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.brand-status .status-badge.default {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.brand-status .status-badge.custom {
  background: #dcfce7;
  color: #166534;
}

[data-theme="dark"] .brand-status .status-badge.custom {
  background: #14532d;
  color: #86efac;
}

.brand-item small {
  display: block;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  margin-bottom: 0.75rem;
}

.brand-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

@media (max-width: 992px) {
  .brand-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .customization-section {
    padding: 1rem;
  }
}

/* Tabs */
.superadmin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 100;
  padding-top: 1rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-radius: 0.5rem 0.5rem 0 0;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  text-decoration: none;
}

a.tab-btn {
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

.tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-primary);
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-btn i {
  font-size: 1.125rem;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  min-height: calc(100vh - 120px);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.section-header h2 i {
  color: var(--primary-color);
}

.section-actions {
  display: flex;
  gap: 0.5rem;
}

/* Data Table */
.table-container {
  background: var(--bg-primary);
  border-radius: 1rem;
  overflow: visible;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.table-container table {
  overflow: visible;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table tbody,
.data-table tr {
  overflow: visible;
}

.data-table th {
  background: var(--bg-tertiary);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table td:last-child {
  overflow: visible;
  position: relative;
}

.data-table tr:hover {
  background: var(--bg-hover);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Table Elements */
.user-email {
  font-weight: 500;
  color: var(--text-primary);
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-superadmin {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.badge-admin {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.badge-active {
  background: #10b981;
  color: white;
}

/* ==================== CREATE USER MODAL STYLES ==================== */

#createUserModal .modal-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  color: white;
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 1.25rem 1.5rem;
}

#createUserModal .modal-header h2 {
  color: white;
}

#createUserModal .modal-header h2 i {
  color: white;
}

#createUserModal .modal-header .modal-close {
  color: white;
  opacity: 0.8;
}

#createUserModal .modal-header .modal-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

#createUserModal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
}

#createUserModal .form-group {
  margin-bottom: 0;
}

#createUserModal .form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

#createUserModal .form-group label i {
  font-size: 1.1rem;
  color: var(--primary-color);
}

#createUserModal .form-group input,
#createUserModal .form-group select {
  width: 100%;
}

/* Role select with visual indicators */
#create-role {
  font-weight: 500;
}

#create-role option[value="user"] {
  padding-left: 0.5rem;
}

#create-role option[value="admin"] {
  background: linear-gradient(90deg, rgba(240, 147, 251, 0.1), transparent);
}

#create-role option[value="superadmin"] {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1), transparent);
}

/* Password field container */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  flex: 1;
  padding-right: 3rem !important;
}

.password-input-wrapper .password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--text-secondary);
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.password-input-wrapper .password-toggle:hover {
  color: var(--primary-color);
  background: var(--bg-tertiary);
}

/* Role description help text */
#createUserModal .form-help {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem;
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
  border-left: 3px solid var(--primary-color);
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

#createUserModal .form-help div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

#createUserModal .form-help strong {
  color: var(--text-primary);
  min-width: 110px;
}

/* Plan group transition */
#create-plan-group {
  transition: opacity 0.2s ease, max-height 0.3s ease;
  overflow: hidden;
}

#create-plan-group[style*="display: none"] {
  opacity: 0;
  max-height: 0;
}

/* Modal footer buttons */
#createUserModal .modal-footer {
  border-top: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 0 0 0.75rem 0.75rem;
}

#createUserModal .modal-footer .btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  border: none;
}

#createUserModal .modal-footer .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ==================== END CREATE USER MODAL STYLES ==================== */

.role-select, .plan-select, .status-select {
  padding: 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
  min-width: 100px;
}

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

.unlimited-text {
  color: var(--success-color, #10b981);
  font-weight: 500;
}

.text-muted {
  color: var(--text-secondary);
  font-style: italic;
}

.date-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.btn-icon {
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.btn-icon.reset-btn {
  background: var(--primary-color);
  color: white;
}

.btn-icon.reset-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.btn-icon.delete-btn {
  background: var(--danger-color);
  color: white;
}

.btn-icon.delete-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.btn-icon.view-btn {
  background: #6366f1;
  color: white;
}

.btn-icon.view-btn:hover {
  background: #4f46e5;
  transform: scale(1.05);
}

.btn-icon.edit-btn {
  background: #f59e0b;
  color: white;
}

.btn-icon.edit-btn:hover {
  background: #d97706;
  transform: scale(1.05);
}

.btn-icon.impersonate-btn {
  background: #8b5cf6;
  color: white;
}

.btn-icon.impersonate-btn:hover {
  background: #7c3aed;
  transform: scale(1.05);
}

/* Impersonation Banner */
.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  font-size: 0.875rem;
}

.impersonation-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.impersonation-content i {
  font-size: 1.25rem;
}

.impersonation-content strong {
  font-weight: 600;
}

.impersonation-exit {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.375rem;
  color: white;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.impersonation-exit:hover {
  background: rgba(255, 255, 255, 0.3);
}

.impersonation-exit i {
  font-size: 1rem;
}

/* Adjust app layout when impersonation banner is visible */
body:has(.impersonation-banner) .app {
  padding-top: 2.5rem;
}

body:has(.impersonation-banner) .mobile-header {
  top: 2.5rem;
}

body:has(.impersonation-banner) .sidebar {
  top: 2.5rem;
  height: calc(100vh - 2.5rem);
}

@media (max-width: 768px) {
  .impersonation-banner {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .impersonation-content span {
    display: none;
  }

  .impersonation-content::after {
    content: 'Impersonando';
  }

  .impersonation-exit span {
    display: none;
  }
}

/* User Detail Modals */
.user-detail-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.user-detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.user-detail-section h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-detail-section h3 i {
  color: var(--primary-color);
  font-size: 1.25rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.detail-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.detail-item p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

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

/* Plans Grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.plan-card {
  background: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.plan-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.toggle-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--danger-color);
  color: white;
}

.toggle-btn.active {
  background: var(--success-color, #10b981);
}

.toggle-btn:hover {
  transform: scale(1.05);
}

.plan-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.plan-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plan-stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.plan-stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.plan-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: 1rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 2rem;
  height: 2rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  margin-top: 1.5rem;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.form-section {
  margin-top: 1.5rem;
}

.form-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.parameters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.parameters-grid .form-group {
  margin-bottom: 0;
}

/* Notifications */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1001;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 400px;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification.success {
  border-left: 4px solid var(--success-color, #10b981);
}

.notification.error {
  border-left: 4px solid var(--danger-color);
}

.notification.info {
  border-left: 4px solid var(--primary-color);
}

.notification i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.notification.success i {
  color: var(--success-color, #10b981);
}

.notification.error i {
  color: var(--danger-color);
}

.notification.info i {
  color: var(--primary-color);
}

/* Manage Button Style */
.manage-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.manage-btn:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .superadmin-page {
    padding: 0.5rem;
  }

  .superadmin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .superadmin-header h1 {
    font-size: 1.25rem;
  }

  .superadmin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.25rem;
    padding-bottom: 0.5rem;
  }

  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .section-header h2 {
    font-size: 1.1rem;
  }

  .table-container {
    overflow-x: auto;
    overflow-y: visible;
  }

  .data-table {
    min-width: 800px;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .notification {
    right: 1rem;
    left: 1rem;
    transform: translateY(-100px);
    max-width: none;
  }

  .notification.show {
    transform: translateY(0);
  }

  .back-btn {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }

  .back-btn span {
    display: none;
  }

  .user-info {
    font-size: 0.75rem;
  }

  .user-info span {
    display: block;
  }
}

/* Configuration Tab Styles */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Compact cards take less space */
.models-grid:has(.model-card.compact:not(.expanded)) {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

/* Expanded cards take more space */
.model-card.expanded {
  grid-column: span 2;
}

@media (max-width: 1200px) {
  .model-card.expanded {
    grid-column: span 1;
  }
}

.model-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Compact state (default) */
.model-card.compact .model-details {
  display: none;
}

.model-card.compact .model-header {
  cursor: pointer;
  user-select: none;
}

/* Expanded state */
.model-card.expanded .model-details {
  display: block;
}

.model-card.expanded {
  background: var(--bg-primary);
  border-color: var(--accent-color);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.model-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.model-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  text-align: center;
}

.model-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  background: var(--accent-color);
  border-radius: 1rem;
  color: white;
  font-size: 2rem;
}

.model-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.model-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.model-name {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
}

.model-actions {
  display: flex;
  gap: 0.5rem;
}

.model-parameters {
  padding: 1.5rem;
}

.model-parameters h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.model-parameters h4::before {
  content: '';
  width: 0.25rem;
  height: 1rem;
  background: var(--accent-color);
  border-radius: 0.125rem;
}

.model-parameters ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.model-parameters li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.model-parameters li:last-child {
  border-bottom: none;
}

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

.model-parameters li ul {
  margin-top: 0.5rem;
  padding-left: 1rem;
}

.model-parameters li ul li {
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(var(--border-color-rgb), 0.5);
  font-size: 0.8rem;
}

/* New elements for expandable cards */
.model-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-badge.active {
  background: rgba(34, 197, 94, 0.1);
  color: #059669;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.expand-icon {
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease, color 0.2s ease;
}

.model-card.compact .expand-icon:hover {
  color: var(--accent-color);
  transform: scale(1.1);
}

.model-details {
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.model-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: rgba(var(--accent-color-rgb), 0.05);
  border-top: 1px solid var(--border-color);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.parameters-list {
  max-height: 300px;
  overflow-y: auto;
}

.parameters-list code {
  background: rgba(var(--accent-color-rgb), 0.1);
  color: var(--accent-color);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.8em;
  font-family: 'Courier New', monospace;
}

.sub-params {
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-color);
}

.no-params {
  color: var(--text-secondary);
  font-style: italic;
}

.loading-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--text-secondary);
  grid-column: 1 / -1;
}

.loading-state i, .error-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.loading-state i.ph-spin {
  animation: spin 1s linear infinite;
}

.error-state {
  color: #dc2626;
}

.error-state i {
  color: #dc2626;
}

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

/* Responsive adjustments for configuration tab */
@media (max-width: 768px) {
  .models-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .model-header {
    padding: 1rem;
  }

  .model-parameters {
    padding: 1rem;
  }

  .model-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }
}

/* Logo Styles */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 30px;
}

.logo-icon {
  max-height: 19px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  
  width: 120px;
  object-fit: contain;
}

/* Mobile Header Logo */
.mobile-header .header-logo {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
}

.mobile-header .logo-icon {
  position: absolute;
  left: 3.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.mobile-header .logo-text {
  /* Centered in container */
}

.mobile-header h1 {
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  justify-content: center;
}

/* Sidebar Logo */
.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-header .sidebar-logo {
  height: 26px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-header .logo-icon {
  height: 26px;
  width: auto;
}

.sidebar-header .logo-text {
  height: 40px;
  
}

/* Login Page Logo */
.auth-logo .login-logo {
  height: 80px;
  margin: 0 auto;
  justify-content: center;
  gap: 0.75rem;
}

.auth-logo .login-logo .logo-icon {
  height: 80%;
}

.auth-logo .login-logo .logo-text {
  height: 70%;
}

/* Logo dinámico para login - con soporte de tema claro/oscuro */
.auth-logo .login-logo .logo-main {
  max-height: 100%;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

/* Mostrar solo el logo apropiado según el tema */
/* Por defecto, mostrar logo claro y ocultar oscuro */
.light-mode-logo {
  display: block !important;
}

.dark-mode-logo {
  display: none !important;
}

/* En dark mode, invertir la visibilidad */
[data-theme="dark"] .light-mode-logo {
  display: none !important;
}

[data-theme="dark"] .dark-mode-logo {
  display: block !important;
}

/* Welcome Screen Inline Logo */
.inline-logo {
  display: inline-flex;
  height: 1.5em;
  vertical-align: middle;
  margin: 0 0.25rem;
}

.logo-text-inline {
  height: 100%;
  width: auto;
  object-fit: contain;
}

/* Dark mode adjustments for logos */
:root[data-theme="dark"] .logo-container img {
  filter: brightness(0.95);
}

/* Responsive Logo Sizes */
@media (max-width: 768px) {
  .logo-container {
    height: 22px;
  }

  .sidebar-header .sidebar-logo {
    height: 22px;
  }

  .auth-logo .login-logo {
    height: 64px;
  }

  .auth-logo .login-logo .logo-main {
    max-width: 120px;
  }

  .auth-card {
    padding: 1.25rem;
    margin: 0 0.5rem;
  }

  .auth-container {
    padding: 0.75rem 0.5rem;
  }

  .auth-header {
    margin-bottom: 1rem;
  }

  .auth-logo {
    margin-bottom: 0.5rem;
  }

  .auth-subtitle {
    font-size: 0.85rem;
  }

  .auth-tabs {
    margin-bottom: 1rem;
  }

  .auth-form {
    gap: 0.875rem;
  }

  .form-group {
    gap: 0.375rem;
  }

  .form-group input {
    padding: 0.75rem 0.875rem;
    font-size: 0.95rem;
  }

  .form-group label {
    font-size: 0.85rem;
  }

  .mobile-header .header-logo {
    height: 20px;
    min-width: 180px;
  }

  .inline-logo {
    height: 1.25em;
  }
}

/* Message Action Buttons */
.message-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message.assistant:hover .message-actions,
.message.user:hover .message-actions {
  opacity: 1;
}

.message-action-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
}

.message-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
  transform: scale(1.05);
}

.message-action-btn:active {
  transform: scale(0.95);
}

/* Download Container with Dropdown */
.download-container {
  position: relative;
  display: inline-block;
}

.download-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  margin-top: 0.25rem;
}

.download-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.15s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item:first-child {
  border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 0.5rem 0.5rem;
}

.dropdown-item i {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Message Delete Button */
.message-delete-btn {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  opacity: 0;
  z-index: 10;
}

.message:hover .message-delete-btn {
  opacity: 1;
}

.message-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  transform: scale(1.1);
}

.message-delete-btn:active {
  transform: scale(0.95);
}

/* Deleting animation */
.message.deleting {
  animation: fadeOut 0.3s ease forwards;
  pointer-events: none;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

/* Notification Styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  max-width: 300px;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification.success {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.notification.error {
  background: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

/* Mobile Responsiveness for Actions */
@media (max-width: 768px) {
  .message-actions {
    margin-top: 0.75rem;
    opacity: 1; /* Always visible on mobile */
  }

  .message-action-btn {
    min-width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .download-dropdown {
    min-width: 140px;
    right: -10px;
  }

  .notification {
    right: 10px;
    top: 10px;
    max-width: calc(100vw - 20px);
  }
}

/* ============================================
   SKELETON LOADING & SHIMMER EFFECTS
   ============================================ */

/* Skeleton base */
.skeleton-loader {
  position: relative;
  overflow: hidden;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

/* Shimmer animation */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.skeleton-loader::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite ease-in-out;
}

[data-theme="dark"] .skeleton-loader::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
}

/* Image skeleton */
.skeleton-image {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.skeleton-image-icon {
  position: absolute;
  color: var(--text-tertiary);
  font-size: 48px;
  opacity: 0.3;
  z-index: 1;
  animation: pulse 2s ease-in-out infinite;
}

/* Video skeleton */
.skeleton-video {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.skeleton-video-icon {
  position: absolute;
  color: var(--text-tertiary);
  font-size: 64px;
  opacity: 0.3;
  z-index: 1;
  animation: pulse 2s ease-in-out infinite;
}

/* Audio skeleton */
.skeleton-audio {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.skeleton-audio-waves {
  display: flex;
  gap: 4px;
  align-items: center;
  z-index: 1;
}

.skeleton-audio-wave {
  width: 3px;
  background: var(--text-tertiary);
  border-radius: 2px;
  opacity: 0.3;
  animation: wave 1s ease-in-out infinite;
}

.skeleton-audio-wave:nth-child(1) {
  height: 12px;
  animation-delay: 0s;
}

.skeleton-audio-wave:nth-child(2) {
  height: 24px;
  animation-delay: 0.1s;
}

.skeleton-audio-wave:nth-child(3) {
  height: 18px;
  animation-delay: 0.2s;
}

.skeleton-audio-wave:nth-child(4) {
  height: 30px;
  animation-delay: 0.3s;
}

.skeleton-audio-wave:nth-child(5) {
  height: 20px;
  animation-delay: 0.4s;
}

.skeleton-audio-wave:nth-child(6) {
  height: 16px;
  animation-delay: 0.5s;
}

.skeleton-audio-wave:nth-child(7) {
  height: 24px;
  animation-delay: 0.6s;
}

@keyframes wave {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.5);
  }
}

/* Progress bar */
.skeleton-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-tertiary);
  overflow: hidden;
  z-index: 2;
}

.skeleton-progress-bar {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px var(--primary-color);
}

/* Progress percentage */
.skeleton-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
  opacity: 0.5;
}

/* Pulse animation */
@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

/* Loading fade-in */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.media-loaded {
  animation: fadeIn 0.5s ease-in;
}

/* Skeleton container in messages */
.message-image .skeleton-loader,
.message-video .skeleton-loader,
.message-audio .skeleton-loader {
  margin-bottom: 8px;
}

/* Hide skeleton when media is loaded */
.skeleton-loader.hidden {
  display: none;
}

/* ==================== SUPERADMIN FOOTER ==================== */
.superadmin-footer {
  background: transparent;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 3rem;
  border-top: 1px solid var(--border-light);
  opacity: 0.6;
  transition: opacity 0.2s;
}

.superadmin-footer:hover {
  opacity: 1;
}

/* ==================== USER FILTERS & PAGINATION ==================== */
.users-filters {
  background: var(--bg-secondary);
  padding: 1.25rem;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-light);
}

.search-box {
  position: relative;
  margin-bottom: 1rem;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filter-select {
  flex: 1;
  min-width: 150px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.results-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: right;
}

.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1rem;
}

.pagination-pages {
  display: flex;
  gap: 0.375rem;
}

.page-btn {
  min-width: 2.5rem;
  padding: 0.5rem 0.75rem;
}

.page-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

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

@media (max-width: 768px) {
  .filter-row {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }

  .results-info {
    text-align: center;
  }
}

/* ========================================
   Background Processing Indicator
   ======================================== */
.background-processing-indicator {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--background-color);
  border: 2px solid var(--primary-color);
  border-radius: 30px;
  padding: 12px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.background-processing-indicator .processing-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.background-processing-indicator .processing-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.background-processing-indicator span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
}

/* Dark mode adjustments */
body.dark-mode .background-processing-indicator {
  background: var(--message-bg);
  border-color: var(--primary-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .background-processing-indicator {
    bottom: 100px;
    max-width: 90%;
    padding: 10px 20px;
  }

  .background-processing-indicator span {
    font-size: 13px;
  }

  .background-processing-indicator .processing-spinner {
    width: 18px;
    height: 18px;
  }
}

/* ==================== MY SHARES PAGE ==================== */

.my-shares-page {
  min-height: 100vh;
  background: var(--bg-secondary);
  padding-bottom: 2rem;
}

.my-shares-page .page-header {
  background: var(--gradient-primary);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.my-shares-page .page-header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.my-shares-page .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  transition: color 0.2s;
}

.my-shares-page .back-btn:hover {
  color: white;
}

.my-shares-page .page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.my-shares-page .page-header h1 i {
  font-size: 2.5rem;
}

.my-shares-page .subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0;
}

.my-shares-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Empty State */
.empty-state-large {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-primary);
  border-radius: 1rem;
  border: 2px dashed var(--border-light);
}

.empty-state-large i {
  font-size: 5rem;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
}

.empty-state-large h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

.empty-state-large p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 2rem 0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Shares Grid */
.shares-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Share Card */
.share-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
}

.share-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.share-card.inactive {
  opacity: 0.6;
  background: var(--bg-secondary);
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.share-id {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

.share-status {
  display: flex;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-active {
  background: #d1fae5;
  color: #065f46;
}

.badge-inactive {
  background: #e5e7eb;
  color: #6b7280;
}

.badge-expired {
  background: #fee2e2;
  color: #991b1b;
}

body.dark-mode .badge-active {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

body.dark-mode .badge-inactive {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

body.dark-mode .badge-expired {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Share Card Meta */
.share-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.share-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.share-card-meta i {
  font-size: 1rem;
  color: var(--primary-color);
}

/* Share Card Actions */
.share-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.25rem;
}

.btn-icon:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.btn-icon.btn-danger:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* ==================== ANALYTICS MODAL ==================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 2rem auto;
  background: var(--bg-primary);
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: 1rem 1rem 0 0;
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.modal-header h3 i {
  color: var(--primary-color);
}

.btn-close {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.2s;
}

.btn-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 0 0 1rem 1rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Chart Section */
.chart-section {
  margin-bottom: 2rem;
}

.chart-section h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 180px;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
}

.chart-bar {
  flex: 1;
  background: var(--gradient-primary);
  border-radius: 0.375rem 0.375rem 0 0;
  min-height: 8px;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.8;
  transform: scaleY(1.05);
}

.bar-label {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.chart-labels {
  display: flex;
  justify-content: space-around;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

/* QR Section */
.qr-section {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

.qr-section h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.qr-section h4 i {
  color: var(--primary-color);
}

.qr-image {
  max-width: 300px;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  background: white;
  padding: 1rem;
}

/* Link Section */
.link-section {
  margin-bottom: 1rem;
}

.link-section h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.link-section h4 i {
  color: var(--primary-color);
}

.link-copy-row {
  display: flex;
  gap: 0.5rem;
}

.link-copy-row input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.link-copy-row input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Notification Toast */
.notification-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.notification-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.notification-toast i {
  font-size: 1.5rem;
}

.notification-success {
  border-color: #10b981;
}

.notification-success i {
  color: #10b981;
}

.notification-error {
  border-color: #ef4444;
}

.notification-error i {
  color: #ef4444;
}

.notification-info {
  border-color: var(--primary-color);
}

.notification-info i {
  color: var(--primary-color);
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
  .my-shares-page .page-header {
    padding: 1.5rem 0;
  }

  .my-shares-page .page-header h1 {
    font-size: 1.5rem;
  }

  .my-shares-page .page-header h1 i {
    font-size: 2rem;
  }

  .shares-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .share-card-actions {
    justify-content: center;
  }

  .modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .bar-chart {
    height: 140px;
  }

  .notification-toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: calc(100% - 2rem);
  }
}

/* ============================================
   Quick Plugin Modal (Prompts, etc.)
   ============================================ */

.modal.active {
  display: flex;
}

.quick-plugin-modal-content {
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.quick-plugin-modal-content .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 300px;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-secondary);
}

.loading-spinner i {
  font-size: 32px;
  animation: spin 1s linear infinite;
}

.loading-spinner p {
  margin-top: 10px;
  font-size: 14px;
}

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

/* Mode Separator */
.mode-separator {
  width: 1px;
  height: 24px;
  background: var(--border-light);
  margin: 0 4px;
}

/* Quick Button Style */
.mode-btn.quick-btn {
  color: var(--accent-color);
}

.mode-btn.quick-btn:hover {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
}

/* Error state in modal */
.quick-plugin-modal-content .error {
  color: var(--danger-color);
  text-align: center;
  padding: 40px 20px;
}

/* Responsive for quick plugin modal */
@media (max-width: 640px) {
  .quick-plugin-modal-content {
    max-width: 100%;
    max-height: 90vh;
    margin: 10px;
  }
}

/* ============================================
   COLLAPSIBLE SIDEBAR - MINIMAL DESIGN
   ============================================ */

.sidebar {
  transition: width 0.2s ease;
}

/* Collapsed state - minimal 60px rail */
.sidebar.collapsed {
  width: 60px;
}

/* Header when collapsed - compact vertical layout */
.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  min-height: auto;
}

.sidebar.collapsed .logo {
  width: 100%;
  justify-content: center;
  order: 1;
}

.sidebar.collapsed .sidebar-logo {
  width: auto;
  height: auto;
  justify-content: center;
}

.sidebar.collapsed .logo-text {
  display: none !important;
}

.sidebar.collapsed .logo-icon {
  position: static !important;
  transform: none !important;
  width: 32px !important;
  height: 32px !important;
  left: auto !important;
  top: auto !important;
}

/* Header actions when collapsed - only show collapse button */
.sidebar.collapsed .sidebar-header-actions {
  order: 2;
  width: 100%;
  justify-content: center;
}

.sidebar.collapsed .desktop-theme-toggle {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: transparent;
}

.sidebar.collapsed .sidebar-collapse-btn:hover {
  background: transparent;
  color: var(--primary-color);
}

.sidebar.collapsed .sidebar-collapse-btn i {
  font-size: 1.1rem;
  transform: rotate(180deg);
}

/* Sidebar actions when collapsed */
.sidebar.collapsed .sidebar-actions {
  padding: 0.5rem;
  flex-direction: column;
  border-bottom: none;
  gap: 0.5rem;
}

.sidebar.collapsed .search-container {
  display: none;
}

.sidebar.collapsed .new-chat-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  margin: 0 auto;
}

.sidebar.collapsed .new-chat-btn i {
  font-size: 1.1rem;
}

/* HIDE conversations section when collapsed */
.sidebar.collapsed .conversations-section {
  display: none;
}

/* Modules section when collapsed - icon only, positioned at bottom */
.sidebar.collapsed .modules-section {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
}

.sidebar.collapsed .modules-section.collapsed .modules-list {
  display: none;
}

.sidebar.collapsed .modules-header {
  padding: 0.75rem 0.5rem;
  justify-content: center;
  cursor: pointer;
}

.sidebar.collapsed .modules-title {
  font-size: 0;
  gap: 0;
}

.sidebar.collapsed .modules-title i {
  font-size: 1.1rem;
}

.sidebar.collapsed .modules-count,
.sidebar.collapsed .modules-toggle-icon {
  display: none;
}

.sidebar.collapsed .modules-list {
  display: none;
}

/* User profile when collapsed - icon only, at very bottom */
.sidebar.collapsed .user-profile-section {
  margin-top: 0;
  border-top: 1px solid var(--border-light);
}

.sidebar.collapsed .user-profile-section.collapsed .user-profile-expanded {
  display: none;
}

.sidebar.collapsed .user-profile-header {
  padding: 0.5rem;
  justify-content: center;
  cursor: pointer;
}

.sidebar.collapsed .user-profile-info {
  justify-content: center;
}

.sidebar.collapsed .user-details {
  display: none;
}

.sidebar.collapsed .user-avatar {
  margin: 0;
  width: 28px;
  height: 28px;
  background: transparent;
  color: var(--text-secondary);
}

.sidebar.collapsed .user-avatar i {
  font-size: 1.1rem;
}

.sidebar.collapsed .user-profile-compact-stats,
.sidebar.collapsed .profile-toggle-icon {
  display: none;
}

.sidebar.collapsed .user-profile-expanded {
  display: none !important;
}

/* Clickable areas expand sidebar when collapsed */
.sidebar.collapsed .modules-header,
.sidebar.collapsed .user-profile-header {
  transition: color 0.15s ease;
}

.sidebar.collapsed .modules-header:hover,
.sidebar.collapsed .user-profile-header:hover {
  color: var(--primary-color);
}

.sidebar.collapsed .modules-header:hover .modules-title i,
.sidebar.collapsed .user-profile-header:hover .user-avatar i {
  color: var(--primary-color);
}

/* Hide expand button - we use section clicks instead */
.sidebar-expand-btn {
  display: none;
}

/* Hide collapse button on mobile */
@media (max-width: 768px) {
  .sidebar-collapse-btn {
    display: none !important;
  }

  .sidebar.collapsed {
    width: 0;
    padding: 0;
    border: none;
  }
}