/* ===================== DRAFTNEXUS GLOBAL THEME ===================== */

:root {
  --bg-main: #050608;
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --bg-elevated-strong: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --accent: #33ff66;
  --accent-soft: rgba(51, 255, 102, 0.2);
  --accent-strong: #1eff55;
  --text-primary: #f3f3f3;
  --text-muted: #a0a4b0;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.6);
  --radius-lg: 18px;
  --radius-md: 12px;
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.25s ease-out;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, #1a2937 0, #050608 40%),
    radial-gradient(circle at bottom right, #10161f 0, #050608 55%);
  background-color: #050608;
  overflow: hidden;
}

/* ===================== APP SHELL ===================== */

.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ===================== SIDEBAR ===================== */

.sidebar__logo-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__logo-link:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  transition: 0.2s ease;
}

.sidebar {
  width: 260px;
  background: radial-gradient(circle at top, #182230 0, #07090f 40%, #050608 90%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 12px 0 30px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  padding: 18px;
  position: relative;
  z-index: 2;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.sidebar__logo-orb {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffffff 0, #33ff66 24%, #0c3b0f 40%, #020305 75%);
  box-shadow:
    0 0 18px rgba(51, 255, 102, 0.65),
    0 0 40px rgba(51, 255, 102, 0.2);
}

.sidebar__logo-text-main {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar__logo-text-sub {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.18em;
}

.sidebar__section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin: 10px 0 8px;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav__item {
  margin-bottom: 6px;
}

.sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.sidebar-nav__link span.icon {
  width: 22px;
  display: flex;
  justify-content: center;
  font-size: 15px;
}

.sidebar-nav__link span.label {
  flex: 1;
  text-align: left;
}

/* Optional “active” class we can wire later with Jinja */
.sidebar-nav__link--active {
  background:
    radial-gradient(circle at 0 0, rgba(51, 255, 102, 0.22), transparent 65%),
    rgba(255, 255, 255, 0.03);
  border-color: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.7),
    0 0 18px rgba(51, 255, 102, 0.5);
  transform: translateY(-1px);
}

.sidebar-nav__link:hover:not(.sidebar-nav__link--active) {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  color: #e0e4f3;
  transform: translateY(-0.5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.sidebar-nav__link--disabled {
  opacity: 0.55;
  cursor: default;
}

.sidebar-nav__link--disabled:hover {
  background: none;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  color: var(--text-muted);
}

.sidebar__footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

.sidebar__footer span {
  display: block;
}

.sidebar__footer span.highlight {
  color: var(--accent);
  font-weight: 500;
}

/* ===================== MAIN AREA ===================== */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 22px 18px 22px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  backdrop-filter: blur(26px);
}

/* Header / title bar reused everywhere */
.main__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.main__title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.main__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.main__title-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(51, 255, 102, 0.55);
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.main__subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.status-chip {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3bd46b;
  box-shadow: 0 0 7px rgba(59, 212, 107, 0.7);
}

/* ===================== CONTENT GRID + CARDS ===================== */

.main__content {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.card {
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 16px 18px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top left, rgba(51, 255, 102, 0.08), transparent 60%);
  opacity: 0.9;
}

.card__header {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
}

.card__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.card__subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.card__body {
  position: relative;
  z-index: 1;
}

/* ===================== UPLOAD FORM (SVG PAGE) ===================== */

form#uploadForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label span.right-note {
  font-size: 11px;
  color: rgba(160, 164, 176, 0.9);
}

input[type="file"] {
  font-size: 12px;
  color: var(--text-muted);
}

input[type="file"]::file-selector-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  margin-right: 10px;
  cursor: pointer;
  font-size: 11px;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

input[type="file"]::file-selector-button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-0.5px);
}

input[type="file"]::file-selector-button:active {
  transform: translateY(0);
}

input[type="file"] {
  padding: 6px 0;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(2, 3, 6, 0.9);
}

input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(3, 4, 8, 0.9);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

input[type="number"]::placeholder {
  color: rgba(160, 164, 176, 0.6);
}

input[type="number"]:focus {
  border-color: rgba(51, 255, 102, 0.8);
  box-shadow: 0 0 0 1px rgba(51, 255, 102, 0.55);
  background: rgba(4, 8, 10, 0.96);
}

button[type="submit"] {
  margin-top: 6px;
  align-self: flex-start;
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  background: radial-gradient(circle at 20% 0, #63ff94, #28d85d 40%, #08a73d 100%);
  color: #020305;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(51, 255, 102, 0.7);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    filter var(--transition-med);
}

button[type="submit"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  transform: translateX(-130%);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.4s ease-out,
    transform 0.4s ease-out;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.95),
    0 0 22px rgba(51, 255, 102, 0.9);
  filter: brightness(1.02);
}

button[type="submit"]:hover::after {
  opacity: 1;
  transform: translateX(130%);
}

button[type="submit"]:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.85);
}

.button-icon {
  font-size: 15px;
}

