/* Elysian-Chat-Reader - Ultra Modern Dark UI - OPTIMIZED FOR PERFORMANCE */

/* Add performance mode class that can be toggled via JavaScript */
.performance-mode {
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: none;
  --shadow-glow: none;
  --transition: none;
}

/* Modern Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette - Ultra Modern Dark Theme */
  --primary: #6644FF;
  --primary-light: #8A66FF;
  --primary-dark: #5533DD;
  --secondary: #FF3CAC;
  --accent: #00FFD1;
  --info: #3D8BFF;
  
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-panel: #1A1F2E;
  --bg-dark: #0B1120;
  --bg-input: #111827;
  
  --border: #334155;
  --border-light: #1E293B;
  --border-focus: #3B82F6;
  
  /* Simplified shadows for better performance */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.2);
  --shadow-glow: none; /* Removed glow effect for performance */
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;
  
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  
  /* Simplified transitions for better performance */
  --transition: all 0.2s ease;
  
  --header-height: 64px;
  --layout-max-width: 1600px;
  --panel-height: 700px;

  /* Event Type Colors */
  --chat-color: var(--accent);
  --gift-color: #FFCC00;
  --like-color: var(--secondary);
  --follow-color: var(--info);
  --share-color: #E879F9;
  --join-color: #4ADE80;
  --subscribe-color: #FB923C;
  --question-color: #22D3EE;
  --system-color: var(--text-muted);
}

/* Base Styles */
html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-dark);
}

/* Apply performance mode by default */
body {
  /* Auto-apply performance optimizations for high viewer streams */
  transition: none;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header Styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-height);
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  
  /* Remove backdrop filter for performance */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary);
}

.logo-text {
  font-weight: 600;
  font-size: 1.125rem;
}

.server-status {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.status-label {
  font-weight: 500;
}

.status-value {
  color: var(--text-secondary);
}

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

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  border: none;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.icon-button:hover {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 0 12px rgba(102, 68, 255, 0.5);
}

/* Main Content Styles */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 0;
  width: 100%;
}

/* Hero Section */
.hero-section {
  padding: 2rem 1rem;
  border-radius: var(--radius-lg);
  background-color: var(--bg-primary); /* Simplified from gradient for performance */
  border: 1px solid var(--border);
  box-shadow: var(--shadow);           /* Reduced shadow for performance */
  color: white;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

/* Remove gradient effect for better performance */
.hero-section::before {
  display: none;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  /* Remove gradient text effect for performance */
  -webkit-background-clip: text;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
}

.connect-form {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.input-group {
  display: flex;
  position: relative;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  overflow: hidden;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
}

#uniqueIdInput {
  flex: 1;
  height: 3.5rem;
  padding: 0 1rem 0 2.5rem;
  border: none;
  background-color: var(--bg-input);
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 1rem;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

#uniqueIdInput:focus {
  box-shadow: inset 0 0 0 1px var(--border-focus);
}

#connectButton {
  padding: 0 1.5rem;
  height: 3.5rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

#connectButton:hover {
  background-color: var(--primary-light);
  box-shadow: 0 0 15px rgba(102, 68, 255, 0.5);
}

.connect-status {
  margin-top: 1rem;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Stats Dashboard */
.stats-dashboard {
  margin-bottom: 1.5rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background-color: var(--bg-panel);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  /* Remove transforms and transitions for better performance */
  transition: none;
}

/* Remove pseudo-element gradient for performance */
.stat-card::after {
  display: none;
}

.stat-card:hover {
  /* Remove hover effects for better performance */
  transform: none;
  box-shadow: var(--shadow);
}

.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.secondary { border-left: 4px solid var(--secondary); }
.stat-card.accent { border-left: 4px solid var(--accent); }
.stat-card.info { border-left: 4px solid var(--info); }

.stat-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bg-secondary);
}

.viewers-icon::before { content: '👥'; font-size: 1.5rem; }
.likes-icon::before { content: '❤️'; font-size: 1.5rem; }
.diamonds-icon::before { content: '💎'; font-size: 1.5rem; }
.messages-icon::before { content: '💬'; font-size: 1.5rem; }

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Dashboard Panels */
.dashboard-panels {
  flex: 1;
  margin-bottom: 1.5rem;
}

.panel-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  height: var(--panel-height);
}

