/* NVIDIA Fibonacci Calculator Styles */
:root {
  --primary-color: #76b900; /* NVIDIA green */
  --primary-dark: #5a8f00;
  --secondary-color: #00d4aa; /* NVIDIA teal */
  --accent-color: #ff6b35; /* NVIDIA orange */
  --info-color: #00b4d8; /* NVIDIA blue */
  --danger-color: #e63946;
  --success-color: #76b900; /* NVIDIA green */
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  
  /* NVIDIA Fonts */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --font-family: var(--font-primary);
}

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

body {
  font-family: var(--font-primary);
  background: #76b900; /* NVIDIA green */
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 100%; /* use full screen width */
  margin: 0 auto;
  padding: 1rem; /* reduced padding */
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 1.5rem; /* reduced margin */
}

.header-content {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
  padding: 1rem 1.5rem; /* reduced padding */
  border-radius: 16px; /* reduced border radius */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); /* reduced shadow */
  backdrop-filter: blur(20px);
  border: 1px solid rgba(118, 185, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.header-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--info-color));
}

.title {
  font-family: var(--font-primary);
  font-size: 1.8rem; /* reduced for density */
  font-weight: 700; /* increased */
  color: #ffffff;
  margin-bottom: 0.5rem; /* reduced margin */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem; /* reduced gap */
  text-align: center;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.title i {
  font-size: 1.4rem; /* reduced for density */
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-family: var(--font-primary);
  font-size: 0.9rem; /* reduced for density */
  color: #e0e0e0;
  font-weight: 500; /* increased */
  text-align: center;
  position: relative;
  z-index: 1;
  opacity: 0.8;
}

/* Main Content */
.main-content {
  display: grid;
  gap: 1rem; /* reduced gap for density */
}

.layout-2col {
  grid-template-columns: 1fr; /* single column layout */
}

.col-left, .col-right { 
  display: flex; 
  flex-direction: column; 
  gap: 2rem; 
  width: 100%; /* ensure full width */
}

.widget-row {
  display: grid !important; /* use CSS Grid */
  grid-template-columns: 1fr 1fr !important; /* equal width sections */
  gap: 0.75rem; /* reduced gap for density */
  width: 100% !important; /* ensure full width */
  min-width: 0; /* allow shrinking */
}

.widget-row .calculator-section:first-child {
  grid-column: 1 !important; /* first column */
  min-width: 0; /* allow shrinking */
  max-width: none; /* remove any max-width constraints */
}

.widget-row .calculator-section:last-child {
  grid-column: 2 !important; /* second column */
  min-width: 0; /* allow shrinking */
  max-width: none; /* remove any max-width constraints */
}

/* Request: top row widgets with reduced height */
.widget-row .calculator-section {
  height: 250px; /* further reduced height for more compact layout */
  display: flex;
  flex-direction: column;
}

.widget-row .calculator-section .calculator-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0.75rem;
  padding: 1rem;
}

/* Elegant input groups with consistent spacing */
.widget-row .calculator-section .input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0;
}

/* Elegant fibonacci displays */
.widget-row .calculator-section .fibonacci-display {
  margin: 0;
  flex: 0 0 auto;
}

/* Elegant buttons */
.widget-row .calculator-section .btn {
  height: 44px; /* consistent elegant button height */
  margin: 0;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

/* Elegant result displays */
.widget-row .calculator-section .result-display {
  margin-top: 0;
  flex: 1;
  min-height: 60px;
}

/* Full width sections */
.full-width .calculator-section {
  height: 400px; /* increased height for GPU section */
  max-width: 100%; /* ensure equal width with top row */
}

/* GPU Acceleration Estimate section gets more space */
.full-width:has(#perfResult) .calculator-section {
  height: auto; /* auto height to fit all content */
  min-height: 700px; /* expanded height to accommodate all performance rows without scrolling */
}

/* Spiral section gets less space */
.full-width:has(#fibChart) .calculator-section {
  height: 350px; /* reduced height for spiral section */
}

.layout-2col {
  grid-template-rows: auto auto auto;
}

.full-width {
  grid-column: 1 / -1; /* span both columns */
}

.top-row {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}

.calculator-section {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
}

/* Fixed-size widgets in top row */
.col-left .calculator-section {
  min-width: 0;
}

.col-left .calculator-card {
  min-height: 360px; /* doubled to fit in larger widget */
}

.calculator-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: #cbd5e0;
}

