/* Print PPI Bottleneck Calculator - CSS Design System */

:root {
  --font-primary: 'Outfit', system-ui, -apple-system, sans-serif;
  
  /* Color Palette (HSL Tailored) */
  --bg-main: #0a0a0f;
  --bg-card: rgba(20, 20, 28, 0.6);
  --border-color: rgba(255, 255, 255, 0.05);
  
  --text-primary: #f4f4f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  /* Accent Colors */
  --color-biology: #3b82f6;     /* Electric Blue */
  --color-substrate: #10b981;   /* Emerald Green */
  --color-hardware: #8b5cf6;    /* Neon Violet */
  --color-warning: #f59e0b;     /* Amber Gold */
  
  /* Glassmorphism Shadows */
  --card-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
  --glow-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

html {
  overflow-x: hidden;
}

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

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

/* Background Glowing Orbs */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 45%),
    linear-gradient(135deg, #07070b 0%, #0d0d14 100%);
}

/* Container */
.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 8px;
}

.glow-text {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #c084fc 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.15));
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
  font-weight: 300;
}

/* Workspace Grid Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 850px) {
  .workspace-grid {
    grid-template-columns: 1.1fr 1.2fr;
    align-items: start;
  }
  .explanation-card {
    grid-column: 1 / -1;
  }
}

/* Cards (Glassmorphism style) */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
  min-width: 0;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
  color: #c084fc;
}

/* Input Fields & Groups */
.input-group {
  margin-bottom: 28px;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.input-header label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.display-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Custom Badges */
.numeric-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-family: monospace;
  color: #c084fc;
}

