/* CSS Variables for METAL Cloud theming */
:root {
  --primary-color: #dc2626;
  --primary-hover: #b91c1c;
  --primary-light: #fef2f2;
  --secondary-color: #374151;
  --accent-color: #6b7280;
  --background-color: #f8fafc;
  --card-background: #ffffff;
  --input-background: #f9fafb;
  --text-color: #111827;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --gradient-primary: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  --gradient-dark: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

/* Force light mode always */
html {
  color-scheme: light;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  min-height: 100vh;
  color: var(--text-color);
  line-height: 1.6;
  padding: 1rem;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Background Video */
#background-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.8;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.calculator-card {
  background: transparent;
  border-radius: var(--border-radius-lg);
  box-shadow: none;
  overflow: hidden;
  border: none;
  backdrop-filter: none;
}

/* Header */
.header {
  padding: 3rem 2rem;
  text-align: center;
  background: transparent;
  border-bottom: none;
  position: relative;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 40%, rgba(220, 38, 38, 0.05) 50%, transparent 60%);
  pointer-events: none;
}

.logo-container {
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.logo {
  height: 80px;
  width: auto;
  max-width: 300px;
}

.header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #1f2937 0%, #dc2626 50%, #991b1b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* Calculator Content */
.calculator-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .calculator-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Input Panel */
.input-panel {
  background: linear-gradient(135deg, var(--input-background) 0%, #ffffff 100%);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  margin-bottom: 0;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

/* Compact Input Panel - Two Columns */
.input-panel-compact {
  background: linear-gradient(135deg, var(--input-background) 0%, #ffffff 100%);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
}

.input-panel-compact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.input-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), #ef4444, var(--primary-color));
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.input-panel h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-color);
  letter-spacing: -0.01em;
}

.input-group {
  margin-bottom: 2rem;
}

.input-panel-compact .input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: flex;
  align-items: center;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.industry-standard {
  font-weight: 400;
  color: #6b7280;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.tooltip {
  margin-left: 0.5rem;
  cursor: help;
  color: var(--primary-color);
  position: relative;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-color);
  color: var(--card-background);
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  white-space: nowrap;
  z-index: 10;
  max-width: 200px;
  white-space: normal;
}

.input-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.input-wrapper {
  flex: 0 0 130px;
  position: relative;
  display: flex;
  align-items: center;
}

.input-controls input[type="number"] {
  flex: 0 0 130px;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text-color);
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.input-wrapper input[type="number"] {
  width: 100%;
  padding-right: 2.5rem;
  flex: none;
}

.unit-label {
  position: absolute;
  right: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  pointer-events: none;
}

.input-controls input[type="range"] {
  flex: 1;
  height: 10px;
  background: var(--border-light);
  border-radius: 8px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.input-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #ef4444 100%);
  cursor: pointer;
  box-shadow: var(--shadow), 0 0 10px rgba(220, 38, 38, 0.3);
  transition: all 0.2s ease;
}

.input-controls input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--primary-hover);
}

.input-controls input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow);
}

/* Results Panel */
.results-panel {
  background: var(--card-background);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}

.results-panel h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-color);
  letter-spacing: -0.01em;
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--input-background) 0%, #ffffff 100%);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
  margin-bottom: 0.75rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.result-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  border-color: var(--primary-color);
}

.result-item.total {
  background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 100%);
  color: var(--text-color);
  font-weight: 700;
  font-size: 1.25rem;
  border: 2px solid var(--primary-color);
  margin-top: 1.5rem;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.result-label {
  font-weight: 500;
  color: var(--text-color);
}

.result-value {
  font-weight: 700;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  color: var(--primary-color);
  font-size: 1.1em;
}

