/* ============================================================
   NOVAGRAVE AI DESIGN STUDIO — CSS
   ============================================================ */

:root {
  --gold: #C8860A;
  --gold-light: #E8A020;
  --gold-dim: rgba(200,134,10,0.15);
  --black: #0D0D0D;
  --surface: #141414;
  --surface2: #1C1C1C;
  --surface3: #242424;
  --border: rgba(255,255,255,0.07);
  --text: #E0E0E0;
  --muted: #888;
  --radius: 8px;
}

#ng-studio {
  background: var(--black);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  padding: 32px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* HEADER */
.ng-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.ng-studio-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ng-studio-title h1 {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  color: #fff;
  margin: 0;
}

.ng-spark { color: var(--gold); font-size: 20px; }

.ng-badge-beta {
  background: var(--gold-dim);
  border: 1px solid rgba(200,134,10,0.4);
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
}

.ng-free-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
}

#ng-free-remaining {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  color: var(--gold);
  font-weight: 600;
}

.ng-free-label { font-size: 12px; color: var(--muted); }

/* TYPE SELECTOR */
.ng-type-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.ng-type-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text);
}

.ng-type-btn:hover,
.ng-type-btn.active {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.ng-type-icon { font-size: 24px; }
.ng-type-name { font-size: 13px; font-weight: 500; color: #fff; }
.ng-type-price { font-size: 12px; color: var(--gold); }

/* STUDIO BODY */
.ng-studio-body {
  display: grid;
  grid-template-columns: 240px 1fr 220px;
  gap: 20px;
  align-items: start;
}

/* PANELS */
.ng-panel-left,
.ng-panel-right {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ng-panel-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* SECTION LABELS */
.ng-section-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* TRENDS */
.ng-trends-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ng-trend-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s;
  line-height: 1.4;
}

.ng-trend-item:hover { border-color: var(--gold); color: #fff; }
.ng-trend-loading { font-size: 12px; color: var(--muted); }

/* SELECT */
.ng-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
}

/* STYLE GRID */
.ng-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ng-style-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.ng-style-btn:hover,
.ng-style-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

/* REFRESH BTN */
.ng-refresh-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.ng-refresh-btn:hover { color: var(--gold); }

/* CHECKBOX */
.ng-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.ng-checkbox-label input { accent-color: var(--gold); }

/* UPLOAD ZONE */
.ng-upload-zone {
  border: 2px dashed rgba(200,134,10,0.3);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}

.ng-upload-zone:hover { border-color: var(--gold); }

.ng-upload-icon { font-size: 28px; display: block; margin-bottom: 8px; }

.ng-upload-inner p {
  font-size: 12px;
  color: var(--text);
  margin: 4px 0;
}

.ng-upload-hint { color: var(--muted) !important; font-size: 11px !important; }

/* PROMPT AREA */
.ng-prompt-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.ng-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ng-prompt-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 12px;
  font-size: 14px;
  resize: vertical;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  box-sizing: border-box;
}

.ng-prompt-textarea:focus {
  outline: none;
  border-color: rgba(200,134,10,0.5);
}

.ng-prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.ng-char-count { font-size: 11px; color: var(--muted); }

.ng-enhance-btn {
  background: var(--gold-dim);
  border: 1px solid rgba(200,134,10,0.4);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.ng-enhance-btn:hover { background: var(--gold); color: #000; }

.ng-enhanced-badge {
  font-size: 11px;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 2px 8px;
  border-radius: 10px;
}

/* GENERATE BUTTON */
.ng-generate-btn {
  width: 100%;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s;
}

.ng-generate-btn:hover { background: var(--gold-light); }
.ng-generate-btn:disabled { background: #444; color: #888; cursor: not-allowed; }

.ng-generate-icon { font-size: 20px; }

/* RESULT AREA */
.ng-result-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* LOADING */
.ng-loading {
  padding: 48px;
  text-align: center;
}

.ng-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: ng-spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes ng-spin { to { transform: rotate(360deg); } }

#ng-loading-text {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 16px;
}

.ng-loading-steps {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.ng-step {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.ng-step.active {
  color: var(--gold);
  border-color: rgba(200,134,10,0.4);
  background: var(--gold-dim);
}

/* PREVIEW */
.ng-preview-container { padding: 20px; }

.ng-preview-wrapper {
  position: relative;
  display: block;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 20px;
  display: block;
}

#ng-preview-img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  filter: none;
  min-height: 200px;
  background: var(--surface2);
}

#ng-preview-img[src=""] {
  display: none;
}

#ng-preview-img.ng-blurred { filter: none; opacity: 1; }

.ng-watermark-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  pointer-events: none;
  background: rgba(0,0,0,0.05);
}

.ng-watermark-overlay span {
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  transform: rotate(-25deg);
  white-space: nowrap;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* BUY OPTIONS */
.ng-preview-note {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 16px;
}

.ng-buy-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.ng-buy-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  text-align: center;
}

.ng-buy-card.featured { border-color: var(--gold); }

.ng-buy-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.ng-buy-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.ng-buy-price {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  color: #fff;
  margin-bottom: 12px;
}

.ng-buy-save {
  font-size: 11px;
  color: var(--gold);
  font-family: 'Inter', sans-serif;
}

.ng-buy-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
}

.ng-buy-features li {
  font-size: 12px;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ng-buy-features li::before { content: '✓'; color: var(--gold); font-size: 11px; }

.ng-buy-btn {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(200,134,10,0.5);
  color: var(--gold);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ng-buy-btn:hover,
.ng-buy-btn.featured { background: var(--gold); color: #000; border-color: var(--gold); }

.ng-email-field { margin-top: 12px; }

.ng-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 13px;
  box-sizing: border-box;
}

.ng-input:focus { outline: none; border-color: rgba(200,134,10,0.5); }

/* DOWNLOAD BUTTONS */
.ng-download-success {
  text-align: center;
  padding: 12px;
  background: rgba(39,174,96,0.1);
  border: 1px solid rgba(39,174,96,0.3);
  border-radius: 6px;
  color: #2ecc71;
  font-size: 14px;
  margin-bottom: 16px;
}

.ng-download-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ng-download-btn {
  display: block;
  text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 8px;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  transition: border-color 0.2s;
}

.ng-download-btn:hover { border-color: var(--gold); color: var(--gold); }

/* REGEN BUTTON */
.ng-regen-btn {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
}

.ng-regen-btn:hover { border-color: var(--gold); color: var(--gold); }

/* LIBRARY */
.ng-library-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.ng-library-empty {
  grid-column: 1/-1;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.ng-library-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.ng-library-item:hover { border-color: var(--gold); }

.ng-library-item img { width: 100%; display: block; }

.ng-library-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 9px;
  background: rgba(0,0,0,0.8);
  color: var(--gold);
  padding: 2px 6px;
  border-radius: 4px;
}

/* MODAL */
.ng-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.ng-modal-box {
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  position: relative;
}

.ng-modal-icon { font-size: 48px; margin-bottom: 16px; }

.ng-modal-box h2 {
  font-family: 'Cinzel', serif;
  color: #fff;
  margin-bottom: 12px;
}

.ng-modal-box p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.ng-modal-options { display: flex; gap: 12px; justify-content: center; }

.ng-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

/* RESPONSIVE */
@media (max-width: 1100px) {
  .ng-studio-body { grid-template-columns: 200px 1fr; }
  .ng-panel-right { display: none; }
}

@media (max-width: 768px) {
  .ng-studio-body { grid-template-columns: 1fr; }
  .ng-panel-left { order: 2; }
  .ng-panel-center { order: 1; }
  .ng-type-selector { flex-wrap: wrap; }
  .ng-buy-options { grid-template-columns: 1fr; }
  .ng-download-buttons { grid-template-columns: 1fr; }
}

/* No blur on preview — watermark is enough protection */
.ng-blurred {
  filter: none !important;
}

/* ── Design Preview Modal ── */
.ng-design-modal-box {
  max-width: 560px;
  width: 90vw;
  padding: 20px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.ng-design-modal-img-wrap {
  width: 100%;
  max-height: 45vh;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--surface2);
}

.ng-design-modal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ng-design-modal-badge {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.ng-design-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ng-download-btn-gold {
  background: var(--gold) !important;
  color: #000 !important;
  font-weight: 700;
}

.ng-download-btn-gold:hover {
  opacity: 0.85;
}

/* ── DXF Download Button (Laser Export) ─────────────────────── */
.ng-btn-laser {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #00d4ff;
    border: 1px solid #00d4ff;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.ng-btn-laser:hover {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.ng-btn-laser small {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 400;
}

/* Download buttons group */
.ng-download-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

/* ── Layered SVG Layer Info Box ─────────────────────────────── */
.ng-layer-info-box {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 100%);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 12px;
    text-align: center;
}

.ng-layer-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.ng-layer-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.ng-layer-chip {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    opacity: 0.95;
}

.ng-layer-compat {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.3px;
}

.ng-type-badge {
    font-size: 9px;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.ng-download-laser {
    background: linear-gradient(135deg, #1a1a2e 0%, #0a0a1a 100%);
    color: #00d4ff;
    border: 1px solid #00d4ff;
}

.ng-download-laser:hover {
    background: #00d4ff;
    color: #000;
}