/* Status message under upload form */
#statusMessage {
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent-strong);
  min-height: 16px;
}

/* ===================== PREVIEW PANEL (SVG PAGE) ===================== */

.preview-card {
  display: flex;
  flex-direction: column;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.preview-toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: rgba(3, 4, 8, 0.9);
}

#previewWrapper {
  position: relative;
  flex: 1;
  min-height: 260px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background:
    radial-gradient(circle at top left, rgba(51, 255, 102, 0.15), transparent 55%),
    rgba(5, 8, 10, 0.96);
  overflow: hidden;
  display: none;
}

#previewCanvas {
  width: 100%;
  height: 100%;
  cursor: grab;
  display: block;
}

#recenterBtn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(3, 4, 8, 0.92);
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

#recenterBtn:hover {
  background: rgba(7, 11, 18, 0.98);
  border-color: rgba(51, 255, 102, 0.7);
  transform: translateY(-0.5px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.9);
}

#recenterBtn:active {
  transform: translateY(0.5px);
  box-shadow: none;
}

/* ===================== DASHBOARD-SPECIFIC STUFF ===================== */

.orb-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.7;
  animation: floatOrb 14s ease-in-out infinite alternate;
}

.orb--1 {
  width: 260px;
  height: 260px;
  top: -60px;
  left: 120px;
  background: radial-gradient(circle, #33ff66 0%, #0b3a21 65%, transparent 100%);
}

.orb--2 {
  width: 320px;
  height: 320px;
  bottom: -120px;
  right: 60px;
  background: radial-gradient(circle, #33ffc4 0%, #063540 60%, transparent 100%);
  animation-delay: 1.8s;
}

.orb--3 {
  width: 200px;
  height: 200px;
  top: 40%;
  left: 55%;
  background: radial-gradient(circle, #6bff55 0%, #264014 60%, transparent 100%);
  animation-delay: 3.2s;
}

@keyframes floatOrb {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.dashboard-content {
  position: relative;
  z-index: 1;
}

.dashboard-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
}

.dash-btn {
  flex: 0 1 260px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 5, 7, 0.9);
  text-decoration: none;
  color: var(--text-primary);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med),
    background-color var(--transition-med);
}

.dash-btn__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dash-btn__subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.dash-btn:hover {
  transform: translateY(-3px);
  border-color: var(--accent-soft);
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.9),
    0 0 20px rgba(51, 255, 102, 0.45);
  background: rgba(5, 10, 12, 0.98);
}

/* ===================== GENERIC PAGE HELPERS (UDT / TAGGEN) ===================== */

.page-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

.page-container {
  margin-top: 8px;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .sidebar__footer {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex: 1;
    justify-content: center;
  }

  .sidebar-nav__link {
    padding: 6px 10px;
  }

  .main {
    padding: 12px;
  }

  .main__content {
    grid-template-columns: 1fr;
  }

  .dashboard-buttons {
    flex-direction: column;
  }
}

.orb-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
}

.dashboard-content {
    position: relative;
    z-index: 10;
    padding: 20px 28px;
}

.dashboard-hero {
    padding: 28px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(51, 255, 102, 0.15);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.55),
                0 0 22px rgba(51, 255, 102, 0.22);
    backdrop-filter: blur(16px);
    margin-bottom: 28px;
}

.dashboard-tools {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.dashboard-card {
    flex: 1;
    padding: 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
    text-decoration: none;
    color: var(--text-primary);
    transition: 0.25s ease;
}

.dashboard-card:hover {
    border-color: rgba(51, 255, 102, 0.4);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.75),
                0 0 24px rgba(51, 255, 102, 0.5);
    transform: translateY(-3px);
    cursor: pointer;
}

.dashboard-card__title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
}

.dashboard-card__desc {
    font-size: 13px;
    color: var(--text-muted);
}
.orb-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 1; /* full brightness */
}

.dashboard-content {
    position: relative;
    z-index: 10;
    padding: 24px 32px;
}

/* Darker, more solid hero box */
.dashboard-hero {
    padding: 32px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.55); /* darker to prevent orb bleed-through */
    border: 1px solid rgba(51, 255, 102, 0.25);
    box-shadow:
        0 0 30px rgba(0, 0, 0, 0.6),
        0 0 22px rgba(51, 255, 102, 0.3);
    backdrop-filter: blur(16px);
    margin-bottom: 32px;
}

/* Tool cards - darker + more readable */
.dashboard-card {
    flex: 1;
    padding: 24px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.45); /* way more visible text */
    border: 1px solid rgba(51, 255, 102, 0.12);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.7),
        0 0 18px rgba(51, 255, 102, 0.15);
    text-decoration: none;
    color: var(--text-primary);
    transition: 0.25s ease;
}

.dashboard-card:hover {
    background: rgba(0, 0, 0, 0.60);
    border-color: rgba(51, 255, 102, 0.35);
    transform: translateY(-3px);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.85),
        0 0 30px rgba(51, 255, 102, 0.4);
}



