/* ColorKey - Modern Authentication Interface
 * Complete redesign with a focus on visual hierarchy, accessibility, and modern aesthetics
 */

:root {
  /* Color System - Light Theme */
  --primary-color: #5755d9;
  --primary-dark: #4845b8;
  --primary-light: #8785e6;
  --secondary-color: #f45b93;
  --secondary-dark: #d43476;
  --accent-color: #36d1dc;
  
  /* Suits Colors */
  --spades-color: #F4D03F;   /* Yellow */
  --hearts-color: #2ECC71;   /* Green */
  --diamonds-color: #E74C3C; /* Red */
  --clubs-color: #3498DB;    /* Blue */
  
  /* UI Colors */
  --success-color: #48c774;
  --warning-color: #ffdd57;
  --danger-color: #ff3860;
  --info-color: #4c6ef5;
  
  /* Neutral Colors */
  --text-color: #212529;
  --text-muted: #6c757d;
  --body-bg: #f9fafb;
  --card-bg: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --heading-font-weight: 700;
  --body-font-size: 16px;
  --heading-line-height: 1.2;
  --body-line-height: 1.6;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-xxl: 3rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.12);
  
  /* Animations */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --primary-color: #7e7bff;
  --primary-dark: #5755d9;
  --primary-light: #a5a3ff;
  --secondary-color: #ff7eb6;
  
  /* UI Colors */
  --text-color: #f0f0f0;
  --text-muted: #bdc3c7;
  --body-bg: #121212;
  --card-bg: #1e1e1e;
  --border-color: rgba(255, 255, 255, 0.08);
  
  /* Shadows in dark mode */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--body-font-size);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--body-bg);
  color: var(--text-color);
  line-height: var(--body-line-height);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

h1, h2, h3, h4, h5 {
  font-weight: var(--heading-font-weight);
  line-height: var(--heading-line-height);
  margin-bottom: 0.5em;
  color: var(--text-color);
}

h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Header */
.app-header {
  padding: var(--space-md) 0;
  position: relative;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.logo-icon {
  fill: var(--primary-color);
}

.logo-text, .color-key {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
  padding: 0;
  margin: 0;
}

.main-nav a {
  color: var(--text-color);
  font-weight: 500;
  position: relative;
  padding: var(--space-xs) 0;
}

.main-nav a:hover {
  color: var(--primary-color);
}

.main-nav a.active {
  color: var(--primary-color);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: var(--radius-full);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Theme Toggle */
.theme-toggle-container {
  position: relative;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  margin: 0;
}

.theme-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xs);
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 2px;
  background-color: var(--primary-color);
  transition: var(--transition-normal);
  border-radius: 50%;
  z-index: 2;
}

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

input:checked + .slider:before {
  transform: translateX(30px);
}