.badge {
  background: rgba(192, 132, 252, 0.1);
  border: 1px solid rgba(192, 132, 252, 0.2);
  color: #d8b4fe;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

.secondary-badge {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

/* Custom Styled Range Sliders */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  outline: none;
  margin: 12px 0 6px 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c084fc;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
  transition: transform 0.1s ease, background-color 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #d8b4fe;
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c084fc;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
  border: none;
  transition: transform 0.1s ease;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0 2px;
}

/* Select Inputs */
select {
  background: #14141d;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
  max-width: 100%;
  box-sizing: border-box;
}

select:hover, select:focus {
  border-color: #c084fc;
}

.select-wrapper {
  position: relative;
  width: 100%;
  min-width: 0;
}

.select-wrapper select {
  width: 100%;
  max-width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-sizing: border-box;
}

/* Output Recommendation Panel */
.recommendation-hero {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.output-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.big-ppi-wrapper {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 12px;
}

.big-ppi-number {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
  transition: color 0.3s ease;
}

.big-ppi-unit {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Bottleneck Pill States */
.bottleneck-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}

/* Active Bottleneck Pill Varieties */
.biology-pill {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.substrate-pill {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.hardware-pill {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

/* Visualization Comparison Bars */
.visualization-container {
  margin-bottom: 28px;
}

.visualization-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bar-group {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}

.bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.bar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text-secondary);
}

.bar-label .icon {
  font-size: 1rem;
}

.bar-value-text {
  font-family: monospace;
  font-weight: 600;
  color: var(--text-primary);
}

.bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  transition: width 0.4s cubic-bezier(0.1, 0.8, 0.3, 1), background-color 0.3s;
}

/* Default Bar Accent Fills */
.biology-fill { background: rgba(59, 130, 246, 0.4); }
.substrate-fill { background: rgba(16, 185, 129, 0.4); }
.hardware-fill { background: rgba(139, 92, 246, 0.4); }

/* Highlight Active Bottleneck States */
.bar-group.is-bottleneck {
  background: rgba(245, 158, 11, 0.03);
  border-color: rgba(245, 158, 11, 0.15);
  box-shadow: var(--glow-shadow);
}

.bar-group.is-bottleneck .bar-label {
  color: var(--text-primary);
  font-weight: 600;
}

.bar-group.is-bottleneck .bar-value-text {
  color: var(--color-warning);
}

.bar-group.is-bottleneck .bar-fill.biology-fill {
  background: linear-gradient(90deg, #3b82f6, var(--color-warning));
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.bar-group.is-bottleneck .bar-fill.substrate-fill {
  background: linear-gradient(90deg, #10b981, var(--color-warning));
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.bar-group.is-bottleneck .bar-fill.hardware-fill {
  background: linear-gradient(90deg, #8b5cf6, var(--color-warning));
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Explanation Panel */
.explanation-box {
  background: rgba(245, 158, 11, 0.02);
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.3s, background-color 0.3s;
}

.explanation-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-warning);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#result-explanation {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Dynamics on Bottleneck Transition */
.explanation-box.biology-border {
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.02);
}
.explanation-box.biology-border .explanation-title {
  color: #60a5fa;
}

.explanation-box.substrate-border {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.02);
}
.explanation-box.substrate-border .explanation-title {
  color: #34d399;
}

.explanation-box.hardware-border {
  border-color: rgba(139, 92, 246, 0.2);
  background: rgba(139, 92, 246, 0.02);
}
.explanation-box.hardware-border .explanation-title {
  color: #a78bfa;
}

/* Mobile Responsive Optimizations */
@media (max-width: 600px) {
  .app-container {
    padding: 20px 12px;
    gap: 20px;
  }

  .glow-text {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .subtitle {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .card-title {
    font-size: 1.15rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
  }

  .input-group {
    margin-bottom: 20px;
  }

  .input-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .display-wrapper {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }

  .select-wrapper select {
    padding: 10px;
    font-size: 0.85rem;
  }

  .slider-ticks {
    font-size: 0.85rem;
  }

  .recommendation-hero {
    padding: 16px;
    margin-bottom: 20px;
  }

  .big-ppi-number {
    font-size: 3rem;
  }

  .big-ppi-unit {
    font-size: 1.2rem;
  }

  .bar-group {
    padding: 8px;
    margin-bottom: 12px;
  }

  .bar-header {
    font-size: 0.85rem;
  }

  .explanation-box {
    padding: 14px;
  }

  .explanation-title {
    font-size: 0.85rem;
  }

  #result-explanation {
    font-size: 0.85rem;
  }

  .educational-content {
    margin-top: 24px;
    padding-top: 16px;
  }

  .educational-content h3 {
    font-size: 1.15rem;
  }

  .educational-content h4 {
    font-size: 0.95rem;
    margin-top: 16px;
  }

  .educational-content p, .educational-content ul {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }
}

/* Educational Content Guide */
.educational-content {
  margin-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
  text-align: left;
}

.educational-content h3 {
  color: #c084fc;
  font-size: 1.25rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.educational-content h4 {
  color: var(--text-primary);
  font-size: 1.05rem;
  margin-top: 20px;
  margin-bottom: 8px;
  font-weight: 600;
}

.educational-content p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.educational-content ul {
  color: var(--text-secondary);
  margin-left: 20px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  list-style-type: disc;
}

.educational-content li {
  margin-bottom: 8px;
}

.educational-content li strong {
  color: var(--text-primary);
}

.educational-content a {
  color: var(--text-secondary);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.educational-content a:hover {
  color: var(--text-primary);
}

/* Box-out Aside Styling */
.box-out-aside {
  background: rgba(139, 92, 246, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-left: 3px solid var(--color-hardware);
  border-radius: 8px;
  padding: 16px;
  margin-top: 24px;
  scroll-margin-top: 20px; /* Smooth scroll target visibility */
}

.box-out-aside h5 {
  color: #a78bfa;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.box-out-aside p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 10px;
}

.box-out-aside p:last-child {
  margin-bottom: 0;
}

.box-out-aside ul {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-left: 20px;
  margin-bottom: 10px;
  list-style-type: disc;
}

.box-out-aside li {
  margin-bottom: 6px;
}

.box-out-aside li strong {
  color: var(--text-primary);
}

/* Footnote Asterisk link styling */
.footnote-link {
  color: #a78bfa;
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
  padding: 0 4px;
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease;
}

.footnote-link:hover {
  color: #c084fc;
  transform: translateY(-2px);
}
