:root {
  /* Color palette - bioluminescent biology theme */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.05);

  --accent-cyan: #22d3ee;
  --accent-magenta: #e879f9;
  --accent-green: #4ade80;
  --accent-blue: #60a5fa;
  --accent-orange: #fb923c;

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 30px rgba(34, 211, 238, 0.3);

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Animated background */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(34, 211, 238, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(232, 121, 249, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(74, 222, 128, 0.08) 0%, transparent 60%);
  z-index: -1;
  animation: gradientShift 15s ease infinite alternate;
}

@keyframes gradientShift {
  0% {
    opacity: 0.8;
  }

  100% {
    opacity: 1;
  }
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 2rem;
}

header h1 {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 300;
}

/* Cell Type Selector */
.cell-selector {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.cell-btn {
  padding: 1.5rem 3rem;
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.cell-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.cell-btn:hover::before {
  opacity: 1;
}

.cell-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.cell-btn.animal:hover,
.cell-btn.animal.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.4);
}

.cell-btn.plant:hover,
.cell-btn.plant.active {
  border-color: var(--accent-green);
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.4);
}

.cell-btn.active {
  transform: translateY(-4px);
}

.cell-btn .icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Cell Diagram Container */
.diagram-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  padding: 2rem;
  min-height: 600px;
}

.cell-diagram {
  display: none;
  position: relative;
  width: 100%;
  height: 550px;
}

.cell-diagram.active {
  display: block;
  animation: fadeIn var(--transition-slow);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Cell Diagram Images */
.cell-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}

/* SVG Diagram Styles */
.cell-diagram svg {
  width: 100%;
  height: 100%;
}

/* Organelle Hotspots */
.organelle-label {
  position: absolute;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent-cyan);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  z-index: 10;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.organelle-label:hover {
  background: rgba(34, 211, 238, 0.3);
  border-color: var(--accent-cyan);
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
}

/* Leader Lines SVG Overlay */
.leader-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.leader-lines line {
  stroke: var(--accent-cyan);
  stroke-width: 1.5;
  opacity: 0.7;
}

.leader-lines circle {
  fill: var(--accent-cyan);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn var(--transition-base);
}

/* Modal Content */
.modal {
  background: var(--bg-secondary);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  max-width: 650px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(232, 121, 249, 0.1));
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-glass);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.modal-body h3 {
  color: var(--accent-cyan);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-body p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.modal-body ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.modal-body li {
  color: var(--text-secondary);
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.modal-body li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-magenta);
  font-weight: bold;
}

/* Organelle Infographic */
.infographic-container {
  margin-bottom: 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.05), rgba(232, 121, 249, 0.05));
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.infographic-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-base);
}

.infographic-container:hover .infographic-image {
  transform: scale(1.02);
}

.infographic-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
}

.key-fact {
  background: rgba(34, 211, 238, 0.1);
  border-left: 3px solid var(--accent-cyan);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin-top: 1rem;
}

.key-fact p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Back button */
.back-btn {
  display: none;
  margin: 0 auto 2rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.back-btn.visible {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  .cell-selector {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .cell-btn {
    width: 100%;
    max-width: 300px;
  }

  .diagram-container {
    padding: 1rem;
  }

  .organelle-label {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }

  .modal {
    max-height: 90vh;
    border-radius: 16px;
  }

  .modal-body {
    padding: 1.5rem;
  }
}

/* Selection state hint */
.select-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4rem 2rem;
}

.select-hint .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}