/* File: [tile viewer css dir]/css/order_panel.css */
/* ============================================================================
   MachinMaps Order Panel — Slide-out customization panel
   ============================================================================ */

/* ── Toggle button (floating on map) ────────────────────────── */
.op-toggle-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 800;
  padding: 10px 20px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: background 0.2s, transform 0.1s;
}
.op-toggle-btn:hover {
  background: #16213e;
  transform: translateY(-1px);
}

/* ── Panel container ────────────────────────────────────────── */
.order-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: #fafafa;
  z-index: 900;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.order-panel.closed {
  transform: translateX(100%);
}
.order-panel.open {
  transform: translateX(0);
}

/* ── Header ─────────────────────────────────────────────────── */
.op-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #1a1a2e;
  color: #fff;
  flex-shrink: 0;
}
.op-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.op-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.op-close-btn:hover { opacity: 1; }

/* ── Scrollable body ────────────────────────────────────────── */
.op-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 20px 0;
}

/* ── Sections ───────────────────────────────────────────────── */
.op-section {
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
}
.op-section:last-child { border-bottom: none; }

.op-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  margin-bottom: 8px;
}

/* ── Inputs ─────────────────────────────────────────────────── */
.op-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}
.op-select:focus {
  outline: none;
  border-color: #1a1a2e;
}
.op-select-sm {
  width: auto;
  min-width: 100px;
}

.op-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  margin-bottom: 6px;
  box-sizing: border-box;
}
.op-input:focus {
  outline: none;
  border-color: #1a1a2e;
}
.op-input::placeholder { color: #bbb; }

.op-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 3px;
  margin-top: 6px;
}

/* ── Row layout ─────────────────────────────────────────────── */
.op-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

/* ── Radio / check labels ───────────────────────────────────── */
.op-radio-label,
.op-check-label {
  font-size: 13px;
  color: #444;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Color input ────────────────────────────────────────────── */
.op-color-input {
  width: 36px;
  height: 30px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  padding: 1px;
}

/* ── Range slider ───────────────────────────────────────────── */
.op-range {
  flex: 1;
  accent-color: #1a1a2e;
}
.op-range-val {
  font-size: 11px;
  color: #888;
  min-width: 36px;
  text-align: right;
}

/* ── Swatches ───────────────────────────────────────────────── */
.op-swatches {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}
.op-swatch {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.12);
}

/* ── Coordinates display ────────────────────────────────────── */
.op-coords {
  font-size: 14px;
  font-weight: 600;
  font-family: "SF Mono", "Fira Code", monospace;
  color: #333;
  margin-bottom: 2px;
}
.op-hint {
  font-size: 10px;
  color: #999;
}

/* ── Preview ────────────────────────────────────────────────── */
.op-preview {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

/* ── Generate button ────────────────────────────────────────── */
.op-generate-btn {
  width: 100%;
  padding: 14px;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.op-generate-btn:hover:not(:disabled) {
  background: #16213e;
  transform: translateY(-1px);
}
.op-generate-btn:disabled {
  background: #888;
  cursor: wait;
}

/* ── Status ─────────────────────────────────────────────────── */
.op-status {
  margin-top: 8px;
  font-size: 12px;
  text-align: center;
  min-height: 18px;
}
.op-status-info { color: #666; }
.op-status-ok   { color: #28a745; font-weight: 600; }
.op-status-err  { color: #dc3545; }

/* ── Downloads ──────────────────────────────────────────────── */
.op-downloads {
  margin-top: 8px;
  text-align: center;
}
.op-dl-title {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
}
.op-dl-link {
  display: inline-block;
  margin: 0 4px;
  padding: 6px 16px;
  background: #28a745;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}
.op-dl-link:hover { background: #218838; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .order-panel { width: 100vw; }
  .op-toggle-btn { right: 8px; top: 8px; padding: 8px 14px; font-size: 12px; }
}