@media (max-width: 1600px) {
  .panel-layout {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .panel-layout {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  
  .panel {
    height: 500px;
    margin-bottom: 1rem;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background-color: var(--bg-panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  border: 1px solid var(--border);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.panel-header-content {
  display: flex;
  align-items: center;
}

.panel-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-counter {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: var(--bg-secondary);
  font-family: var(--font-mono);
  margin-left: 0.5rem;
}

.panel-body {
  flex: 1;
  padding: 0.5rem;
  overflow-y: auto;
  background-color: var(--bg-panel);
}

/* Event Streams */
.event-stream {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  overflow-y: auto;
  padding: 0.5rem;
  
  /* Optimize scrolling performance */
  will-change: transform; /* Let browser know this element will change frequently */
  -webkit-overflow-scrolling: touch;
}

.event-item {
  display: flex;
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  border-left: 3px solid transparent;
  
  /* Remove transition for better performance */
  transition: none;
}

.event-item:hover {
  /* Simplify hover effect for better performance */
  background-color: var(--bg-primary);
  transform: none;
}

.event-item.type-chat { border-left-color: var(--chat-color); }
.event-item.type-gift { border-left-color: var(--gift-color); }
.event-item.type-like { border-left-color: var(--like-color); }
.event-item.type-follow { border-left-color: var(--follow-color); }
.event-item.type-share { border-left-color: var(--share-color); }
.event-item.type-subscribe { border-left-color: var(--subscribe-color); }
.event-item.type-system { border-left-color: var(--system-color); }
.event-item.type-viewerCountUpdate { 
  border-left-color: #38BDF8; /* Light blue for viewer count updates */
}

.event-icon {
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.event-profile-pic {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  margin-right: 0.75rem;
  object-fit: cover;
  border: 2px solid var(--bg-dark);
}

.event-profile-placeholder {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  margin-right: 0.75rem;
  background-color: var(--primary-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.event-content {
  flex: 1;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

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

.event-user-link {
  color: var(--primary-light);
  text-decoration: none;
}

.event-user-link:hover {
  text-decoration: underline;
}

.event-text {
  color: var(--text-secondary);
  word-break: break-word;
  font-family: var(--font-sans);
}

.event-timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  font-family: var(--font-mono);
}

.gift-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
}

.gift-icon-img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
}

.gift-name {
  font-weight: 500;
  color: var(--text-primary);
}

.gift-value {
  color: var(--accent);
  font-weight: 500;
}

.gift-combo-count {
  font-weight: 600;
  color: var(--secondary);
}

/* Advanced Metrics */
.advanced-metrics {
  padding: 1.5rem;
  border-radius: var(--radius);
  background-color: var(--bg-panel);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

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

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

.data-volume {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
}

.data-volume-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.data-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.data-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.metric-item {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  transition: var(--transition);
  border: 1px solid var(--border-light);
}

.metric-item:hover {
  background-color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.metric-item.active {
  border-left: 3px solid var(--accent);
}

.metric-item.stale {
  border-left: 3px solid var(--gift-color);
}

.metric-item.inactive {
  border-left: 3px solid var(--text-muted);
  opacity: 0.7;
}

.metric-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.metric-count {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--primary-light);
  font-family: var(--font-mono);
}

.metric-last-received {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.metric-description {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Footer */
.app-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-content a {
  color: var(--primary-light);
  text-decoration: none;
}

.footer-content a:hover {
  text-decoration: underline;
}

/* Connection States */
body.disconnected .hero-section {
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
}

body.connecting .hero-section {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), var(--bg-secondary));
  border-color: var(--gift-color);
}

body.connected .hero-section {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), var(--bg-secondary));
  border-color: var(--join-color);
}

body.disconnected #stateText {
  color: var(--text-secondary);
}

body.connecting #stateText {
  color: var(--gift-color);
  font-weight: 500;
}

body.connected #stateText {
  color: var(--accent);
  font-weight: 600;
}

/* Hidden elements for JS functionality */
.hidden-selectors,
.hidden-panels {
  display: none !important;
}

/* Animations - SIMPLIFIED FOR PERFORMANCE */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); } /* Reduced scale effect */
  100% { transform: scale(1); }
}

.highlight-combo {
  /* Reduced animation intensity */
  animation: pulse 0.3s ease-in-out;
}

/* Performance mode specific overrides - enabled through JavaScript */
body.performance-mode .hero-section,
body.performance-mode .stat-card,
body.performance-mode .panel,
body.performance-mode .event-item,
body.performance-mode .metric-item,
body.performance-mode .gift-details,
body.performance-mode .leaderboard-item {
  box-shadow: none !important;
  transition: none !important;
}

body.performance-mode .event-item:hover,
body.performance-mode .metric-item:hover,
body.performance-mode .leaderboard-item:hover {
  transform: none !important;
  box-shadow: none !important;
}

body.performance-mode .highlight-combo {
  animation: none !important;
}

