@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-core: #090D14;
  --bg-card: #121824;
  --bg-card-elevated: #182234;
  --bg-input: #0A0E17;
  --border-line: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 107, 0, 0.2);
  --border-focus: #FF6B00;
  
  --text-main: #F3F4F6;
  --text-muted: #94A3B8;
  --accent-orange: #FF6B00;
  --accent-cyan: #00F2FE;
  --accent-green: #10B981;
  --whatsapp-green: #25D366;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --font-tech: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Site Header */
.site-header {
  background: rgba(18, 24, 36, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-line);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.back-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: #FFFFFF;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 107, 0, 0.12);
  color: var(--accent-orange);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-family: var(--font-tech);
  font-weight: 700;
  border: 1px solid rgba(255, 107, 0, 0.3);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
  box-shadow: 0 0 6px var(--accent-orange);
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

.app-container {
  padding-top: 2rem;
  padding-bottom: 3.5rem;
  flex: 1;
}

/* Header Hero */
header {
  text-align: center;
  margin-bottom: 2.25rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 107, 0, 0.12);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 107, 0, 0.35);
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

h1 {
  font-family: var(--font-tech);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #FFFFFF;
  margin-bottom: 10px;
}

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

/* Presets Bar */
.presets-section {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(18, 24, 36, 0.85);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.presets-label {
  font-size: 0.8rem;
  font-family: var(--font-tech);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-orange);
  margin-bottom: 0.65rem;
}

.preset-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-chip {
  background: #0A0E17;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.preset-chip:hover {
  background: #182234;
  border-color: var(--accent-cyan);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.preset-chip.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(255, 107, 0, 0.4);
}

/* Calculator Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 880px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.results-card {
  background: linear-gradient(180deg, #131A28 0%, #0F1420 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 107, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--font-tech);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
  width: 100%;
}

.form-group label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

select, input[type="text"], input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  display: block;
  background-color: var(--bg-input);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.98rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.15s ease;
}

select:focus, input[type="text"]:focus, input[type="number"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.25);
  background-color: #121824;
}

.divider {
  height: 1px;
  background: var(--border-line);
  margin: 1.5rem 0;
}

/* Telemetry Bar */
.telemetry-bar {
  display: flex;
  justify-content: space-between;
  background: #090D14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-item strong {
  color: #FFFFFF;
}

.telemetry-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.telemetry-dot.hotend {
  background: #FF6B00;
  box-shadow: 0 0 6px #FF6B00;
}

.telemetry-dot.bed {
  background: #FBBF24;
  box-shadow: 0 0 6px #FBBF24;
}

.telemetry-dot.fan {
  background: #00F2FE;
  box-shadow: 0 0 6px #00F2FE;
}

/* 3D Canvas Bed Visualizer */
.canvas-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 2px solid rgba(255, 107, 0, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

canvas#printCanvas {
  display: block;
  width: 100%;
  height: 220px;
  background: #0A0E17;
}

.canvas-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.bed-tag {
  background: rgba(9, 13, 20, 0.85);
  backdrop-filter: blur(6px);
  color: var(--accent-orange);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 107, 0, 0.35);
}

.spool-tag {
  background: rgba(9, 13, 20, 0.85);
  backdrop-filter: blur(6px);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

/* Highlight Box (OLED display look) */
.highlight-box {
  background: linear-gradient(135deg, #1C150A 0%, #151C2C 100%);
  border: 1.5px solid var(--accent-orange);
  color: #FFFFFF;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 20px rgba(255, 107, 0, 0.2);
}

.highlight-label {
  font-family: var(--font-tech);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-orange);
  margin-bottom: 4px;
}

.highlight-value {
  font-family: var(--font-mono);
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #FFFFFF;
}

.highlight-subtext {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent-green);
  margin-top: 4px;
}

/* Breakdown List */
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card-elevated);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.breakdown-label {
  color: var(--text-muted);
  font-size: 0.88rem;
  flex: 1;
}

.breakdown-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: #FFFFFF;
  text-align: right;
  flex-shrink: 0;
}

.amber-color {
  color: var(--accent-orange) !important;
}

/* Action Buttons */
.actions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-whatsapp-direct {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #FFFFFF;
  font-family: var(--font-tech);
  font-size: 1rem;
  font-weight: 700;
  padding: 13px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  transition: all 0.2s ease;
}

.btn-whatsapp-direct:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  color: #FFFFFF;
}

.btn-whatsapp {
  background: #182030;
  color: #A7F3D0;
  border: 1.5px solid rgba(37, 211, 102, 0.4);
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn-whatsapp:hover {
  background: #1F2D40;
  border-color: #25D366;
  color: #FFFFFF;
}

.btn-print {
  background: #182030;
  color: var(--text-main);
  border: 1.5px solid rgba(255, 107, 0, 0.35);
  font-family: var(--font-tech);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-print:hover {
  background: #202B40;
  border-color: var(--accent-orange);
  color: #FFFFFF;
}

.copy-toast {
  display: none;
  background: var(--whatsapp-green);
  color: #000000;
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  margin-top: 10px;
}

/* Tips Grid */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.tip-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.tip-title {
  font-family: var(--font-tech);
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.tip-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Related Tools Section */
.related-tools-section {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-tech);
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 1.25rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.related-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.related-card:hover {
  background: #1C263A;
  border-color: var(--accent-orange);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 0, 0.2);
}

.related-emoji {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.related-name {
  font-family: var(--font-tech);
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.related-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* FAQ Section */
.faq-section {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  margin-bottom: 2rem;
}

.faq-title {
  font-family: var(--font-tech);
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 1.25rem;
}

.faq-item {
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: var(--bg-card-elevated);
  margin-bottom: 0.85rem;
}

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

.faq-q {
  font-family: var(--font-tech);
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.faq-a {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0 1rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-line);
  background: var(--bg-card);
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-contact a {
  color: var(--accent-orange);
  font-weight: 600;
  text-decoration: underline;
}

/* Print */
@media print {
  body {
    background: #FFF !important;
    color: #000 !important;
  }
  .site-header, .badge, .actions-grid, footer, .related-tools-section, .tips-grid, .telemetry-bar {
    display: none !important;
  }
  .card, .results-card, .faq-section {
    box-shadow: none !important;
    border: 1px solid #CCC !important;
    background: #FFF !important;
    color: #000 !important;
  }
}

/* Amazon Associates Gear Box */
.affiliate-box {
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.5rem;
}
.affiliate-box h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.affiliate-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.6rem;
}
.affiliate-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-inner);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  transition: all 0.15s ease;
}
.affiliate-btn:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  color: #fff;
}
.affiliate-badge {
  font-size: 0.68rem;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.amazon-disclosure {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.65rem;
  text-align: center;
}