.theme-toggle-icon {
  z-index: 1;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

/* Main Content */
.app-content {
  flex: 1;
  padding: var(--space-xl) 0;
}

/* Page Title */
.page-title {
  margin-bottom: var(--space-xl);
  text-align: center;
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: var(--space-xl);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* Auth Card */
.auth-card {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.card-section {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.card-section:last-child {
  border-bottom: none;
}

.auth-status-container {
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: relative;
  z-index: 2;
}

.status-message {
  font-weight: 500;
  margin: 0 0 var(--space-sm);
  padding: 0.75rem 0.5rem;
  color: var(--text-color);
  line-height: 1.4;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
}

/* Suit Selection */
.suit-selection {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: var(--space-md);
  margin-top: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.suit-btn {
  background-color: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  position: relative;
  overflow: hidden;
}

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

.suit-btn.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

.suit {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
  font-family: 'Inter', 'Segoe UI Symbol', 'Helvetica Neue', 'Arial Unicode MS', 'Apple Symbols', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-variant-emoji: text;
}

.suit-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.spades {
  color: var(--spades-color);
}

.hearts {
  color: var(--hearts-color);
}

.diamonds {
  color: var(--diamonds-color);
}

.clubs {
  color: var(--clubs-color);
}

/* Enhancing card suit colors for better visibility */
.spades-color { color: #F4D03F; } /* Yellow */
.hearts-color { color: #2ECC71; } /* Green */
.clubs-color { color: #3498DB; }  /* Blue */
.diamonds-color { color: #E74C3C; } /* Red */

/* Enhanced suit symbols for selected cards */
.suit {
    font-size: 1.8rem;
    font-weight: bold;
    font-family: 'Inter', 'Segoe UI Symbol', 'Helvetica Neue', 'Arial Unicode MS', 'Apple Symbols', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-variant-emoji: text;
}

.suit.spades { 
    color: #F4D03F; 
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.suit.hearts { 
    color: #2ECC71; 
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.suit.clubs { 
    color: #3498DB; 
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.suit.diamonds { 
    color: #E74C3C; 
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* Dark mode adjustments for suit colors */
[data-theme="dark"] .suit.spades { 
    color: #F4D03F; 
    text-shadow: 0 0 3px rgba(244, 208, 63, 0.7);
}

[data-theme="dark"] .suit.hearts { 
    color: #2ECC71; 
    text-shadow: 0 0 3px rgba(46, 204, 113, 0.7);
}

[data-theme="dark"] .suit.clubs { 
    color: #3498DB; 
    text-shadow: 0 0 3px rgba(52, 152, 219, 0.7);
}

[data-theme="dark"] .suit.diamonds { 
    color: #E74C3C; 
    text-shadow: 0 0 3px rgba(231, 76, 60, 0.7);
}

/* Progress Bar */
.progress-container {
  height: 6px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0;
  transition: width 0.5s ease;
  border-radius: var(--radius-full);
}

/* Buttons */
.button-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

.primary-button, .secondary-button {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  font-family: var(--font-family);
  font-size: 1rem;
  min-width: 120px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

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

.primary-button:hover:not(:disabled) {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-button {
  background-color: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.secondary-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

[data-theme="dark"] .secondary-button:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Icon Button */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Visualization */
.visualization-section {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.visualization {
  width: 100%;
  height: 300px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Möbius visualization */
.background-circle {
  stroke: var(--border-color);
  stroke-width: 1;
  opacity: 0.3;
}

.outer-quadrant, .inner-quadrant {
  transition: opacity 0.5s ease, fill 0.5s ease;
  fill-opacity: 1;
}

.outer-quadrant:hover, .inner-quadrant:hover {
  opacity: 0.3 !important;
  cursor: pointer;
}

.outer-quadrant.active, .inner-quadrant.active {
  opacity: 0.5 !important;
}

/* Möbius path styling */
.mobius-path {
  filter: drop-shadow(0 0 2px rgba(var(--primary-color-rgb), 0.4));
  transition: all 0.5s ease;
}

/* Character text */
.char-text {
  font-family: 'Roboto Mono', monospace;
  font-weight: bold;
  text-shadow: 0 0 3px rgba(0,0,0,0.5);
  transition: transform 0.3s ease, opacity 0.3s ease, font-size 0.3s ease;
}

.char-text:hover {
  transform: scale(1.5);
  cursor: pointer;
  opacity: 1 !important;
  z-index: 10;
}

/* Points and particles */
.point {
  transition: all 0.5s ease;
  filter: drop-shadow(0 0 4px rgba(var(--primary-color-rgb), 0.6));
}

.active-point {
  animation: pulse 1.5s infinite alternate;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.7));
}

.particle {
  animation: float 10s infinite ease-in-out;
  opacity: 0.5;
}

@keyframes pulse {
  0% {
    r: 6;
    opacity: 0.7;
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.5));
  }
  100% {
    r: 9;
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.8));
  }
}

@keyframes float {
  0% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(3px) translateX(-2px); }
  50% { transform: translateY(0) translateX(0); }
  75% { transform: translateY(-3px) translateX(2px); }
  100% { transform: translateY(0) translateX(0); }
}

/* Hyperplane colors */
.hyperplane-label.spades {
  color: var(--spades-color);
}

.hyperplane-label.hearts {
  color: var(--hearts-color);
}

.hyperplane-label.diamonds {
  color: var(--diamonds-color);
}

.hyperplane-label.clubs {
  color: var(--clubs-color);
}

.hyperplane-label {
  pointer-events: none;
}

/* Intro Section */
.intro-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-xxl);
}

.intro-content {
  padding: var(--space-xl) 0;
}

.subtitle {
  font-size: 2.5rem;
  margin-bottom: var(--space-lg);
}

.intro-text {
  font-size: 1.2rem;
  margin-bottom: var(--space-xl);
  color: var(--text-muted);
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Features Section */
.features-section {
  padding: var(--space-xxl) 0;
}

.features-section h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  background-color: var(--card-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1), rgba(var(--secondary-color-rgb), 0.1));
  border-radius: 50%;
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
}

.feature-card p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Admin Panel */
.admin-panel {
  position: fixed;
  right: var(--space-lg);
  bottom: var(--space-lg);
  width: 320px;
  max-width: 90vw;
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transform: translateX(calc(100% + var(--space-lg)));
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.admin-panel.visible {
  transform: translateX(0);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.admin-header h3 {
  margin: 0;
}

.admin-content {
  padding: var(--space-lg);
}

.setting-group {
  margin-bottom: var(--space-lg);
}

.setting-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.setting-group input[type="range"] {
  width: 100%;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  outline: none;
  -webkit-appearance: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

.setting-value {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: block;
  margin-top: var(--space-xs);
}

.counter-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background-color: rgba(var(--primary-color-rgb), 0.05);
  border-radius: var(--radius-md);
}

#auth-counter {
  font-weight: bold;
  color: var(--primary-color);
}

/* Global counter styles */
.global-counter {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: var(--primary-color, #3a7bd5);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.global-counter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.counter-value {
    font-weight: bold;
    transition: all 0.3s ease;
}

/* Counter update animation */
.counter-updated {
    animation: counter-pulse 1.5s ease;
}

@keyframes counter-pulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(255,255,255,0);
    }
    20% {
        transform: scale(1.3);
        text-shadow: 0 0 10px rgba(255,255,255,0.8);
    }
    100% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(255,255,255,0);
    }
}

/* Dark mode adjustments for counter */
[data-theme="dark"] .global-counter {
    background-color: var(--primary-color-dark, #2c5aa0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .global-counter:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Responsive counter */
@media (max-width: 768px) {
    .global-counter {
        top: auto;
        bottom: 20px;
        left: 20px;
        right: auto;
    }
}

@media (max-width: 480px) {
    .global-counter {
        left: 50%;
        transform: translateX(-50%);
        bottom: 20px;
    }
    
    .global-counter:hover {
        transform: translateX(-50%) translateY(-2px);
    }
}

/* Admin Toggle Button */
.admin-toggle {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  transition: all var(--transition-fast);
}

.admin-toggle:hover {
  transform: translateY(-2px) rotate(30deg);
  box-shadow: var(--shadow-lg);
}

/* Fixed Theme Toggle */
#themeToggleFixed {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 900;
  transition: all var(--transition-fast);
}

#themeToggleFixed:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Notification Overlay */
.notification-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.notification-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.notification-content {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 90%;
  max-height: 90%;
  width: 500px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.notification-content h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.notification-content.success h3 {
  color: var(--success-color);
}

.notification-content.error h3 {
  color: var(--danger-color);
}

.notification-content p {
  margin-bottom: var(--space-lg);
}

/* Documentation Page */
.docs-nav {
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-md);
}

.docs-nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  justify-content: center;
}

.docs-nav li a {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-weight: 500;
}

.docs-nav li a:hover {
  background-color: rgba(var(--primary-color-rgb), 0.05);
}

.content-section {
  margin-bottom: var(--space-xxl);
}

.code-container {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
}

.math-block {
  padding: var(--space-md);
  background-color: rgba(var(--primary-color-rgb), 0.05);
  border-radius: var(--radius-md);
  font-family: monospace;
  margin: var(--space-md) 0;
}

.suit-mapping {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.suit-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background-color: var(--body-bg);
  border-radius: var(--radius-md);
}

.flow-steps {
  padding-left: var(--space-xl);
}

.flow-steps li {
  margin-bottom: var(--space-md);
}

.security-note {
  background-color: rgba(var(--warning-color-rgb), 0.1);
  border-left: 4px solid var(--warning-color);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
}

.api-table th, .api-table td {
  padding: var(--space-sm);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.api-table th {
  background-color: rgba(var(--primary-color-rgb), 0.05);
  font-weight: 600;
}

.api-table td code {
  background-color: rgba(var(--primary-color-rgb), 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: monospace;
}

/* Mobile styles */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 1001;
  background-color: var(--card-bg);
  border: none;
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--body-bg);
  z-index: 1000;
  padding: var(--space-xxl) var(--space-lg);
  flex-direction: column;
  gap: var(--space-lg);
}

.mobile-menu a {
  font-size: 1.5rem;
  font-weight: 500;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.mobile-menu a.active {
  color: var(--primary-color);
}

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

/* Instructions Panel */
.instructions-panel {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.instructions-panel h3 {
  margin-bottom: var(--space-md);
  color: var(--primary-color);
}

.instructions-panel ol {
  margin-bottom: var(--space-lg);
}

.instructions-panel li {
  margin-bottom: var(--space-sm);
}

.instructions-panel .note {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */
.app-footer {
  margin-top: auto;
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: var(--space-lg) 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.footer-content p {
  margin-bottom: var(--space-xs);
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

/* Error pages */
.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.error-container {
  max-width: 500px;
}

.error-code {
  font-size: 6rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.error-title {
  margin-bottom: var(--space-lg);
}

.error-message {
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.error-actions {
  margin-top: var(--space-lg);
}

/* Media Queries */
@media (max-width: 992px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .main-nav ul {
    flex-wrap: wrap;
  }
  
  .auth-card {
    margin: 0 var(--space-sm);
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .main-nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .mobile-menu:not(.hidden) {
    display: flex;
  }
  
  .header-controls {
    display: none;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .cta-buttons {
    flex-direction: column;
  }
  
  .admin-panel {
    width: 90vw;
  }
}

@media (max-width: 480px) {
  .app-content {
    padding: var(--space-md) 0;
  }
  
  .intro-content {
    padding: var(--space-md) 0;
  }
  
  .suit-selection {
    flex-direction: column;
    align-items: center;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .global-counter {
    display: none;
  }
}

/* Override mobile column layout for card interface suit row */
@media (max-width: 480px) {
  .card-interface-container .suit-selection {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Add CSS variables for RGB values of colors for rgba usage */
:root {
  --primary-color-rgb: 87, 85, 217;
  --secondary-color-rgb: 244, 91, 147;
  --warning-color-rgb: 255, 221, 87;
  --success-color-rgb: 72, 199, 116;
  --danger-color-rgb: 255, 56, 96;
}

[data-theme="dark"] {
  --primary-color-rgb: 126, 123, 255;
  --secondary-color-rgb: 255, 126, 182;
}

/* Terminal Demo Enhanced Styles */
.terminal-demo-section {
    margin: 3rem 0;
    padding: 0 1rem;
}

.terminal-demo-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.terminal-container {
    width: 90%;
    max-width: 900px;
    margin: 2rem auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    background-color: #1e1e1e;
    transition: all 0.3s ease;
    transform-origin: center top;
}

.terminal-container.maximized {
    width: 100%;
    max-width: 100%;
    height: 80vh;
    position: fixed;
    top: 10vh;
    left: 0;
    right: 0;
    z-index: 1000;
    border-radius: 0;
}

.terminal-container.closed {
    transform: scale(0.95);
    opacity: 0;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(90deg, #2a2a2a, #323232);
    border-bottom: 1px solid #444;
}

.terminal-title {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: #ccc;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.terminal-control {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

#terminalClose {
    background-color: #ff5f56;
}

#terminalMinimize {
    background-color: #ffbd2e;
}

#terminalMaximize {
    background-color: #27c93f;
}

.terminal-content {
    height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.3s ease;
}

.terminal-content.minimized {
    height: 0;
}

.terminal-output {
    flex: 1;
    background-color: #121212;
    padding: 15px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: #eee;
    overflow-y: auto;
    line-height: 1.5;
    
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #666 #1e1e1e;
}

.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.terminal-output::-webkit-scrollbar-thumb {
    background-color: #666;
    border-radius: 4px;
}

.command-line {
    margin-bottom: 8px;
}

.prompt {
    color: #64dd17;
    margin-right: 8px;
}

.output-line {
    margin-bottom: 6px;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

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

.terminal-actions {
    padding: 15px;
    background-color: #1a1a1a;
    border-top: 1px solid #333;
}

.mode-selection {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.golden-button {
    background: linear-gradient(135deg, #FFC857 0%, #E2A93B 50%, #FFC857 100%);
    color: #000;
    font-weight: 600;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(255, 200, 87, 0.3), 0 0 20px rgba(255, 200, 87, 0.1);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.golden-button:before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.golden-button:hover {
    box-shadow: 0 5px 15px rgba(255, 200, 87, 0.5), 0 0 30px rgba(255, 200, 87, 0.2);
    transform: translateY(-2px);
}

.golden-button:hover:before {
    opacity: 0.5;
    animation: pulse 1.5s infinite;
}

.golden-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(255, 200, 87, 0.4);
}

.golden-button.active {
    background: linear-gradient(135deg, #E2A93B 0%, #D99B29 50%, #E2A93B 100%);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
}

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

.direction-controls {
    display: grid;
    grid-template-areas: 
        ". north ."
        "west . east"
        ". south .";
    grid-gap: 10px;
    max-width: 250px;
    margin: 15px auto;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.direction-controls.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.direction-btn {
    background-color: #333;
    color: #eee;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.direction-btn:hover {
    background-color: #444;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.direction-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.direction-btn.north { grid-area: north; }
.direction-btn.west { grid-area: west; }
.direction-btn.east { grid-area: east; }
.direction-btn.south { grid-area: south; }

.direction-btn.debug-highlight {
    background-color: rgba(100, 221, 23, 0.3);
    border-color: #64dd17;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { background-color: rgba(100, 221, 23, 0.3); }
    50% { background-color: rgba(100, 221, 23, 0.6); }
    100% { background-color: rgba(100, 221, 23, 0.3); }
}

.password-progress {
    margin: 15px 0;
    padding: 0 15px;
}

.progress-bar {
    height: 8px;
    background-color: #333;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #64dd17, #aeea00);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 5px;
    color: #aaa;
}

.password-display {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 1.5rem;
    letter-spacing: 5px;
    margin: 15px 0;
    color: #eee;
    transition: all 0.3s ease;
}

.debug-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 0 10px;
}

.debug-toggle {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #aaa;
    cursor: pointer;
}

.debug-toggle input {
    margin-right: 5px;
}

.reset-btn {
    background-color: #333;
    color: #eee;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background-color: #444;
}

.highlight {
    color: #FFD700;
    font-weight: bold;
}

.interactive-mode {
    color: #64dd17;
    font-weight: bold;
}

.correct {
    color: #64dd17;
    font-weight: bold;
}

.incorrect {
    color: #ff5252;
    font-weight: bold;
}

.debug-info {
    color: #64b5f6;
    font-style: italic;
    opacity: 0.8;
}

.success-large {
    display: block;
    text-align: center;
    font-size: 1.5rem;
    color: #64dd17;
    font-weight: bold;
    margin: 15px 0;
    padding: 10px;
    border: 1px dashed #64dd17;
    border-radius: 4px;
    background-color: rgba(100, 221, 23, 0.1);
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.tutorial-step {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease;
}

.tutorial-step.hidden {
    opacity: 0;
    visibility: hidden;
}

.tutorial-highlight {
    position: absolute;
    animation: bounce 2s infinite;
}

.tutorial-arrow {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 20px solid #FFD700;
    margin: 0 auto 10px;
}

.tutorial-message {
    background-color: #FFD700;
    color: #000;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    max-width: 250px;
    text-align: center;
    font-size: 0.9rem;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Confetti Animation */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.confetti {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 20px;
    background-color: #f00;
    opacity: 0.8;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(400px) rotate(720deg);
        opacity: 0;
    }
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature-box {
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-box h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.feature-box p {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Expandable Section */
.expandable-section {
    margin: 30px 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1e1e1e;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.expandable-header {
    padding: 15px 20px;
    background-color: #2a2a2a;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expandable-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.expand-icon {
    color: #aaa;
    transition: transform 0.3s ease;
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.expandable-content.expanded {
    max-height: 1000px;
}

.crypto-details {
    padding: 20px;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item h5 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #eee;
}

.detail-item p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #bbb;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .terminal-container {
        width: 100%;
    }
    
    .terminal-content {
        height: 350px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .terminal-content {
        height: 300px;
    }
    
    .password-display {
        font-size: 1.2rem;
        letter-spacing: 3px;
    }
    
    .golden-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* API Reference Section Styles */
.api-reference-section {
  padding: 3rem 0;
  background-color: var(--color-background-alt);
  border-radius: 8px;
  margin: 2rem 0;
}

.api-reference-section h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-description {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  color: var(--color-text-secondary);
}

/* Language Tabs */
.language-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.language-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.language-tab:hover {
  background: var(--color-background-hover);
}

.language-tab.active {
  background: var(--gradient-gold);
  color: var(--color-text-on-primary);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(226, 185, 59, 0.3);
}

.language-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Code Block Container */
.code-examples {
  max-width: 90%;
  margin: 0 auto;
}

.code-block-container {
  background: var(--color-code-background);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.code-block-container.hidden {
  display: none;
}

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

.code-title {
  font-weight: 600;
  color: var(--color-text-primary);
}

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

.copy-btn, .collapse-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.copy-btn:hover, .collapse-btn:hover {
  background: var(--color-background-hover);
  color: var(--color-text-primary);
}

.code-content {
  padding: 1rem;
  max-height: 500px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.code-content.collapsed {
  max-height: 0;
  padding: 0 1rem;
  overflow: hidden;
}

.code-content pre {
  margin: 0;
  padding: 0;
}

.code-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre;
}

/* API Endpoints */
.api-endpoints {
  max-width: 90%;
  margin: 2rem auto 0;
}

.api-endpoints h3 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.endpoint-container {
  background: var(--color-background);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.endpoint-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--color-background-alt);
  cursor: pointer;
}

.http-method {
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-right: 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.http-method.post {
  background: var(--color-success-light);
  color: var(--color-success);
}

.http-method.get {
  background: var(--color-info-light);
  color: var(--color-info);
}

.endpoint-path {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  flex-grow: 1;
}

.endpoint-content {
  padding: 1rem;
  transition: max-height 0.3s ease, padding 0.3s ease;
  max-height: 1000px;
  overflow: hidden;
}

.endpoint-content.collapsed {
  max-height: 0;
  padding: 0 1rem;
}

.endpoint-description {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

.params-section, 
.example-section {
  margin-top: 1.5rem;
}

.params-section h4, 
.example-section h4 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.param-table {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

.param-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 3fr;
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.param-row:last-child {
  border-bottom: none;
}

.param-row.header {
  background: var(--color-background-alt);
  font-weight: 600;
}

/* Advanced Cryptographic Details Section */
#advanced-cryptographic-details {
  margin: 3rem 0;
}

.expandable-section {
  background: var(--color-background-alt);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.expandable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  cursor: pointer;
  background: var(--color-header-background);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

.expandable-header:hover {
  background: var(--color-background-hover);
}

.expandable-header h3 {
  margin: 0;
  color: var(--color-primary);
  font-weight: 600;
}

.expand-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-primary);
  transition: transform 0.3s ease;
}

.expandable-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.expandable-content.expanded {
  max-height: 2000px;
}

.crypto-details {
  padding: 2rem;
}

.detail-item {
  margin-bottom: 2rem;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-item h5 {
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.detail-item p {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.detail-item ul {
  padding-left: 1.5rem;
  color: var(--color-text-secondary);
}

.detail-item li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .language-tabs {
    flex-wrap: wrap;
  }
  
  .param-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .param-row > div:before {
    content: attr(data-label);
    font-weight: 600;
    display: inline-block;
    margin-right: 0.5rem;
  }
  
  .param-row.header {
    display: none;
  }
}

/* Improved Loader */
.visualization.loading {
    position: relative;
    min-height: 200px;
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -25px;
    margin-left: -25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 5px solid rgba(var(--primary-color-rgb), 0.1);
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.loader:before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: rgba(var(--primary-color-rgb), 0.5);
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: var(--error-color);
    background-color: rgba(var(--error-rgb), 0.1);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    margin: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Visualization Loading States */
.visualization {
    position: relative;
    min-height: 300px;
    transition: opacity 0.3s ease;
}

.visualization-section {
    position: relative;
}

.visualization svg {
    transition: opacity 0.3s ease;
}

.visualization.loading svg {
    opacity: 0.4;
}

.visualization .message {
    font-size: 14px;
    text-align: center;
    color: var(--text-color-light);
}

/* Fallback visualization */
.hyperplane-label {
    font-family: sans-serif;
    font-weight: bold;
    pointer-events: none;
}

.background-circle {
    fill: rgba(var(--background-rgb), 0.2);
    stroke: var(--border-color);
    stroke-width: 1px;
}

.active-point {
    fill: var(--primary-color);
    stroke: white;
    stroke-width: 2px;
    filter: drop-shadow(0 0 5px rgba(var(--primary-color-rgb), 0.5));
}

/* Animation for counter changes */
@keyframes counterPulse {
    0% { transform: scale(1); color: var(--text-color); }
    50% { transform: scale(1.1); color: var(--primary-color); }
    100% { transform: scale(1); color: var(--text-color); }
}

.counter-updated {
    animation: counterPulse 0.5s ease;
}

/* Animation for success */
@keyframes successPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(var(--success-rgb), 0); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(var(--success-rgb), 0.4); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(var(--success-rgb), 0); }
}

.auth-success {
    animation: successPulse 1.5s ease;
}

/* Animation for failure */
@keyframes failurePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(var(--error-rgb), 0); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px rgba(var(--error-rgb), 0.4); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(var(--error-rgb), 0); }
}

.auth-failure {
    animation: failurePulse 1.5s ease;
}

/* CSS styles for the Möbius visualization */
.visualization-svg {
    background-color: var(--background-color, #f8fafc);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.char-text {
    font-family: 'Roboto Mono', monospace;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, opacity 0.3s ease, font-size 0.3s ease;
}

.char-text:hover {
    transform: scale(1.5);
    cursor: pointer;
    opacity: 1 !important;
    z-index: 10;
}

/* Hyperplane colors */
.outer-quadrant, .inner-quadrant {
    transition: opacity 0.5s ease, fill 0.5s ease;
}

/* Suit-specific colors */
.spades-color { color: #F4D03F; } /* Yellow */
.hearts-color { color: #2ECC71; } /* Green */
.clubs-color { color: #3498DB; }  /* Blue */
.diamonds-color { color: #E74C3C; } /* Red */

/* Animation point */
.point {
    transition: cx 0.4s ease, cy 0.4s ease, r 0.3s ease;
}

.active-point {
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% {
        r: 6;
        opacity: 0.7;
    }
    100% {
        r: 9;
        opacity: 1;
    }
}

/* Legend styles */
.legend-title {
    font-family: var(--font-family);
    font-weight: 500;
}

.color-legend text {
    font-family: var(--font-family);
}

/* Make visualization responsive */
@media (max-width: 768px) {
    .legend-title {
        font-size: 0.7rem !important;
    }
    
    .color-legend text {
        font-size: 0.7rem !important;
    }
}

/* Improve accessibility */
@media (prefers-reduced-motion: reduce) {
    .char-text, .point, .active-point {
        transition: none;
        animation: none;
    }
}

/* Tooltip for character selection */
.char-tooltip {
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
}
