/*
Theme Name: The Deep Converter
Theme URI: https://example.com/the-deep-converter
Author: RebelHW
Author URI: https://example.com
Description: Image-to-STL lithophane converter with real binary STL generation. Ocean-inspired dark UI.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: deep-converter
Tags: one-page, dark, converter, 3d-printing
*/

/* ── Reset & Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: hsl(213, 40%, 8%);
  --fg: hsl(205, 60%, 85%);
  --card: hsl(213, 35%, 12%);
  --card-fg: hsl(205, 60%, 85%);
  --primary: hsl(199, 90%, 48%);
  --primary-fg: hsl(213, 40%, 6%);
  --secondary: hsl(213, 30%, 18%);
  --secondary-fg: hsl(205, 50%, 75%);
  --muted: hsl(213, 25%, 16%);
  --muted-fg: hsl(210, 20%, 45%);
  --border: hsl(213, 30%, 20%);
  --input: hsl(213, 30%, 15%);
  --highlight: hsl(45, 90%, 55%);
  --surface: hsl(213, 35%, 10%);
  --console-bg: hsl(213, 40%, 7%);
  --drop-bg: hsl(213, 35%, 14%);
  --radius: 0.625rem;
  --shadow-glow: 0 0 20px hsla(199, 90%, 48%, 0.15);
  --shadow-card: 0 8px 32px hsla(213, 40%, 4%, 0.6);
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', sans-serif;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* ── Card ── */
.converter-card {
  width: 100%;
  max-width: 72rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ── Header ── */
.deep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.deep-header .title-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.deep-header h1 {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.025em;
}
.deep-header .badge {
  display: none;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--secondary);
  color: var(--muted-fg);
}
@media (min-width: 640px) { .deep-header .badge { display: inline; } }

.deep-header .pay-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: hsla(45, 90%, 55%, 0.15);
  border: 1px solid hsla(45, 90%, 55%, 0.3);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--highlight);
  font-weight: 500;
}
.pay-tag .price { font-weight: 700; }

/* ── Grid ── */
.grid-main {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .grid-main { grid-template-columns: 1fr 1fr; }
  .grid-main > .control-panel { border-right: 1px solid var(--border); }
}
.control-panel, .preview-panel { padding: 1.25rem; }

/* ── Section labels ── */
.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: hsla(199, 90%, 48%, 0.6);
  margin-bottom: 0.5rem;
}

/* ── Drop Zone ── */
.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  background: hsla(213, 35%, 14%, 0.5);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: hsla(199, 90%, 48%, 0.5);
  background: var(--drop-bg);
}
.drop-zone.dragging { border-color: var(--primary); background: hsla(199, 90%, 48%, 0.1); }
.drop-zone svg { width: 2rem; height: 2rem; stroke: hsla(199, 90%, 48%, 0.6); fill: none; stroke-width: 2; }
.drop-zone .drop-text { margin: 10px 0 16px; color: hsla(199, 90%, 48%, 0.7); font-size: 0.875rem; }
.drop-zone input[type="file"] { display: none; }
.file-label {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 6px;
  background: var(--secondary);
  color: var(--secondary-fg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s;
}
.file-label:hover { background: hsla(213, 30%, 18%, 0.8); }
.file-name {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-fg);
}

/* ── Quality Panel ── */
.quality-panel {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 1rem;
}
.quality-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.quality-header h3 {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}
.chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--secondary);
  color: var(--muted-fg);
}
.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  position: relative;
}
.quality-option {
  position: relative;
  border-radius: 6px;
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-mono);
}
.quality-option:hover:not(.locked) { border-color: hsla(199, 90%, 48%, 0.4); }
.quality-option.selected {
  border-color: var(--primary);
  background: hsla(199, 90%, 48%, 0.1);
  box-shadow: 0 0 12px hsla(199, 90%, 48%, 0.2);
}
.quality-option.locked { opacity: 0.6; cursor: not-allowed; border-color: hsla(213, 30%, 20%, 0.5); background: hsla(213, 25%, 16%, 0.3); }
.qual-name { font-size: 12px; font-weight: 700; color: var(--fg); }
.quality-option.selected .qual-name { color: var(--primary); }
.qual-desc { font-size: 10px; color: var(--muted-fg); margin-top: 2px; }
.lock-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  color: var(--highlight);
  display: flex;
  align-items: center;
  gap: 4px;
}

.paywall-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.paywall-overlay .price { display: none; }
.paywall-overlay button {
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--highlight);
  color: var(--primary-fg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px hsla(45, 90%, 55%, 0.3);
  transition: filter 0.2s;
}
.paywall-overlay button:hover { filter: brightness(1.1); }
.paywall-overlay.hidden { display: none; }

/* ── Params ── */
.param-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.param-item {
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}
.param-item label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-fg);
  margin-bottom: 2px;
}
.param-item .value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* ── Action Buttons ── */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
}
.btn-primary, .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  flex: 1;
  background: var(--primary);
  color: var(--primary-fg);
  animation: pulse-glow 2s ease-in-out infinite;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-secondary { background: var(--secondary); color: var(--secondary-fg); }
.btn-secondary:hover:not(:disabled) { background: hsla(213, 30%, 18%, 0.8); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; animation: none; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px hsla(199, 90%, 48%, 0.2); }
  50% { box-shadow: 0 0 20px hsla(199, 90%, 48%, 0.4); }
}

/* ── Image Preview ── */
.image-preview-box {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.image-preview-box img { width: 100%; height: 100%; object-fit: contain; }
.image-preview-box .placeholder { color: var(--muted-fg); font-family: var(--font-mono); font-size: 14px; }

/* ── STL Console ── */
.stl-console {
  border-radius: var(--radius);
  background: var(--console-bg);
  border: 1px solid var(--border);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 120px;
  overflow: auto;
  color: hsla(199, 90%, 48%, 0.8);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.stl-console .empty { color: var(--muted-fg); }

/* ── Footer ── */
.footnote {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-fg);
  text-align: center;
  padding-top: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .control-panel { border-bottom: 1px solid var(--border); }
  body { padding: 1rem; }
}
