/* Czech Election Calculator 2025 - Ankap Style CSS */
/* Black background, yellow accents, industrial minimalism */

:root {
  /* Core Colors */
  --color-primary: #FFD93D;      /* Bright yellow */
  --color-secondary: #FFF200;    /* Electric yellow */
  --color-bg-dark: #0A0A0A;      /* Near black */
  --color-bg-darker: #000000;    /* Pure black */
  --color-text: #FFFFFF;         /* White text */
  --color-text-muted: #CCCCCC;   /* Light grey */
  --color-text-dark: #999999;    /* Dark grey */
  
  /* System Colors */
  --color-success: #00FF41;      /* Matrix green */
  --color-warning: #FF6B00;      /* Orange */
  --color-error: #FF3366;        /* Red */
  
  /* Compass specific backgrounds */
  --color-bg-secondary: rgba(0, 0, 0, 0.3);
  --color-bg-tertiary: rgba(0, 0, 0, 0.2);
  --color-border: rgba(255, 217, 61, 0.15);
  
  /* Spacing - 8px grid system */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 32px;
  --font-size-4xl: 40px;
  --font-size-5xl: 48px;
  
  /* Effects */
  --shadow-sm: 0 2px 8px rgba(255, 217, 61, 0.1);
  --shadow-md: 0 4px 16px rgba(255, 217, 61, 0.15);
  --shadow-lg: 0 8px 32px rgba(255, 217, 61, 0.2);
  --border-radius: 4px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme variables */
.theme-light {
  --color-primary: #E6B800;      /* Darker yellow for better contrast */
  --color-secondary: #D4AF00;    /* Darker electric yellow */
  --color-bg-dark: #FFFFFF;
  --color-bg-darker: #F5F5F5;
  --color-text: #1A1A1A;
  --color-text-muted: #4A4A4A;
  --color-text-dark: #666666;
  
  /* Compass specific backgrounds for light theme */
  --color-bg-secondary: rgba(240, 240, 240, 0.95);
  --color-bg-tertiary: rgba(248, 248, 248, 0.95);
  --color-border: rgba(200, 200, 200, 0.3);
  
  /* Update shadows for light theme */
  --shadow-sm: 0 2px 8px rgba(230, 184, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(230, 184, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(230, 184, 0, 0.25);
}

/* Subtle Animations */
@keyframes subtle-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gentle-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }

p {
  margin-bottom: var(--space-md);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-base);
  font-weight: 500;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px; /* Touch target */
  gap: var(--space-sm);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease-out, height 0.6s ease-out;
  pointer-events: none;
}

.btn:hover::before {
  width: 300%;
  height: 300%;
}

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

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

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

.theme-light .btn-primary {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.theme-light .btn-primary:hover:not(:disabled) {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #FFFFFF;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-text-muted);
  color: var(--color-bg-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--color-primary);
}

.btn-large {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-lg);
}

/* Header */
.header-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 217, 61, 0.2);
  z-index: 1000;
}

.theme-light .header-sticky {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(230, 184, 0, 0.3);
}

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

.logo h1 {
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  margin: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: var(--space-sm) 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Theme Toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border: 2px solid var(--color-text-muted);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
}

.theme-toggle-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transition: var(--transition);
}

/* Dark theme - white circle */
.theme-dark .theme-toggle-icon {
  background: #FFFFFF;
}

/* Light theme - black circle */
.theme-light .theme-toggle-icon {
  background: #000000;
}

/* Mobile Menu */
.mobile-menu-button {
  display: none;
  flex-direction: column;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  gap: 4px;
  position: relative;
  z-index: 1001; /* Higher than nav menu */
  -webkit-tap-highlight-color: transparent; /* Remove iOS tap highlight */
  -webkit-touch-callout: none; /* Disable iOS callout */
}

.mobile-menu-button span {
  width: 100%;
  height: 2px;
  background: var(--color-text);
  transition: var(--transition);
  transform-origin: center;
}

/* Hamburger animation when menu is open */
.mobile-menu-button[aria-expanded="true"] span:first-child {
  transform: rotate(45deg) translateY(6px);
}

.mobile-menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-button[aria-expanded="true"] span:last-child {
  transform: rotate(-45deg) translateY(-6px);
}

/* Hero Section */
.hero {
  padding: calc(80px + var(--space-3xl)) 0 var(--space-3xl) 0;
  text-align: center;
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
}

.hero-title {
  font-size: var(--font-size-5xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--color-text);
  transition: var(--transition);
  animation: subtle-fade-in 1.5s ease-out;
}

