/* Entropy vs Randomness - Styling */

/* Container */
.entropy-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
}

/* Typography */
.entropy-container h1 {
  color: #1e40af;
  font-size: 2.5em;
  margin-bottom: 0.5em;
  border-bottom: 3px solid #1e40af;
  padding-bottom: 0.3em;
}

.entropy-container h2 {
  color: #1e40af;
  font-size: 1.8em;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.3em;
}

.entropy-container h3 {
  color: #1e5a96;
  font-size: 1.3em;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
}

.entropy-container h4 {
  color: #1e5a96;
  font-size: 1.1em;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.entropy-container p {
  margin: 1em 0;
}

.entropy-container ul {
  margin: 1em 0;
  padding-left: 2em;
}

.entropy-container li {
  margin: 0.5em 0;
}

.entropy-container code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.entropy-container strong {
  font-weight: 600;
  color: #1e40af;
}

.entropy-container em {
  font-style: italic;
  color: #666;
}

/* Callout boxes */
.concept-box {
  background: #f0f9ff;
  border-left: 4px solid #1e40af;
  padding: 15px 20px;
  margin: 1.5em 0;
  border-radius: 4px;
}

.concept-box strong {
  display: block;
  margin-bottom: 0.5em;
  font-size: 1.1em;
}

.real-world-box {
  background: #fef3c7;
  border-left: 4px solid #d97706;
  padding: 15px 20px;
  margin: 1.5em 0;
  border-radius: 4px;
}

.real-world-box strong {
  display: block;
  margin-bottom: 0.5em;
  font-size: 1.1em;
  color: #d97706;
}

.insight-box {
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  padding: 15px 20px;
  margin: 1.5em 0;
  border-radius: 4px;
}

.insight-box strong {
  display: block;
  margin-bottom: 0.5em;
  font-size: 1.1em;
  color: #16a34a;
}

/* Demo sections */
.demo-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 25px;
  margin: 2em 0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.demo-section h4 {
  margin-top: 0;
  color: #1e40af;
  font-size: 1.2em;
}

/* Intro sequence figures */
.intro-sequence-figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 1.2em 0;
}

.intro-sequence-card {
  margin: 0;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.intro-sequence-card figcaption {
  margin-bottom: 10px;
  color: #1e40af;
}

.intro-sequence-canvas {
  width: 100%;
  display: block;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
}

/* Entropy calculator */
.entropy-calculator {
  background: white;
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: 6px;
  margin-top: 15px;
}

.calculator-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-weight: 600;
  color: #555;
  font-size: 0.95em;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  background: #e5e7eb;
  color: #333;
  border: 1px solid #d1d5db;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: #d1d5db;
  border-color: #9ca3af;
}

.preset-btn.active {
  background: #1e40af;
  color: white;
  border-color: #1e40af;
}

.distribution-input {
  margin-bottom: 15px;
}

.distribution-input input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-family: 'Monaco', monospace;
  font-size: 0.95em;
}

.distribution-input input[type="text"]:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.calculate-btn {
  background: #1e40af;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1em;
  transition: background 0.2s;
}

.calculate-btn:hover {
  background: #1e3a8a;
}

.calculate-btn:active {
  transform: translateY(1px);
}

.entropy-result {
  background: #f0f9ff;
  padding: 15px;
  border-radius: 4px;
  border-left: 4px solid #1e40af;
  font-family: 'Monaco', monospace;
  font-size: 1.3em;
  text-align: center;
  margin: 20px 0;
  font-weight: 600;
  color: #1e40af;
}

.error-message {
  background: #fee2e2;
  border-left: 4px solid #dc2626;
  color: #dc2626;
  padding: 12px;
  border-radius: 4px;
  margin: 15px 0;
}

.canvas-wrapper {
  margin: 20px 0;
  background: white;
  padding: 15px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

.distribution-canvas {
  width: 100%;
  height: 250px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

/* Breakdown table */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-table th {
  background: #1e40af;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.95em;
}

.breakdown-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  font-family: 'Monaco', monospace;
  font-size: 0.9em;
}

.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table tr:nth-child(even) {
  background: #f9fafb;
}

/* Sequence visualizer */
.sequence-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 1.5em 0;
}

.sequence-panel {
  background: white;
  border: 1px solid #d1d5db;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  min-width: 0;
}

.sequence-panel h5 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #1e40af;
  font-size: 1em;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 8px;
}

.sequence-canvas {
  width: 100%;
  max-width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  margin: 10px 0;
  background: white;
  display: block;
  height: auto;
}

.sequence-stats {
  font-family: 'Monaco', monospace;
  font-size: 0.85em;
  line-height: 1.8;
  background: #f9fafb;
  padding: 12px;
  border-radius: 4px;
  margin-top: 10px;
}

.sequence-stats strong {
  color: #555;
  font-weight: 600;
}

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  overflow: hidden;
}

.comparison-table th {
  background: #1e40af;
  color: white;
  padding: 14px;
  text-align: left;
  font-weight: 600;
}

.comparison-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:nth-child(even) {
  background: #f9fafb;
}

/* Algorithm box (for formulas) */
.algorithm {
  background: #f5f5f5;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 20px;
  margin: 1.5em 0;
  font-family: 'Monaco', monospace;
}

.algorithm-title {
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 10px;
  font-size: 1.1em;
}

/* References section */
.references {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 2px solid #e5e7eb;
}

.references h3 {
  color: #1e40af;
  margin-bottom: 1em;
}

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

.references li {
  margin: 0.8em 0;
  padding-left: 1.5em;
  position: relative;
}

.references li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: #1e40af;
  font-weight: bold;
}

.references a {
  color: #1e40af;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.2s;
}

.references a:hover {
  border-bottom: 1px solid #1e40af;
}

/* Responsive design */
@media (max-width: 768px) {
  .entropy-container {
    padding: 15px;
  }

  .entropy-container h1 {
    font-size: 2em;
  }

  .entropy-container h2 {
    font-size: 1.5em;
  }

  .sequence-grid {
    grid-template-columns: 1fr;
  }

  .intro-sequence-figures {
    grid-template-columns: 1fr;
  }

  .preset-buttons {
    flex-direction: column;
  }

  .preset-btn {
    width: 100%;
  }

  .calculator-controls {
    gap: 12px;
  }

  .breakdown-table {
    font-size: 0.85em;
  }

  .breakdown-table th,
  .breakdown-table td {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .entropy-container h1 {
    font-size: 1.7em;
  }

  .entropy-container h2 {
    font-size: 1.3em;
  }

  .demo-section {
    padding: 15px;
  }

  .entropy-result {
    font-size: 1.1em;
  }

  .sequence-stats {
    font-size: 0.8em;
  }
}
