/* ═══════════════════════════════════════════════════════════════
   LOTONE DESIGN SYSTEM — design-system.css
   Shared across dithertone · asciitone · glitchtone
   Each product sets --neon and its derived opacity vars in its
   own <style> block. This file provides everything else.
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Bebas+Neue&display=swap');

/* ─── BASE VARIABLES (structural only; --neon set per product) ─── */
:root {
  --bg: #000000;
  --panel-bg: rgba(0,0,0,0.8);
  /* per-product sets:
     --neon
     --neon-dim
     --neon-faint
     --neon-ghost
     --border
  */
}

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

/* ─── ACCESSIBILITY ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 8px 16px;
  background: var(--neon);
  color: var(--bg);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 300;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

/* ─── BODY ─── */
body {
  font-family: 'Space Mono', monospace;
  background: var(--bg);
  color: var(--neon);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── HEADER ─── */
header {
  padding: 20px 24px;
  border-bottom: 2px solid var(--neon);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}

.header-left { display: flex; flex-direction: column; }

.header-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-link {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--neon);
  text-decoration: none;
  border: 1.5px solid var(--border);
  padding: 6px 14px;
  transition: all 0.15s;
}
.nav-link:hover {
  background: var(--neon);
  color: var(--bg);
  border-color: var(--neon);
}

/* Inline <a> inside .header-nav (dithertone style) */
.header-nav a {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--neon);
  text-decoration: none;
  border: 1.5px solid var(--border);
  padding: 6px 14px;
  transition: all 0.15s;
}
.header-nav a:hover {
  background: var(--neon);
  color: var(--bg);
  border-color: var(--neon);
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 4rem;
  line-height: 1;
  letter-spacing: 0.05em;
  -webkit-text-stroke: 2px var(--neon);
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.tagline {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 4px;
}

.back-link {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--neon);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.back-link:hover { opacity: 1; }

/* ─── HAMBURGER / MOBILE MENU ─── */
.hamburger {
  display: none;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--neon);
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s;
  align-items: center;
  justify-content: center;
}
.hamburger:hover {
  background: var(--neon);
  color: var(--bg);
  border-color: var(--neon);
}

.mobile-menu {
  display: none;
  max-height: 0;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 2px solid var(--neon);
  transition: max-height 0.25s ease;
}
.mobile-menu.open { max-height: 200px; }

.mobile-menu a {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--neon);
  text-decoration: none;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: block;
  transition: background 0.15s;
}
.mobile-menu a:hover { background: var(--neon-ghost); }

/* ─── MAIN LAYOUT ─── */
.main-layout {
  display: flex;
  gap: 16px;
  padding: 16px;
  padding-bottom: 58px;
}

.col { display: flex; flex-direction: column; gap: 16px; width: 280px; flex-shrink: 0; }

.canvas-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

/* ─── PANELS ─── */
.panel {
  border: 2px solid var(--neon);
  padding: 20px;
  background: var(--panel-bg);
}

.panel-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 12px;
}

/* ─── UPLOAD ZONE ─── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 2px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: rgba(0,0,0,0.4);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.upload-zone:hover, .upload-zone.dragover, .upload-zone.drag-over {
  border-color: var(--neon);
}
.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon { font-size: 2rem; margin-bottom: 8px; }

.upload-text {
  font-size: 0.75rem;
  opacity: 0.75;
  line-height: 1.6;
}
.upload-text strong {
  display: block;
  font-size: 0.85rem;
  opacity: 1;
  margin-bottom: 4px;
  color: var(--neon);
}

.upload-zone-main {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  font-size: 1rem;
}
.upload-zone-main .upload-icon { font-size: 3rem; margin-bottom: 16px; }
.upload-zone-main .upload-text { font-size: 0.85rem; }
.upload-zone-main .upload-text strong { font-size: 1rem; margin-bottom: 6px; }

/* ─── CONTROLS ─── */
.control-group { margin-bottom: 16px; }
.control-group:last-child { margin-bottom: 0; }

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.control-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.control-val {
  font-size: 0.68rem;
  color: var(--neon);
  font-family: 'Space Mono', monospace;
  min-width: 36px;
  text-align: right;
}

/* ─── RANGE INPUT ─── */
input[type=range] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: var(--neon-faint);
  border-radius: 0;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 2px;
  background: var(--neon);
  border: none;
  cursor: pointer;
  margin-top: -8px;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--neon-faint);
  border-radius: 0;
}
input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  background: var(--neon);
  border: none;
  cursor: pointer;
}
input[type=range]::-moz-range-track {
  height: 4px;
  background: var(--neon-faint);
}