/* Two-color accent for main heading */
.hero-title .accent {
  color: var(--color-primary);
  transition: var(--transition);
}

.hero-title:hover .accent {
  text-shadow: 0 0 8px var(--color-primary);
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: var(--space-3xl);
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: var(--space-2xl);
  justify-content: center;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.stat-number {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--color-primary);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* How It Works */
.how-it-works {
  padding: var(--space-3xl) 0;
  background: var(--color-bg-darker);
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-2xl);
  color: var(--color-primary);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.step {
  text-align: center;
  padding: var(--space-xl);
  border: 1px solid rgba(255, 217, 61, 0.2);
  border-radius: var(--border-radius);
  background: transparent;
  transition: var(--transition);
  animation: subtle-fade-in 1s ease-out;
}

.step:nth-child(2) {
  animation-delay: 0.2s;
}

.step:nth-child(3) {
  animation-delay: 0.4s;
}

.step:hover {
  border-color: rgba(255, 217, 61, 0.4);
  background: rgba(255, 217, 61, 0.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.step-number {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.step h3 {
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

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

/* Calculator Section */
.calculator-section {
  padding: var(--space-3xl) 0;
}

.calculator-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.calculator-header h2 {
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.calculator-header p {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

/* Sections */
.section {
  display: none;
}

.section.active {
  display: block;
}

/* Welcome */
.welcome-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.welcome-info {
  display: grid;
  gap: var(--space-md);
  margin: var(--space-2xl) 0;
}

.info-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: transparent;
  border-radius: var(--border-radius);
}

.info-icon {
  font-size: var(--font-size-sm);
  color: var(--color-primary);
  width: 16px;
  text-align: center;
}

/* Progress Bar */
.progress-container {
  margin-bottom: var(--space-xl);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 217, 61, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 0.5s ease;
}

/* Question Card */
.question-card {
  background: var(--color-bg-darker);
  border: 1px solid rgba(255, 217, 61, 0.2);
  border-radius: var(--border-radius);
  padding: var(--space-2xl);
  max-width: 800px;
  margin: 0 auto;
}

.question-category {
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
}

.question-text {
  color: var(--color-text);
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-xl);
}

.answers-grid {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.answer-btn {
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  color: var(--color-text);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.answer-key {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.answer-btn:hover {
  border-color: rgba(255, 217, 61, 0.5);
  background: rgba(255, 217, 61, 0.1);
}

.answer-btn:hover .answer-key {
  background: rgba(255, 217, 61, 0.3);
  color: var(--color-text);
}

.answer-btn.selected {
  border-color: var(--color-primary);
  background: rgba(255, 217, 61, 0.2);
  color: var(--color-text);
}

.answer-btn.selected .answer-key {
  background: var(--color-primary);
  color: var(--color-bg-dark);
}

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

/* Keyboard help */
.keyboard-help {
  text-align: center;
  margin: var(--space-md) 0;
  padding: var(--space-sm);
  background: rgba(255, 217, 61, 0.05);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 217, 61, 0.1);
}

kbd {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-primary);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  border: 1px solid rgba(255, 217, 61, 0.2);
}

/* Importance Section */
.importance-section {
  margin-bottom: var(--space-xl);
  padding: var(--space-md) 0;
  border-top: 1px solid rgba(255, 217, 61, 0.2);
}

.importance-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.importance-checkbox input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-text-muted);
  border-radius: 3px;
  position: relative;
  transition: var(--transition);
}

.importance-checkbox input[type="checkbox"]:checked + .checkbox-custom {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.importance-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-bg-dark);
  font-weight: 700;
  font-size: 12px;
}

.checkbox-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* Question Actions */
.question-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Results */
.results-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
  margin-top: var(--space-3xl); /* Add spacing from button */
  padding-top: var(--space-xl);
}

.results-list {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: var(--space-md);
}

.result-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-bg-darker);
  border: 1px solid rgba(255, 217, 61, 0.2);
  border-radius: var(--border-radius);
  transition: var(--transition);
  animation: slideInUp 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
  position: relative;
}

.result-item:hover {
  border-color: rgba(255, 217, 61, 0.4);
}

.result-rank {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-text-muted);
  color: var(--color-bg-dark);
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
}

.result-rank.top-three {
  background: var(--color-primary);
}

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

.result-party {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.result-match-container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.result-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 217, 61, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 1s ease;
}

.result-percentage {
  font-weight: 700;
  color: var(--color-primary);
  min-width: 50px;
  text-align: right;
}