.section-header {
  background: linear-gradient(135deg, #76b900, #5a9c00);
  color: white;
  padding: 0.75rem 1rem;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  height: auto;
}

.calculator-card {
  padding: 0.5rem; /* further reduced padding for compact layout */
  display: flex;
  flex-direction: column;
  height: calc(100% - 2.5rem); /* subtract reduced header height */
}

/* Calculate Fibonacci two-column layout */
.calculate-layout {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  height: 100%;
  align-items: flex-start;
}

.calculate-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: flex-start;
}

.calculate-right {
  flex: 0 0 200px; /* fixed width for method selector and output */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem; /* align method selector with slider level */
}

.calculate-left .input-group {
  margin-bottom: 0;
}

.calculate-right .method-selector {
  margin-bottom: 0;
}

.calculate-left .btn {
  align-self: flex-start;
}

/* Value display under slider */
.value-display {
  display: inline-block;
  background: #76b900;
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0;
  text-align: center;
  min-width: 40px;
  max-width: 80px;
  box-shadow: 0 2px 4px rgba(118, 185, 0, 0.2);
  flex-shrink: 0;
}

/* Fibonacci display */
.fibonacci-display {
  margin: 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fibonacci-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.fibonacci-label {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
}

.fibonacci-number {
  font-size: 1.2rem;
  font-weight: 700;
  color: #76b900;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  display: inline-block;
}

/* Check result styling */
.fibonacci-number.check-success {
  color: #16a34a;
}

.fibonacci-number.check-error {
  color: #dc2626;
}

/* Button color states */
.btn-gray {
  background: #6b7280;
  color: white;
  border: none;
}

.btn-gray:hover {
  background: #4b5563;
}

.btn-success {
  background: #16a34a;
  color: white;
  border: none;
}

.btn-success:hover {
  background: #15803d;
}

.btn-warning {
  background: #eab308;
  color: white;
  border: none;
}

.btn-warning:hover {
  background: #ca8a04;
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* GPU position value display */
#perfPositionValue {
  display: inline-block;
  background: #17a2b8;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9rem;
  margin-left: 0.5rem;
  text-align: center;
  min-width: 40px;
}

/* Input Groups */
.input-group {
  margin-bottom: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Input row for horizontal layout */
.input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Button in input row */
.input-row .btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Sync control */
.sync-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  margin: -0.75rem 0;
}

.sync-control input[type="checkbox"] {
  width: 40px;
  height: 20px;
  cursor: pointer;
}

.sync-control label {
  font-size: 0.9rem;
  color: #4a5568;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Error hints */
.error-hint {
  color: #dc2626;
  font-size: 0.85rem;
  font-style: italic;
}

/* Active sync indicator */
.calculator-section.synced {
  border: 2px solid #76b900;
  box-shadow: 0 0 10px rgba(118, 185, 0, 0.2);
}

.input-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0;
  color: #2d3748;
  white-space: nowrap;
  flex-shrink: 0;
}

.input-group input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #2d3748;
  transition: all 0.2s ease;
  margin-bottom: 0;
  height: auto;
  font-weight: 500;
  min-width: 0;
}

