/* ============================================================
   PrintCalc Pro — Stylesheet  (drprint.in-inspired B&W theme)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;0,800&display=swap');

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

:root {
  --bg:        #080808;
  --bg-card:   #111111;
  --bg-card2:  #1a1a1a;
  --border:    #242424;
  --border2:   rgba(255,255,255,0.10);
  --accent:    #ffffff;
  --accent2:   #aaaaaa;
  --text:      #f0f0f0;
  --text2:     #666666;
  --radius:    0px;
  --radius-sm: 0px;
}

/* ── Base ──────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Utilities ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.muted-text { color: var(--text2); font-size: 13px; text-align: center; padding: 12px 0; }
.accent-val { color: var(--accent); font-weight: 700; letter-spacing: 0; text-transform: none; font-size: 14px; }

/* ── Header ────────────────────────────────────────────────── */
.header {
  position: relative;
  z-index: 10;
  background: #000;
  border-bottom: 1px solid var(--border);
  padding: 13px 28px;
}
.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  white-space: nowrap;
  letter-spacing: -0.03em;
}
.logo b {
  color: #fff;
}
.logo-icon { width: 32px; height: 32px; flex-shrink: 0; }

.header-right { display: flex; align-items: center; gap: 12px; }

.slicer-status {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 0px;
  border: 1px solid;
}
.slicer-status--checking { color: #666; border-color: #333; }
.slicer-status--online   { color: #aaa; border-color: #444; }
.slicer-status--offline  { color: #888; border-color: #444; cursor: help; }
.header-badge {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 0px;
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Main ──────────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  background: #fff;
  color: #000;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
  transition: background .15s, transform .15s;
  letter-spacing: -0.01em;
}
.btn-primary:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-full { width: 100%; text-align: center; padding: 14px; font-size: 15px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card + .card { margin-top: 16px; }
.card h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 18px; color: var(--text); }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-header h3 { margin-bottom: 0; }

/* ── Upload Screen ─────────────────────────────────────────── */
#upload-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 72px;
  gap: 36px;
  min-height: calc(100vh - 58px);
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero { text-align: center; max-width: 640px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 0px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto 24px;
}

.feature-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  padding: 5px 13px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

/* ── Upload zone ───────────────────────────────────────────── */
.upload-card { width: 100%; max-width: 520px; }

.upload-zone {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0px;
  padding: 48px 40px 40px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .15s;
}
.upload-zone:hover { border-color: rgba(255,255,255,0.3); }
.upload-zone.drag-over {
  border-color: #fff;
  transform: scale(1.012);
}

.upload-visual {
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
  background: var(--bg-card2);
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.upload-visual svg { width: 44px; height: 44px; }

.upload-zone h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.upload-zone > p { color: var(--text2); margin-bottom: 24px; font-size: 14px; }
.upload-zone strong { color: #fff; }
.upload-note {
  font-size: 12px;
  color: var(--text2);
  margin-top: 16px;
  opacity: 0.7;
}

/* ── Calculator Screen ─────────────────────────────────────── */
#calc-screen { padding-top: 28px; }

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 780px) {
  .calc-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 38px; }
}

/* ── 3D Viewer ─────────────────────────────────────────────── */
.viewer {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #050505;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: grab;
  position: relative;
  border: 1px solid var(--border);
}
.viewer:active { cursor: grabbing; }
.viewer canvas { display: block; }
.viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text2);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* ── Model Stats ───────────────────────────────────────────── */
.model-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.stat-item {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}
.stat-label { font-size: 10px; color: var(--text2); text-transform: uppercase; letter-spacing: .07em; }
.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.stat-unit { font-size: 10px; color: var(--text2); }

/* ── Option Sections ───────────────────────────────────────── */
.option-section { margin-bottom: 20px; }
.option-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}

/* ── Material Grid ─────────────────────────────────────────── */
.material-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }

.material-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 4px 9px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  color: var(--text);
}
.material-btn:hover { border-color: rgba(255,255,255,0.25); transform: translateY(-1px); }
.material-btn.active {
  border-color: #fff;
  background: rgba(255,255,255,0.05);
}
.material-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin: 0 auto 6px;
  background: var(--mat-color);
}
.material-name { font-size: 11px; font-weight: 600; letter-spacing: -0.01em; }
.material-price { font-size: 10px; color: var(--text2); margin-top: 2px; }

/* ── Support / generic toggle ──────────────────────────────── */
.toggle-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.toggle-btn:hover { border-color: rgba(255,255,255,0.25); color: var(--text); }
.toggle-btn.active {
  border-color: #fff;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-weight: 600;
}

/* ── Quality Grid ──────────────────────────────────────────── */
.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.quality-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  color: var(--text);
}
.quality-btn:hover { border-color: rgba(255,255,255,0.25); transform: translateY(-1px); }
.quality-btn.active {
  border-color: #fff;
  background: rgba(255,255,255,0.06);
}
.quality-icon { font-size: 20px; margin-bottom: 5px; }
.quality-name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.quality-layer { font-size: 11px; color: var(--text2); margin-top: 2px; }
.quality-desc { font-size: 10px; color: var(--text2); margin-top: 2px; }