/* Video Section */
.video-section {
  padding: var(--space-3xl) 0;
  background: var(--color-bg-darker);
}

.video-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.video-content h2 {
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.video-embed {
  margin: var(--space-2xl) 0;
  aspect-ratio: 16/9;
  background: var(--color-bg-dark);
  border: 2px solid rgba(255, 217, 61, 0.2);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-placeholder {
  text-align: center;
}

.play-button {
  margin-bottom: var(--space-md);
  cursor: pointer;
  transition: var(--transition);
}

.play-button:hover {
  transform: scale(1.1);
}

.video-description {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Methodology */
.methodology {
  padding: var(--space-3xl) 0;
}

.methodology-content {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: var(--space-2xl);
}

.method-description ul {
  list-style: none;
  padding: 0;
}

.method-description li {
  padding: var(--space-sm) 0;
  border-left: 3px solid var(--color-primary);
  padding-left: var(--space-md);
  margin-bottom: var(--space-sm);
}

.methodology-references {
  background: rgba(255, 217, 61, 0.1);
  padding: var(--space-lg);
  border-radius: var(--border-radius);
}

.methodology-references ul {
  list-style: none;
  padding: 0;
}

.methodology-references li {
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

/* FAQ */
.faq {
  padding: var(--space-3xl) 0;
  background: var(--color-bg-darker);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: var(--space-md);
}

.faq-item {
  background: var(--color-bg-dark);
  border: 1px solid rgba(255, 217, 61, 0.2);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.faq-item summary {
  padding: var(--space-lg);
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  transition: var(--transition);
}

.faq-item summary:hover {
  background: rgba(255, 217, 61, 0.1);
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--color-primary);
  font-size: var(--font-size-xl);
  transition: var(--transition);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: var(--space-lg);
  color: var(--color-text-muted);
  border-top: 1px solid rgba(255, 217, 61, 0.2);
  line-height: 1.6;
}

.faq-answer p {
  margin-bottom: 0;
}

/* Compact Support Section */
.support-links-compact {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 217, 61, 0.05);
    border-radius: 8px;
    text-align: center;
    position: relative;
}

.support-text {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.support-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.support-icon {
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0.7;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.support-icon:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.2);
}

/* Social icons with SVG */
.social-icon {
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Crypto icons */
.crypto-icon {
    cursor: pointer;
    user-select: none;
}

.crypto-icon:hover {
    color: var(--color-primary);
}

.crypto-icon:active {
    transform: scale(0.9);
}

.separator {
    color: var(--text-secondary);
    opacity: 0.3;
    font-size: 1.2rem;
}

/* Copy feedback */
.copy-feedback {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

@media (max-width: 768px) {
    .support-links-compact {
        padding: 1rem;
    }
    
    .support-icons {
        gap: 0.8rem;
    }
    
    .support-icon {
        font-size: 1.3rem;
    }
    
    .social-icon {
        width: 20px;
        height: 20px;
    }
    
    .social-icon svg {
        width: 16px;
        height: 16px;
    }
}

/* Footer */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid rgba(255, 217, 61, 0.2);
}

.footer-content {
  text-align: center;
}

.footer-main h4 {
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.footer-disclaimer {
  margin-top: var(--space-lg);
  color: var(--color-text-dark);
  font-size: var(--font-size-sm);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Loading & Animations */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 217, 61, 0.3);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-lg);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Notifications */
.notification {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  background: var(--color-bg-dark);
  color: var(--color-text);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateX(400px);
  transition: var(--transition);
}

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

.notification.error {
  border-color: var(--color-error);
  color: var(--color-error);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-dark);
    border-top: 1px solid var(--color-border);
    flex-direction: column;
    padding: var(--space-md);
    z-index: 999;
  }
  
  .nav.mobile-menu-open {
    display: flex;
    display: -webkit-flex; /* Safari compatibility */
    visibility: visible; /* Ensure visibility */
  }
  
  .mobile-menu-button {
    display: flex;
  }
  
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--font-size-lg);
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hero-stats {
    gap: var(--space-lg);
  }
  
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
  
  /* Mobile optimizations for calculator */
  .calculator-section {
    padding: var(--space-md) 0;
  }
  
  .question-card {
    padding: var(--space-md);
  }
  
  .question-category {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-xs);
  }
  
  .question-text {
    font-size: var(--font-size-lg);
    line-height: 1.3;
    margin-bottom: var(--space-lg);
  }
  
  /* Keep vertical layout but reduce spacing */
  .answers-grid {
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
  }
  
  .answer-btn {
    padding: var(--space-sm) var(--space-md);
    min-height: 44px;
    font-size: var(--font-size-sm);
  }
  
  /* Compact importance section */
  .importance-section {
    margin-bottom: var(--space-md);
    padding: var(--space-sm) 0;
  }
  
  .checkbox-label {
    font-size: var(--font-size-sm);
  }
  
  /* Keep horizontal action buttons */
  .question-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-sm);
  }
  
  .question-actions .btn {
    padding: var(--space-sm);
    font-size: var(--font-size-sm);
    min-height: 40px;
  }
  
  /* Compact progress bar */
  .progress-container {
    margin-bottom: var(--space-md);
  }
  
  .progress-info {
    font-size: var(--font-size-sm);
  }
  
  .result-item {
    flex-direction: column;
    text-align: center;
  }
  
  .result-match-container {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }
  
  .hero {
    padding: calc(60px + var(--space-xl)) 0 var(--space-xl) 0;
  }
  
  .section-title {
    font-size: var(--font-size-2xl);
  }
  
  .steps-grid {
    grid-template-columns: 1fr;
  }
  
  /* Even more compact for small phones */
  .question-card {
    padding: var(--space-sm);
  }
  
  .question-text {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-md);
  }
  
  /* Keep vertical layout with tighter spacing */
  .answers-grid {
    gap: 6px;
    margin-bottom: var(--space-sm);
  }
  
  /* Ensure compasses are stacked and properly sized on small screens */
  .compass-dual-container {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    padding: 0;
  }
  
  .compass-wrapper {
    width: 100%;
    max-width: 100%;
  }
  
  /* Make result cards more compact on small screens */
  .result-item {
    padding: 0.75rem;
  }
  
  .result-rank {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }
  
  .result-party {
    font-size: 0.9rem;
  }
  
  .answer-btn {
    padding: var(--space-sm) var(--space-sm);
    min-height: 40px;
    font-size: var(--font-size-sm);
  }
  
  /* Ultra compact for very small screens */
  .importance-section {
    margin-bottom: var(--space-sm);
    padding: 4px 0;
  }
  
  .question-actions {
    gap: 4px;
  }
  
  .question-actions .btn {
    padding: 6px;
    font-size: 12px;
    min-height: 36px;
  }
  
  .notification {
    top: var(--space-sm);
    right: var(--space-sm);
    left: var(--space-sm);
    transform: translateY(-100px);
  }
  
  .notification.show {
    transform: translateY(0);
  }
}