.input-group input:focus {
  outline: none;
  border-color: #76b900;
  box-shadow: 0 0 0 3px rgba(118, 185, 0, 0.1);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  height: 44px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

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

.btn-secondary:hover {
  background: #059669;
}

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

.btn-accent:hover {
  background: #d97706;
}

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

.btn-golden:hover {
  background: #b45309;
}

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

.btn-info:hover {
  background: #0891b2;
}

/* Method Selector */
.method-selector {
  margin-bottom: 0.5rem; /* further reduced margin for compact layout */
  flex-shrink: 0; /* prevent shrinking */
}

.method-selector label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem; /* reduced margin for density */
  color: var(--text-primary);
  height: 1rem; /* reduced height for density */
  font-size: 0.85rem; /* smaller font for density */
}

.radio-group {
  display: flex;
  gap: 0.75rem; /* reduced gap for density */
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem; /* reduced gap for density */
  cursor: pointer;
  padding: 0.4rem 0.75rem; /* reduced padding for density */
  border-radius: 4px; /* reduced border radius */
  transition: background-color 0.2s ease;
  font-size: 0.8rem; /* smaller font for density */
}

.radio-label:hover {
  background: var(--bg-tertiary);
}

.radio-label input[type="radio"] {
  margin: 0;
  width: auto;
}

.radio-label input[type="radio"]:checked + span {
  color: var(--primary-color);
  font-weight: 500;
}

/* Result Displays */
.result-display,
.sequence-display,
.check-display,
.golden-display,
.performance-display {
  margin-top: 0.75rem; /* reduced margin for density */
  padding: 0.75rem; /* reduced padding for density */
  border-radius: 6px; /* reduced border radius */
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary-color); /* reduced border width */
  min-height: 40px; /* reduced min height for density */
  max-height: 120px; /* added max height for scrolling */
  display: flex;
  align-items: flex-start; /* changed from center to flex-start */
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  flex: 1; /* take remaining space */
  flex-shrink: 0; /* prevent shrinking */
  font-size: 0.8rem; /* smaller font for density */
  overflow-y: auto; /* added scrolling */
  scrollbar-width: thin; /* Firefox thin scrollbar */
  scrollbar-color: var(--primary-color) transparent; /* Firefox scrollbar colors */
}