/* Chart Container */
.chart-container {
  display: flex;
  justify-content: center;
  margin: 0 0 2rem 0;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

/* Desktop chart alignment adjustment */
.clean-chart-container > div[style*="display: flex"] {
  height: 240px !important;
}

.clean-chart-container > div[style*="display: flex"] > div {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  height: 100% !important;
  justify-content: flex-end !important;
}

.clean-chart-container > div[style*="display: flex"] > div > div:first-child {
  margin-bottom: auto !important;
  order: 1;
}

.clean-chart-container > div[style*="display: flex"] > div > div:nth-child(2) {
  margin: 0 0 0.5rem 0 !important;
  order: 2;
}

.clean-chart-container > div[style*="display: flex"] > div > div:last-child {
  margin: 0 !important;
  order: 3;
  height: 32px !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding-top: 2px !important;
}

/* METAL Savings Section */
.metal-savings {
  background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 50%, #f8fafc 100%);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-xl), 0 0 20px rgba(220, 38, 38, 0.1);
  position: relative;
  overflow: hidden;
}

.metal-savings::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 40%, rgba(220, 38, 38, 0.03) 50%, transparent 60%);
  pointer-events: none;
}

.savings-header {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.savings-header h3 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-color);
  font-size: 1.25rem;
  font-weight: 600;
}

.metal-price {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.savings-calculation {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.savings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.savings-row.total-savings {
  border-top: 2px solid var(--primary-color);
  padding-top: 1rem;
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: 1.125rem;
}

.savings-label {
  color: var(--text-color);
  font-weight: 500;
}

.savings-value {
  color: var(--primary-color);
  font-weight: 600;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.total-savings .savings-value {
  font-size: 1.25rem;
}

/* Results Layout */
.results-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cost-breakdown {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.metal-analysis {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.savings-summary {
  display: flex;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.savings-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.savings-item .savings-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.savings-item .savings-label {
  font-size: 0.875rem;
  color: var(--text-color);
  font-weight: 500;
}

.metal-costs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

.revenue-analysis {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
}

/* Clean Bar Chart */
.clean-chart-container {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 3rem 2rem;
  margin: 2rem 0;
}

.chart-grid {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  height: 250px;
  padding: 2rem;
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 140px;
}

.value-label {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: #e5e7eb;
  border-radius: 8px;
  min-width: 60px;
  text-align: center;
}

.red-bar {
  width: 100px;
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: height 0.6s ease-out;
}

.bar1 {
  height: 100px;
  background: #dc2626;
}

.bar2 {
  height: 160px;
  background: #ef4444;
}

.bar3 {
  height: 220px;
  background: #f87171;
}

.x-label {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  text-align: center;
}

.savings-chart-container h4 {
  margin: 0 0 1rem 0;
  color: var(--primary-color);
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
}

.simple-chart-wrapper {
  height: 280px;
  width: 100%;
  position: relative;
  padding: 30px 20px 20px 20px;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  height: 180px;
  position: relative;
}

.bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  height: 100%;
  position: relative;
}

.bar {
  width: 60px;
  height: 40px;
  min-height: 20px;
  border-radius: 6px 6px 0 0;
  transition: height 0.8s ease-out;
  margin-top: auto;
}

#year1Bar {
  background: linear-gradient(to top, #3b82f6, #60a5fa);
}

#year2Bar {
  background: linear-gradient(to top, #60a5fa, #93c5fd);
}

#year3Bar {
  background: linear-gradient(to top, #93c5fd, #dbeafe);
}

.bar-value {
  color: #000000;
  font-size: 13px;
  font-weight: 700;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  transition: top 0.8s ease-out;
  z-index: 10;
}

.bar-label {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-align: center;
  white-space: nowrap;
}

/* Yearly Breakdown */
.yearly-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  position: relative;
  z-index: 1;
}

.year-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.year-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  border-color: var(--primary-color);
}

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

.year-value {
  color: var(--primary-color);
  font-weight: 700;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 1.1rem;
}

/* Enhanced Cost Breakdown */
.enhanced-cost-breakdown {
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
  border: 2px solid #fecaca;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(220, 38, 38, 0.1);
}

.cost-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #fecaca;
  transition: all 0.3s ease;
}

.cost-item:last-child {
  border-bottom: none;
}

.cost-item:hover {
  background: rgba(220, 38, 38, 0.05);
  border-radius: 8px;
  padding-left: 0.5rem;
}

.cost-item.opportunity {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 0.5rem 0;
}

.cost-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  width: 40px;
  text-align: center;
}

.cost-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.cost-label {
  font-size: 1rem;
  color: #374151;
  font-weight: 500;
}

.cost-value {
  font-size: 1.125rem;
  color: #dc2626;
  font-weight: 700;
  font-family: 'SF Mono', Monaco, monospace;
}

.total-cost-card {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
  transform: scale(1.02);
}

.total-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-label {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
}

.total-value {
  color: white;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'SF Mono', Monaco, monospace;
}

/* Enhanced Revenue Analysis */
.enhanced-revenue-analysis {
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  border: 2px solid #a7f3d0;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(5, 150, 105, 0.1);
}

.revenue-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #a7f3d0;
  transition: all 0.3s ease;
}