/* Special optimization for mobile in portrait mode */
@media (max-width: 768px) and (orientation: portrait) {
  /* Reduce vertical spacing to fit everything on screen */
  .calculator-section {
    padding: 8px 0;
  }
  
  .question-card {
    padding: 8px;
  }
  
  .progress-container {
    margin-bottom: 8px;
  }
  
  .progress-info {
    font-size: 12px;
  }
  
  .progress-bar {
    height: 3px;
  }
  
  .question-category {
    font-size: 11px;
    margin-bottom: 2px;
  }
  
  .question-text {
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 16px;
    padding-bottom: 8px;
  }
  
  /* Keep vertical layout with minimal spacing */
  .answers-grid {
    gap: 4px;
    margin-bottom: 8px;
  }
  
  .answer-btn {
    padding: 8px 10px;
    min-height: 36px;
    font-size: 13px;
  }
  
  .importance-section {
    margin-bottom: 8px;
    padding: 4px 0;
  }
  
  .checkbox-custom {
    width: 16px;
    height: 16px;
  }
  
  .checkbox-label {
    font-size: 11px;
  }
  
  .question-actions {
    gap: 3px;
  }
  
  .question-actions .btn {
    padding: 5px;
    font-size: 12px;
    min-height: 34px;
  }
}

/* Compass Section Styles */
.compass-section {
  padding: 8rem 0 4rem 0;
  background: var(--color-bg-dark);
  min-height: 100vh;
}

.compass-header {
  text-align: center;
  margin-bottom: 3rem;
}

.compass-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.compass-header p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.compass-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  max-width: none;
  width: 100%;
}

.compass-dual-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  width: 100%;
  margin: 0;
  max-width: none;
}

.compass-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.compass-title {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.compass-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 1;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: visible;
}

.compass {
  position: absolute;
  top: 40px;
  left: 40px;
  right: 40px;
  bottom: 40px;
}

.axis {
  position: absolute;
  background: rgba(255, 217, 61, 0.15);
}