/* ── Infill Slider ─────────────────────────────────────────── */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 0px;
  outline: none;
  margin: 6px 0 5px;
  cursor: pointer;
  background: linear-gradient(
    to right,
    #fff 0%,
    #fff var(--sl-fill, 15.8%),
    var(--bg-card2) var(--sl-fill, 15.8%)
  );
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 0 2px #000, 0 0 0 4px rgba(255,255,255,0.4);
}
.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid #000;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}
.slider-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text2); }

/* ── Infill Type Selector ──────────────────────────────────── */
.itype-row { display: flex; gap: 5px; margin-top: 10px; }
.itype-btn {
  flex: 1;
  padding: 5px 2px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 0px;
  color: var(--text2);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  text-align: center;
}
.itype-btn:hover { border-color: rgba(255,255,255,0.28); color: var(--text); }
.itype-btn.active {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* ── Print Preview Canvas ──────────────────────────────────── */
.print-preview {
  display: block;
  width: 100%;
  height: 96px;
  margin-top: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0a0a0a;
}

/* ── Quantity Control ──────────────────────────────────────── */
.qty-control {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-btn {
  background: none;
  border: none;
  color: var(--text);
  width: 42px;
  height: 42px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.qty-btn:hover { background: rgba(255,255,255,0.07); }
#qty-val { min-width: 38px; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }

/* ── Advanced Section (collapsible) ───────────────────────── */
.adv-section { border-top: 1px solid var(--border); padding-top: 14px; }
.adv-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  margin-bottom: 0;
}
.adv-summary::-webkit-details-marker { display: none; }
.adv-summary::after {
  content: '▸';
  font-size: 10px;
  opacity: 0.45;
  margin-left: 4px;
  transition: transform .2s;
}
details[open] > .adv-summary::after { transform: rotate(90deg); }
.adv-hint {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.4;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}
.adv-body { padding-top: 2px; }

/* ── Price Card ────────────────────────────────────────────── */
.price-card {
  background: var(--bg-card);
  border-color: var(--border);
}
.price-card h3 { margin-bottom: 14px; }

.breakdown-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.breakdown-label { color: var(--text2); }
.breakdown-value { font-weight: 600; letter-spacing: -0.01em; }

.support-note {
  font-size: 11px;
  color: var(--text2);
  margin-top: 7px;
  text-align: center;
  line-height: 1.4;
}
.support-note-warn { color: #aaa; }
.support-note-ok   { color: #888; }

.breakdown-row--sub {
  margin-top: -3px;
  background: rgba(255,255,255,0.02);
  border-color: transparent;
  padding: 5px 12px 5px 20px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.breakdown-row--sub .breakdown-label { font-size: 11px; }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  border-top: 1px solid var(--border);
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 15px;
}
.total-amount {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 0px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ── Dr.PrinT Overrides ──────────────────────────────────── */
.logo {
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.logo-sub {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 10px;
}
.btn-wa {
  background: #25D366;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-wa:hover {
  background: #20bd5a;
}
.slicer-status { display: none; }

/* ── Orientation Controls ──────────────────────────────────── */
.orient-controls {
  margin-top: 10px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  padding: 12px 14px;
}
.orient-controls.hidden { display: none; }

.orient-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.orient-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.btn-lay-flat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #000;
  border: none;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: -0.01em;
}
.btn-lay-flat:hover { background: #e0e0e0; transform: translateY(-1px); }
.btn-lay-flat:active { transform: translateY(0); }

.orient-axes {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.orient-axis {
  display: flex;
  align-items: center;
  gap: 4px;
}
.axis-label {
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.axis-x { color: #ef4444; }
.axis-y { color: #22c55e; }
.axis-z { color: #3b82f6; }

.orient-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
}
.orient-btn:hover {
  border-color: rgba(255,255,255,0.35);
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.orient-reset {
  margin-left: auto;
  color: var(--text2);
  font-size: 11px;
}

.orient-info {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text2);
  text-align: center;
  min-height: 16px;
}
.orient-info .overhang-low { color: #22c55e; }
.orient-info .overhang-med { color: #f59e0b; }
.orient-info .overhang-high { color: #ef4444; }

/* ── Wall Count Hint ───────────────────────────────────────── */
.walls-hint {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
  min-height: 16px;
}

/* ── Lay Flat Active Mode ──────────────────────────────────── */
.btn-lay-flat.lay-flat-active {
  background: #00ff88;
  color: #000;
  animation: pulse-green 1.5s ease-in-out infinite;
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,136,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(0,255,136,0); }
}

.viewer.lay-flat-mode { cursor: crosshair !important; }

/* ── Orient Header Buttons Row ─────────────────────────────── */
.orient-header-btns {
  display: flex;
  gap: 6px;
}
.btn-pick-face {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-pick-face:hover {
  border-color: rgba(255,255,255,0.35);
  color: #fff;
}
.btn-pick-face.lay-flat-active {
  background: #00ff88;
  color: #000;
  border-color: #00ff88;
  animation: pulse-green 1.5s ease-in-out infinite;
}

/* ── Estimate Warning Banner ───────────────────────────────── */
.estimate-warning {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  margin-bottom: 14px;
}
.warning-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.warning-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}
.warning-text strong {
  color: #ef4444;
  font-weight: 700;
}
.warning-link {
  display: inline-block;
  margin-top: 6px;
  color: #25D366;
  font-weight: 600;
  text-decoration: none;
  font-size: 12px;
}
.warning-link:hover {
  color: #20bd5a;
  text-decoration: underline;
}