.result-display {
  font-size: 0.85rem; /* slightly larger for better readability */
  font-weight: 600;
  color: var(--primary-color);
  min-height: 60px; /* ensure adequate height */
  max-height: none; /* remove height restriction */
  overflow: visible; /* allow content to expand */
  margin-top: 0.5rem; /* reduced margin below calculate button */
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #76b900;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

/* The detail boxes hold only error hints; empty, they take no space. */
.result-display:empty {
  display: none;
}

.result-display.success {
  color: #16a34a;
  border-color: #16a34a;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.result-display.error {
  color: #dc2626;
  border-color: #dc2626;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.sequence-display {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sequence-item {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.check-display {
  font-size: 0.85rem; /* increased for better readability */
  font-weight: 600;
  min-height: 60px; /* ensure adequate height */
  margin-top: 1rem; /* add margin below check button */
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #6f42c1;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.check-display.success {
  color: #16a34a; 
  border-color: #16a34a; 
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.check-display.error {
  color: #dc2626; 
  border-color: #dc2626; 
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

/* removed golden-display styles */

.performance-display {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 140px; /* increased minimum height for three rows */
  max-height: none; /* remove max-height to show all content */
  overflow: visible; /* ensure all content is visible */
}

/* Style performance box like terminal */
#perfResult.performance-display {
  background: linear-gradient(135deg, #0b1220 0%, #1a202c 100%);
  color: #e5e7eb;
  border-left-color: #76b900;
  border: 2px solid #1f2937;
  border-radius: 12px;
  font-size: 11px; /* reduced for better density */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 1rem;
}

.perf-item { 
  width: 100%; 
  padding: 0.65rem; 
  background: rgba(118, 185, 0, 0.1); 
  border-radius: 6px;
  margin-bottom: 0.4rem;
  border-left: 3px solid #76b900;
  transition: all 0.2s ease;
}
.perf-item:hover {
  background: rgba(118, 185, 0, 0.15);
  transform: translateX(2px);
}
.perf-method {
  color: #76b900;
  font-weight: 600;
  font-size: 0.8em;
}
.perf-time { 
  color: #e5e7eb; 
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75em;
}
.gpu-estimate { 
  color: #76b900; 
  font-weight: 700; 
  text-shadow: 0 0 8px rgba(118, 185, 0, 0.3);
  font-family: var(--font-mono);
  font-size: 0.75em;
}

/* GPU Info Panel */
.gpu-info-panel {
  margin-top: 1rem;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(118, 185, 0, 0.05);
  border: 1px solid rgba(118, 185, 0, 0.2);
}

.info-toggle {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(118, 185, 0, 0.1) 0%, rgba(118, 185, 0, 0.05) 100%);
  border: none;
  color: #76b900;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.info-toggle:hover {
  background: linear-gradient(135deg, rgba(118, 185, 0, 0.15) 0%, rgba(118, 185, 0, 0.1) 100%);
}

.info-chevron {
  transition: transform 0.3s ease;
}

.info-toggle.expanded .info-chevron {
  transform: rotate(180deg);
}

.info-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(11, 18, 32, 0.8);
  color: #e5e7eb;
}

.info-content.expanded {
  max-height: 1200px; /* increased to ensure all content is visible */
  overflow: visible; /* allow content to be fully visible */
}

/* GPU Details Two-Column Layout */
.gpu-details-layout {
  display: flex;
  gap: 1.5rem;
}

.gpu-details-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gpu-details-right {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Enhanced Algorithm Analysis */
.algorithm-highlight {
  background: linear-gradient(135deg, rgba(118, 185, 0, 0.1), rgba(118, 185, 0, 0.05));
  border: 2px solid #76b900;
  border-radius: 12px;
  padding: 1rem;
}

.algorithm-highlight h4 {
  color: #76b900;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.algorithm-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.algorithm-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem;
  border-left: 4px solid;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.algorithm-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.highlight-iterative {
  border-left-color: #4CAF50;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
}

.highlight-memorized {
  border-left-color: #FF9800;
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 152, 0, 0.05));
}

.highlight-recursive {
  border-left-color: #2196F3;
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.05));
}

.algorithm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.algorithm-header strong {
  color: #e5e7eb;
  font-size: 0.9rem;
}

.speedup-badge {
  background: #76b900;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: bold;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.8; }
  100% { opacity: 1; }
}

.algorithm-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric {
  font-size: 0.7rem;
  color: #e5e7eb;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border-left: 2px solid #76b900;
}

/* Responsive Design */
@media (max-width: 768px) {
  .widget-row {
    grid-template-columns: 1fr !important; /* single column on mobile */
  }

  .widget-row .calculator-section:first-child,
  .widget-row .calculator-section:last-child {
    grid-column: auto !important; /* stack; a pinned column 2 would overlap column 1 */
  }

  .input-group label {
    white-space: normal; /* wrap; the GPU label is wider than a phone card */
  }

  .input-group label span {
    white-space: nowrap;
  }

  #perfPositionValue {
    display: inline; /* an inline-block lets the line break after "F(" */
  }

  .gpu-details-layout {
    flex-direction: column;
    gap: 1rem;
  }
  
  .algorithm-stack {
    gap: 0.5rem;
  }
  
  .algorithm-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .algorithm-metrics {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .metric {
    flex: 1;
    min-width: calc(50% - 0.125rem);
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 0.5rem;
  }
  
  .calculator-section {
    margin-bottom: 1rem;
  }
  
  .algorithm-metrics {
    flex-direction: column;
  }
  
  .metric {
    min-width: 100%;
  }
}


.info-section {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(118, 185, 0, 0.1);
}

.info-section:last-child {
  border-bottom: none;
}