.axis.horizontal {
  top: 50%;
  left: 5%;
  right: 5%;
  height: 1px;
}

.axis.vertical {
  left: 50%;
  top: 5%;
  bottom: 5%;
  width: 1px;
}

.axis-label {
  position: absolute;
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  text-shadow: 0 0 8px rgba(0,0,0,0.8), 0 0 16px rgba(0,0,0,0.6);
  z-index: 99999 !important;
  pointer-events: none;
}

.axis-label-top { 
  top: -25px; 
  left: 50%; 
  transform: translateX(-50%); 
}

.axis-label-bottom { 
  bottom: -25px; 
  left: 50%; 
  transform: translateX(-50%); 
}

.axis-label-left { 
  left: -30px; 
  top: 50%; 
  transform: translateY(-50%); 
}

.axis-label-right { 
  right: -30px; 
  top: 50%; 
  transform: translateY(-50%); 
}

.party {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

/* Coalition parties MUST be smaller - apply immediately after base party style */
.party.coalition-party,
.compass .party.coalition-party,
div.party.coalition-party {
  width: 10px !important;
  height: 10px !important;
  border-width: 1px !important;
  opacity: 0.9 !important;
}

.party:hover,
.party.highlight {
  transform: scale(1.5);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 10px rgba(255, 217, 61, 0.5);
  z-index: 20;
}

/* Persistent highlights have stronger styling and don't disappear on mouse leave */
.party.persistent-highlight {
  transform: scale(1.4);
  border: 2px solid rgba(255, 217, 61, 0.9);
  box-shadow: 0 0 15px rgba(255, 217, 61, 0.7), inset 0 0 5px rgba(255, 217, 61, 0.3);
  z-index: 25;
  cursor: pointer;
}

.party-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  min-width: 80px;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-bottom: 5px;
  line-height: 1.2;
}

/* For longer party names, allow 2 lines max */
.party-tooltip.long-name {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.party:hover .party-tooltip,
.party.highlight .party-tooltip {
  opacity: 1;
}

.quadrant-match {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
}

.legend-section {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--color-bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.legend-title {
  font-size: 1.6rem;
  margin-bottom: 2rem;
  text-align: center;
  font-weight: 600;
  color: var(--color-primary);
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem 1.5rem;
  align-items: start;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.4rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border-radius: 4px;
  min-height: 40px;
}

.legend-item:hover {
  outline: 1px solid rgba(255, 217, 61, 0.3);
  outline-offset: -1px;
}

.legend-item.highlight {
  outline: 1px solid rgba(255, 217, 61, 0.5);
  outline-offset: -1px;
}

.legend-item.persistent-highlight {
  background: rgba(255, 217, 61, 0.15);
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  cursor: pointer;
}

/* Toggle Buttons */
.compass-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.toggle-btn {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.toggle-btn.active {
    background: var(--gradient-gold);
    border-color: transparent;
    color: #000;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.toggle-btn span {
    font-size: 1.2rem;
}

/* Coalition party styles */
.legend-item.coalition-party {
  opacity: 0.7;
}

.legend-item.coalition-party .legend-color {
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Coalition parties expandable section */
.coalition-section {
  grid-column: 1 / -1;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.coalition-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  user-select: none;
}

.coalition-toggle:hover {
  color: var(--color-primary);
}

.coalition-toggle .arrow {
  transition: transform 0.3s ease;
  font-size: 0.8em;
}

.coalition-toggle.expanded .arrow {
  transform: rotate(180deg);
}

.coalition-parties {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.3s ease, margin-top 0.3s ease;
  opacity: 0;
  margin-top: 0;
}

.coalition-parties.expanded {
  max-height: 500px;
  opacity: 1;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .legend-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .coalition-parties {
    grid-template-columns: repeat(2, 1fr);
  }
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.legend-name {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 500;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.2;
}

/* Light theme overrides for compass */
.theme-light .compass-section {
  background: var(--color-bg-dark);
}

.theme-light .compass-grid,
.theme-light .compass-wrapper,
.theme-light .legend-section {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

.theme-light .axis-label {
  background: var(--color-bg-secondary);
}

/* Agreement Details Styles - Simple & Clean */
.agreement-details-btn {
  transition: var(--transition) !important;
  font-family: var(--font-family);
}

.agreement-details-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 217, 61, 0.3);
}

.agreement-details {
  font-family: var(--font-family);
  line-height: 1.3;
}

/* Scrollbar styling for agreement list */
.agreement-details div:has(> div[style*="max-height"]) {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 217, 61, 0.3) transparent;
}

.agreement-details div::-webkit-scrollbar {
  width: 4px;
}

.agreement-details div::-webkit-scrollbar-track {
  background: transparent;
}

.agreement-details div::-webkit-scrollbar-thumb {
  background: rgba(255, 217, 61, 0.3);
  border-radius: 2px;
}

.agreement-details div::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 217, 61, 0.5);
}

/* Hover effect on question items */
.agreement-details div[style*="border-bottom"]:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  transition: background-color 0.2s ease;
}