/* ─── SELECT ─── */
select {
  width: 100%;
  padding: 12px 10px;
  height: 50px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  color: var(--neon);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ffffff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
select:focus { border-color: var(--neon); }
select option { background: var(--bg); color: var(--neon); }

/* ─── BUTTONS: VIEW ─── */
.view-btn {
  padding: 8px 20px;
  border: 2px solid var(--neon);
  background: var(--bg);
  color: var(--neon);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.view-btn:hover { background: var(--neon); color: var(--bg); }
.view-btn.active { background: var(--neon); color: var(--bg); }
.view-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--border);
  background: var(--bg);
  color: var(--neon-dim);
}
.view-btn:disabled:hover { background: var(--bg); color: var(--neon-dim); }

/* ─── BUTTONS: UNDO/REDO ─── */
.undo-redo-row {
  display: flex;
  gap: 12px;
  height: 40px;
}

.undo-btn {
  flex: 1;
  padding: 8px 20px;
  border: 2px solid var(--neon);
  background: var(--bg);
  color: var(--neon);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.undo-btn:hover:not(:disabled) { background: var(--neon); color: var(--bg); }
.undo-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ─── BUTTONS: EXPORT ─── */
.export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: 56px;
}

.export-btn {
  width: 100%;
  padding: 16px;
  background: var(--neon);
  color: var(--bg);
  border: 2px solid var(--neon);
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.export-btn:hover { background: var(--bg); color: var(--neon); }
.export-btn span { position: relative; z-index: 1; }
.export-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.sec-btn {
  width: 100%;
  padding: 16px;
  background: transparent;
  color: var(--neon);
  border: 2px solid var(--border);
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.sec-btn:hover { border-color: var(--neon); }

/* ─── BUTTONS: TOGGLE ─── */
.toggle-btn {
  padding: 6px 14px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--neon);
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  margin-top: 6px;
}
.toggle-btn:hover { border-color: var(--neon); background: var(--neon-ghost); }
.toggle-btn.active { background: var(--neon); color: var(--bg); border-color: var(--neon); }

/* ─── VIEW TOGGLE ROW ─── */
.view-toggle-row {
  display: flex;
  gap: 12px;
  height: 40px;
}
.view-toggle-row .view-btn { flex: 1; }

/* ─── EXPORT FORMAT ROW ─── */
.export-format-row {
  display: flex;
  gap: 8px;
}

/* ─── CANVAS AREA ─── */
.canvas-area {
  border: 2px solid var(--neon);
  background: var(--panel-bg);
  padding: 16px;
  flex: 1;
  min-height: min(600px, calc(100vh - 340px));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, #000 0%, #0a0a0a 50%, #000 100%);
}

.canvas-wrapper {
  position: relative;
  z-index: 1;
  max-width: 100%;
}

.empty-state {
  text-align: center;
  position: relative;
  z-index: 1;
}
.empty-state .big-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 8rem;
  line-height: 1;
  -webkit-text-stroke: 2px var(--neon);
  -webkit-text-fill-color: transparent;
  opacity: 0.1;
  letter-spacing: 0.1em;
}
.empty-state .sub {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 16px;
  opacity: 0.4;
}

.img-info {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
  border: 1.5px solid var(--border);
  padding: 5px 10px;
  z-index: 10;
}

.hidden { display: none !important; }

/* ─── COMPARE VIEW ─── */
.compare-container {
  position: relative;
  cursor: col-resize;
  user-select: none;
}

.compare-original {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
}

.compare-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--neon);
  cursor: col-resize;
  z-index: 10;
}
.compare-line::before {
  content: '◄ ►';
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--neon);
  color: var(--bg);
  font-size: 0.55rem;
  padding: 4px 6px;
  white-space: nowrap;
  font-family: 'Space Mono', monospace;
}

/* ─── STATUS BAR ─── */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 42px;
  padding: 0 12px;
  background: var(--bg);
  border-top: 2px solid var(--neon);
  color: var(--neon);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-right {
  display: flex;
  gap: 24px;
  opacity: 0.6;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon);
  display: inline-block;
  animation: pulse 2s infinite;
}
.status-dot.processing {
  background: #FFD600;
  animation: blink 0.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ─── SCROLLBAR ─── */
.col::-webkit-scrollbar { width: 4px; }
.col::-webkit-scrollbar-track { background: var(--bg); }
.col::-webkit-scrollbar-thumb { background: var(--border); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .main-layout {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    padding-bottom: 58px;
  }
  .col { width: 100%; }
  .canvas-area { min-height: 50vh; }
  header { padding: 16px; }
  .logo { font-size: 2.5rem; }
  .tagline { font-size: 0.55rem; letter-spacing: 0.2em; }
  .empty-state .big-text { font-size: 5rem; }
}

@media (max-width: 768px) {
  .export-row { grid-template-columns: 1fr; height: auto; }
  .view-btn { padding: 6px 12px; font-size: 0.65rem; }
  .header-nav { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: block; }

  .status-bar {
    height: auto;
    min-height: 36px;
    padding: 6px 12px;
    flex-wrap: wrap;
    font-size: 0.58rem;
    gap: 2px 0;
  }
  .status-left {
    width: 100%;
    gap: 8px;
  }
  .status-right {
    width: 100%;
    gap: 10px;
    font-size: 0.52rem;
  }
}
