/* Poincaré Section Visualization */
:root {
  --pc-primary: #3b82f6;
  --pc-secondary: #8b5cf6;
  --pc-accent: #10b981;
  --pc-danger: #ef4444;
  --pc-warning: #f59e0b;
  --pc-bg: #0f172a;
  --pc-surface: #1e293b;
  --pc-surface-hover: #334155;
  --pc-border: #334155;
  --pc-text: #f1f5f9;
  --pc-text-muted: #94a3b8;
  --pc-shadow: rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--pc-bg);
  color: var(--pc-text);
  line-height: 1.6;
}

.pc-container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
.pc-header {
  text-align: center;
  padding: 2rem 1rem;
  border-bottom: 1px solid var(--pc-border);
  margin-bottom: 2rem;
}

.pc-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pc-primary), var(--pc-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.pc-subtitle {
  font-size: 1.1rem;
  color: var(--pc-text-muted);
}

/* Main Layout */
.pc-main {
  display: grid;
  grid-template-columns: 320px 1fr 280px;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Panels */
.pc-controls-panel,
.pc-analysis-panel {
  background: var(--pc-surface);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--pc-border);
  height: fit-content;
  position: sticky;
  top: 1rem;
}

.pc-control-section,
.pc-analysis-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--pc-border);
}

.pc-control-section:last-child,
.pc-analysis-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.pc-control-section h2,
.pc-analysis-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--pc-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Controls */
.pc-select {
  width: 100%;
  padding: 0.75rem;
  background: var(--pc-bg);
  border: 1px solid var(--pc-border);
  border-radius: 8px;
  color: var(--pc-text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.pc-select:hover {
  border-color: var(--pc-primary);
}

.pc-select:focus {
  outline: none;
  border-color: var(--pc-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pc-parameters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pc-param-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pc-param-row label {
  font-size: 0.85rem;
  color: var(--pc-text-muted);
  flex: 1;
}

.pc-slider {
  flex: 2;
  height: 6px;
  background: var(--pc-bg);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

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

.pc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

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

.pc-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.pc-button-group {
  display: flex;
  gap: 0.75rem;
}

.pc-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.pc-btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.pc-btn-secondary {
  background: var(--pc-surface-hover);
  color: var(--pc-text);
}

.pc-btn-secondary:hover {
  background: #475569;
}

/* Visualization */
.pc-viz-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pc-canvas-wrapper {
  position: relative;
  background: var(--pc-surface);
  border-radius: 12px;
  border: 1px solid var(--pc-border);
  overflow: hidden;
}

.pc-canvas {
  display: block;
  width: 100%;
  height: 600px;
  cursor: crosshair;
}

.pc-legend {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--pc-border);
  font-size: 0.85rem;
}

.pc-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

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

.pc-legend-line {
  width: 24px;
  height: 3px;
  background: linear-gradient(90deg, var(--pc-primary), var(--pc-secondary));
  border-radius: 2px;
}

.pc-legend-dot {
  width: 10px;
  height: 10px;
  background: var(--pc-accent);
  border-radius: 50%;
}

.pc-legend-section {
  width: 24px;
  height: 3px;
  background: var(--pc-danger);
  border-radius: 2px;
}

.pc-info-bar {
  background: var(--pc-surface);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--pc-border);
  font-size: 0.85rem;
  text-align: center;
  color: var(--pc-text-muted);
}

.pc-info-bar span {
  margin: 0 0.5rem;
}

.pc-info-bar span:last-child {
  color: var(--pc-accent);
  font-weight: 600;
}

/* Analysis Panel */
.pc-dynamics-info,
.pc-structure-info {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--pc-text-muted);
}

.pc-dynamics-info p,
.pc-structure-info p {
  margin-bottom: 0.75rem;
}

.pc-dynamics-info strong,
.pc-structure-info strong {
  color: var(--pc-text);
}

.pc-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pc-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.5rem;
  background: var(--pc-bg);
  border-radius: 6px;
}

.pc-stat-row span:first-child {
  color: var(--pc-text-muted);
}

.pc-stat-row span:last-child {
  color: var(--pc-accent);
  font-weight: 600;
}

/* Educational Content */
.pc-education {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

.pc-edu-section {
  background: var(--pc-surface);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--pc-border);
}

.pc-edu-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--pc-primary);
}

.pc-edu-section p {
  color: var(--pc-text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* Steps */
.pc-edu-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.pc-step {
  background: var(--pc-bg);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--pc-border);
  position: relative;
}

.pc-step-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--pc-primary), var(--pc-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.pc-step h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--pc-accent);
}

.pc-step p {
  font-size: 0.9rem;
  color: var(--pc-text-muted);
  margin-bottom: 0;
  line-height: 1.6;
}

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

.pc-edu-card {
  background: var(--pc-bg);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--pc-border);
}

.pc-edu-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--pc-accent);
}

.pc-edu-card p {
  font-size: 0.9rem;
  color: var(--pc-text-muted);
  margin-bottom: 0;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 1200px) {
  .pc-main {
    grid-template-columns: 1fr;
  }

  .pc-controls-panel,
  .pc-analysis-panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .pc-title {
    font-size: 1.8rem;
  }

  .pc-subtitle {
    font-size: 0.95rem;
  }

  .pc-canvas {
    height: 400px;
  }

  .pc-edu-steps,
  .pc-edu-grid {
    grid-template-columns: 1fr;
  }

  .pc-button-group {
    flex-direction: column;
  }

  .pc-legend {
    position: static;
    margin-top: 1rem;
  }
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pc-running {
  animation: pulse 2s ease-in-out infinite;
}