/* Mobile responsiveness for agreement details */
@media (max-width: 768px) {
  .agreement-details {
    font-size: 0.8em;
  }
  
  .agreement-details div[style*="max-height"] {
    max-height: 250px !important;
  }
}

/* Party tooltip styles for compass */
.party .party-tooltip {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  padding: 0.25rem 0.4rem;
  border-radius: 3px;
  font-size: 0.6rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 99998;
  font-weight: 400;
  text-align: center;
}

/* Show tooltip on parent hover */
.party:hover .party-tooltip {
  opacity: 1;
}

/* All tooltips use consistent styling - removed long-name specific rules */

/* Party dots base styling */
/* Removed duplicate .party definition - using the one at line 1507 */

/* Coalition parties are smaller - high specificity */
.compass .party.coalition-party,
.party.coalition-party,
div.party.coalition-party {
  width: 10px !important;
  height: 10px !important;
  border: 1px solid rgba(255,255,255,0.6) !important;
  opacity: 0.9 !important;
  z-index: 9 !important;
}

/* Coalition parties hover - smaller scale */
.party.coalition-party:hover {
  transform: scale(1.8) !important;
}

/* Coalition parties highlight - smaller scale */
.party.coalition-party.highlight {
  transform: scale(1.6) !important;
}

/* Coalition parties persistent highlight - smaller scale */
.party.coalition-party.persistent-highlight {
  transform: scale(1.5) !important;
}

.party:hover {
  transform: scale(1.2);
  z-index: 101;
  box-shadow: 0 0 12px rgba(255, 217, 61, 0.6);
}

/* User position marker */
.party.user-position {
  background: #ff4757;
  border: 3px solid var(--color-bg);
  font-size: 0.7rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 50;
}

/* Responsive */
@media (max-width: 768px) {
  .compass-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Stack compass containers vertically on mobile */
  .compass-dual-container {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    padding: 0;
  }
  
  /* Make compasses larger on mobile when stacked */
  .compass-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .compass-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    aspect-ratio: 1;
    overflow: hidden; /* Prevent dots from escaping */
  }
  
  .compass {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    width: auto;
    padding-bottom: 0;
  }
  
  /* Adjust axes to be properly centered */
  .axis.horizontal {
    left: 0;
    right: 0;
  }
  
  .axis.vertical {
    top: 0;
    bottom: 0;
  }
  
  /* Hide axis label text on mobile, keep only icons */
  .axis-label span:not(.axis-icon) {
    display: none;
  }
  
  .axis-label {
    font-size: 1.2rem;
  }
  
  .axis-label .axis-icon {
    display: inline-block;
    font-size: 1.2rem;
  }
  
  /* Adjust label positions for mobile */
  .axis-label-top,
  .axis-label-bottom {
    top: auto;
    bottom: auto;
  }
  
  .axis-label-top {
    top: 5px;
  }
  
  .axis-label-bottom {
    bottom: 5px;
  }
  
  .axis-label-left {
    left: 5px;
    right: auto;
  }
  
  .axis-label-right {
    right: 5px;
    left: auto;
  }
  
  .legend-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Adjust tooltip size for mobile */
  .party-tooltip {
    font-size: 0.7rem;
    max-width: 150px;
  }
  
  .party-tooltip.long-name {
    max-width: 120px;
  }
  
  /* Fix results list alignment and progress bars */
  .results-list {
    max-width: 100%;
    padding: 0;
  }
  
  .result-item {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .result-rank {
    position: relative;
    top: auto;
    right: auto;
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
  
  .result-content {
    flex: 1;
    width: calc(100% - 50px);
  }
  
  .result-party {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    padding-right: 0;
  }
  
  .result-match-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
  }
  
  .result-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 217, 61, 0.1);
    border-radius: 4px;
    overflow: hidden;
  }
  
  .result-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  }
  
  .result-percentage {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
    order: -1; /* Move percentage before progress bar */
  }
}