/* Make scrollbars simpler for better performance */
.performance-mode::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.performance-mode::-webkit-scrollbar-track {
  background: transparent;
}

.performance-mode::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 0;
}

/* Terminal/Code-like elements */
.code-text {
  font-family: var(--font-mono);
  background-color: var(--bg-input);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-indicator.online { background-color: var(--join-color); }
.status-indicator.connecting { background-color: var(--gift-color); }
.status-indicator.offline { background-color: var(--text-muted); }

/* If we want to style the content differently too */
.event-item.type-viewerCountUpdate .event-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* Add viewerCount icon to the icons list */
.event-icon.viewer-icon::before { 
  content: '👁️'; 
  font-size: 1.2rem; 
}

/* Top Viewers Leaderboard */
.leaderboard-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  overflow-y: auto;
  padding: 0.5rem;
}

.leaderboard-placeholder {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
  font-style: italic;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  border-left: 3px solid transparent;
  transition: var(--transition);
  position: relative;
}

.leaderboard-item:hover {
  background-color: var(--bg-primary);
  transform: translateX(2px);
}

.leaderboard-rank {
  position: absolute;
  top: -0.5rem;
  left: -0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

/* Different colors for top 3 */
.leaderboard-rank.rank-1 { background-color: gold; color: black; }
.leaderboard-rank.rank-2 { background-color: silver; color: black; }
.leaderboard-rank.rank-3 { background-color: #CD7F32; /* bronze */ }

.leaderboard-profile-pic {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  margin-right: 1rem;
  object-fit: cover;
  border: 2px solid var(--bg-dark);
}

.leaderboard-profile-placeholder {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  margin-right: 1rem;
  background-color: var(--primary-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.leaderboard-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.leaderboard-name {
  font-weight: 600;
  color: var(--text-primary);
}

.leaderboard-coins {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gift-color);
  font-weight: 500;
  font-size: 0.875rem;
}

.leaderboard-coins::before {
  content: '🪙';
  font-size: 1rem;
}

/* Add scroll toggle button styles */
.scroll-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: 0.5rem;
  border: none;
}

.scroll-toggle:hover {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.scroll-toggle.active {
  color: var(--accent);
}

.scroll-toggle svg {
  width: 1rem;
  height: 1rem;
}

/* Ensure no backdrop filters or blur effects are used */
.app-header,
.panel-header,
.hero-section,
.advanced-metrics,
.stat-card,
.event-item,
.gift-details,
.leaderboard-item,
.panel-counter,
.scroll-toggle,
.status-item {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}

/* Performance settings modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 9999; /* Increased z-index to ensure it's on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow: auto;
  opacity: 1 !important; /* Force opacity */
  visibility: visible !important; /* Force visibility */
}

.modal-content {
  position: relative;
  background-color: var(--bg-panel);
  margin: 10vh auto; /* Adjusted to show higher */
  padding: 0;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--primary); /* Highlighted border */
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  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);
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.close-button {
  color: var(--text-secondary);
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.close-button:hover {
  color: var(--primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background-color: var(--bg-secondary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.primary-button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
}

.primary-button:hover {
  background-color: var(--primary-light);
}

.secondary-button {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
}

.secondary-button:hover {
  background-color: var(--bg-secondary);
}

/* Settings options */
.settings-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

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

.settings-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.settings-label label {
  font-weight: 500;
  color: var(--text-primary);
}

.settings-description {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  cursor: pointer;
  margin: 0;
}

.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all 0.3s;
  border-radius: 34px;
  z-index: 1;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: all 0.3s;
  border-radius: 50%;
}

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

input:checked + .slider:before {
  transform: translateX(24px);
  background-color: white;
}

/* Range sliders */
.slider-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 60%;
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: var(--bg-secondary);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}

/* Settings button in header */
.settings-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  margin-left: 5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-button:hover {
  color: var(--primary);
}

/* Make performance status clickable */
#performance-status {
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius);
  transition: background-color 0.2s;
  background-color: rgba(102, 68, 255, 0.1);
  border: 1px dashed var(--primary-dark);
}

#performance-status:hover {
  background-color: var(--primary-dark);
  color: white;
}

/* Click hint */
.click-hint {
  font-size: 0.75rem;
  color: var(--primary);
  margin-left: 5px;
  font-style: italic;
}

/* Blinking attention message */
.modal-attention {
  color: #ff3cac;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 4px;
  background-color: rgba(255, 60, 172, 0.1);
  font-size: 16px;
  position: absolute;
  bottom: -40px;
  right: 10px;
}

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

.blinking {
  animation: blink 1s infinite;
}

/* Standalone performance button */
.performance-button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-size: 16px;
}

.performance-button:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}