.revenue-item:last-child {
  border-bottom: none;
}

.revenue-item:hover {
  background: rgba(5, 150, 105, 0.05);
  border-radius: 8px;
  padding-left: 0.5rem;
}

.revenue-item.highlight {
  background: linear-gradient(135deg, #ecfdf5 0%, #a7f3d0 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 0.5rem 0;
  border: 2px solid #059669;
}

.revenue-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  width: 40px;
  text-align: center;
}

.revenue-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.revenue-label {
  font-size: 1rem;
  color: #374151;
  font-weight: 500;
}

.revenue-value {
  font-size: 1.125rem;
  color: #059669;
  font-weight: 700;
  font-family: 'SF Mono', Monaco, monospace;
}

.growth-card {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
  transform: scale(1.02);
}

.growth-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.growth-label {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
}

.growth-value {
  color: white;
  font-size: 2rem;
  font-weight: 800;
  font-family: 'SF Mono', Monaco, monospace;
}

/* CTA Button */
.cta-container {
  text-align: center;
  margin-top: 2rem;
}

.cta-button {
  background: linear-gradient(135deg, var(--primary-color) 0%, #ef4444 50%, #dc2626 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow), 0 0 15px rgba(220, 38, 38, 0.3);
  position: relative;
  overflow: hidden;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  transition: left 0.5s ease;
}

.cta-button:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(220, 38, 38, 0.4);
  transform: translateY(-2px);
}

.cta-button:hover::before {
  left: 100%;
}

/* Assumptions Accordion */
.assumptions {
  border-top: 1px solid var(--border-color);
}