.info-section h4 {
  color: #76b900;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-section li {
  padding: 0.2rem 0;
  font-size: 0.7rem;
  line-height: 1.3;
}

.algorithm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.algorithm-item {
  background: rgba(118, 185, 0, 0.05);
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(118, 185, 0, 0.2);
}

.algorithm-item strong {
  color: #76b900;
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
}

.metrics {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metrics span {
  font-size: 0.65rem;
  color: #a1a1aa;
}

.sources {
  background: rgba(118, 185, 0, 0.02);
}

.sources p {
  font-size: 0.65rem;
  color: #9ca3af;
  font-style: italic;
  margin: 0;
}

.sources ul {
  margin: 0;
  padding-left: 1rem;
}

.sources li {
  margin-bottom: 0.25rem;
}

.sources a {
  color: #76b900;
  text-decoration: none;
  font-size: 0.65rem;
  transition: color 0.2s ease;
}

.sources a:hover {
  color: #5a9c00;
  text-decoration: underline;
}

/* Graph */
.graph-wrapper {
  width: 100%;
  overflow: auto;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  border: 2px solid var(--border-color);
  padding: 1rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.graph-wrapper.center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px; /* reduced space for smaller canvas */
}

canvas#fibChart {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #ffffff;
}

/* Terminal removed */

.perf-item {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem;
  background: var(--bg-primary);
  border-radius: 6px;
  font-size: 0.9rem;
}

.perf-method {
  font-weight: 500;
  color: var(--text-primary);
}

.perf-time {
  color: var(--text-secondary);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  color: var(--text-secondary);
}

/* NVIDIA Slider Styles */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  outline: none;
  opacity: 0.8;
  transition: opacity 0.2s;
  margin: 0.5rem 0;
}

.slider:hover {
  opacity: 1;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--primary-color);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid var(--primary-color);
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.slider::-webkit-slider-track {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.slider::-moz-range-track {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  height: 8px;
}

/* Value display for sliders */
.input-group label span {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(118, 185, 0, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-left: 0.5rem;
}

/* Minimal scrollbar styling for output fields */
.sequence-display::-webkit-scrollbar,
.check-display::-webkit-scrollbar,
.golden-display::-webkit-scrollbar,
.performance-display::-webkit-scrollbar {
  width: 6px;
}

.sequence-display::-webkit-scrollbar-track,
.check-display::-webkit-scrollbar-track,
.golden-display::-webkit-scrollbar-track,
.performance-display::-webkit-scrollbar-track {
  background: transparent;
}

.sequence-display::-webkit-scrollbar-thumb,
.check-display::-webkit-scrollbar-thumb,
.golden-display::-webkit-scrollbar-thumb,
.performance-display::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
  opacity: 0.6;
}

.sequence-display::-webkit-scrollbar-thumb:hover,
.check-display::-webkit-scrollbar-thumb:hover,
.golden-display::-webkit-scrollbar-thumb:hover,
.performance-display::-webkit-scrollbar-thumb:hover {
  opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .title {
    font-size: 2rem;
  }
  
  .title i {
    font-size: 1.5rem;
  }
  
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .radio-group {
    flex-direction: column;
  }
  
  .sequence-display {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error States */
.error {
  color: var(--danger-color);
  background: #fef2f2;
  border-left-color: var(--danger-color);
}

/* Success States */
.success {
  color: var(--success-color);
  background: #f0fdf4;
  border-left-color: var(--success-color);
}

/* Exact values run to many digits (F(100) has 21): wrap them inside their box. */
#fibonacciValue, #checkResult, .fibonacci-number { overflow-wrap: anywhere; word-break: break-word; }
#checkValue { display: inline-block; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* The cards grow with their result; a fixed height clipped the result line. */
.widget-row .calculator-section { height: auto; min-height: 250px; overflow: visible; }
.widget-row .calculator-card { height: auto; min-height: 0; }