.assumptions-toggle {
  width: 100%;
  padding: 1.5rem 2rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assumptions-toggle:hover {
  background: var(--background-color);
}

.toggle-icon {
  transition: transform 0.2s;
}

.assumptions-toggle.active .toggle-icon {
  transform: rotate(180deg);
}

.assumptions-content {
  display: none;
  padding: 0 2rem 2rem;
}

.assumptions-content.show {
  display: block;
}

.assumptions-content h3 {
  margin-bottom: 1rem;
  color: var(--text-color);
}

.formula-list {
  display: grid;
  gap: 1rem;
}

.formula-item {
  padding: 1rem;
  background: linear-gradient(135deg, var(--background-color) 0%, #f8fafc 100%);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}

.formula-item code {
  display: block;
  margin-top: 0.5rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  color: var(--primary-color);
  background: var(--card-background);
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* Enhanced styling for METAL branding */
.input-controls input[type="number"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.assumptions-toggle:hover {
  background: var(--border-color);
}

.formula-item {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.formula-item:hover {
  border-color: var(--accent-color);
}

/* Responsive Design */
@media (min-width: 768px) {
  .header {
    padding: 3rem;
  }
  
  .logo {
    height: 100px;
  }
  
  .header h1 {
    font-size: 2.25rem;
  }
  
  .subtitle {
    font-size: 1.125rem;
  }
  
  .input-group {
    margin-bottom: 2rem;
  }
  
  .calculator-content {
    grid-template-columns: 450px 1fr;
    gap: 2.5rem;
  }
}

/* Animations */
.result-value {
  transition: all 0.3s ease;
}

.result-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* Focus styles */
input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Action Buttons */
.action-buttons {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
  body {
    padding: 0.5rem;
    font-size: 14px;
  }
  
  .container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
  
  .calculator-card {
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  /* Header adjustments */
  .header {
    padding: 1.5rem 1rem;
    text-align: center;
  }
  
  .logo {
    height: 60px;
    margin-bottom: 1rem;
  }
  
  .header h1 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
    margin-bottom: 0;
  }
  
  /* Calculator content - stack vertically */
  .calculator-content {
    display: block;
    padding: 1rem;
  }
  
  /* Input panel adjustments */
  .input-panel-compact {
    display: block;
    gap: 0;
    margin-bottom: 2rem;
  }
  
  .input-panel-compact h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
  }
  
  .input-group {
    margin-bottom: 1.5rem;
  }
  
  .input-group label {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: block;
  }
  
  .input-controls {
    gap: 0.5rem;
  }
  
  .input-controls input[type="number"] {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
    min-height: 44px; /* Touch target size */
  }
  
  .input-controls input[type="range"] {
    margin-top: 0.5rem;
    min-height: 44px;
  }
  
  /* Results panel adjustments */
  .results-panel {
    padding: 1rem;
  }
  
  /* Stack the cost breakdown and revenue analysis vertically */
  .results-panel > div[style*="grid-template-columns"] {
    display: block !important;
    grid-template-columns: none !important;
    gap: 1rem !important;
  }
  
  .enhanced-cost-breakdown,
  .enhanced-revenue-analysis {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .enhanced-cost-breakdown h3,
  .enhanced-revenue-analysis h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  .cost-item,
  .revenue-item {
    padding: 0.75rem 0;
    font-size: 0.9rem;
  }
  
  .cost-value,
  .revenue-value {
    font-size: 0.95rem;
  }
  
  .total-cost-card,
  .growth-card {
    padding: 1rem;
    margin-top: 1rem;
  }
  
  .total-value,
  .growth-value {
    font-size: 1.25rem;
  }
  
  /* Action buttons mobile layout */
  .action-buttons {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }
  
  .action-button,
  .cta-button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    min-height: 48px;
    justify-content: center;
  }
  
  /* Chart container adjustments */
  .clean-chart-container {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .clean-chart-container h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  
  /* Mobile chart optimizations */
  .clean-chart-container > div[style*="display: flex"] {
    height: 240px !important;
    padding: 0 0.25rem !important;
    gap: 0.25rem !important;
    justify-content: space-around !important;
    align-items: flex-end !important;
  }
  
  .clean-chart-container > div[style*="display: flex"] > div {
    flex: 1;
    max-width: 90px;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    height: 100% !important;
    justify-content: flex-end !important;
  }
  
  .clean-chart-container > div[style*="display: flex"] > div > div:first-child {
    font-size: 0.9rem !important;
    font-weight: bold !important;
    text-align: center !important;
    margin-bottom: auto !important;
    order: 1;
  }
  
  .clean-chart-container > div[style*="display: flex"] > div > div:nth-child(2) {
    width: 45px !important;
    margin: 0 0 0.5rem 0 !important;
    border-radius: 6px !important;
    order: 2;
  }
  
  .clean-chart-container > div[style*="display: flex"] > div > div:last-child {
    font-size: 0.7rem !important;
    line-height: 1.1 !important;
    text-align: center !important;
    color: #666 !important;
    margin: 0 !important;
    order: 3;
    height: 32px !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: 2px !important;
  }
  
  /* Disclaimer adjustments */
  .disclaimer {
    padding: 0.75rem;
    margin: 1rem 0;
    font-size: 0.8rem;
  }
  
  /* Assumptions accordion mobile */
  .assumptions-toggle {
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  .assumptions-content {
    padding: 0 1rem 1.5rem;
  }
  
  .formula-item {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }
  
  .formula-item code {
    font-size: 0.8rem;
    padding: 0.5rem;
    overflow-x: auto;
  }
}

.action-button {
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.action-button.primary {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.action-button.primary:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

.action-button.secondary {
  background: transparent;
  color: var(--secondary-color);
  border-color: var(--border-color);
}

.action-button.secondary:hover {
  background: var(--input-background);
  border-color: var(--secondary-color);
}

.cta-button {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Responsive action buttons */
@media (max-width: 768px) {
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .action-button,
  .cta-button {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}
