/* ============================================
   Design Export Studio — Shared Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

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

body {
  background: #0a0a0c;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #B4B4BD;
  min-height: 100vh;
}

/* ---- Nav Bar ---- */

.studio-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 max(24px, calc((100vw - 1080px) / 2));
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.studio-nav .nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 12px;
  flex-shrink: 0;
}

.studio-nav .nav-logo svg { width: 40px; height: 40px; }

.studio-nav .nav-title {
  font-size: 14px;
  font-weight: 600;
  color: #FAFAFA;
  letter-spacing: -0.01em;
}

.studio-nav .nav-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #3F3F46;
  margin-left: 8px;
}

.studio-nav .nav-breadcrumb a {
  color: #70707B;
  text-decoration: none;
  transition: color 0.15s;
}

.studio-nav .nav-breadcrumb a:hover { color: #818CF8; }

.studio-nav .nav-breadcrumb .current { color: #B4B4BD; }

.studio-nav .nav-spacer { flex: 1; }

.studio-nav .nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #3F3F46;
  letter-spacing: 0.02em;
}

.studio-nav .nav-status .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3F3F46;
  transition: background 0.3s;
}

.studio-nav .nav-status .status-dot.online { background: #00c875; }
.studio-nav .nav-status .status-dot.offline { background: #df2f4a; }

/* ---- Page Layout ---- */

.studio-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 80px;
}

.studio-page h1 {
  font-size: 28px;
  font-weight: 700;
  color: #FAFAFA;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 1080px;
}

.hero-brand .hero-lockup {
  display: flex;
  align-items: center;
  gap: 28px;
}

.hero-brand .hero-mark-wrap {
  position: relative;
  flex-shrink: 0;
}

.hero-brand .hero-mark-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.22) 0%, rgba(99,102,241,0.08) 40%, transparent 70%);
  pointer-events: none;
}

.hero-brand .hero-mark {
  position: relative;
  z-index: 1;
}

.hero-brand .hero-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-brand .hero-title {
  font-size: 64px;
  font-weight: 700;
  color: #FAFAFA;
  letter-spacing: -3px;
  line-height: 1;
}

.hero-brand .hero-sub {
  font-size: 16px;
  font-weight: 500;
  color: #6366F1;
  letter-spacing: 5px;
  margin-left: 4px;
  text-transform: uppercase;
  line-height: 1;
}

.studio-page .page-subtitle {
  font-size: 14px;
  color: #70707B;
  margin-bottom: 40px;
  width: 100%;
  max-width: 1080px;
}

.studio-page .page-subtitle .count {
  color: #3F3F46;
  margin-left: 4px;
}

/* ---- Search ---- */

.search-bar {
  width: 100%;
  max-width: 1080px;
  margin-bottom: 24px;
  position: relative;
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #3F3F46;
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #FAFAFA;
  background: #111114;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
}

.search-bar input::placeholder { color: #3F3F46; }

.search-bar input:focus {
  border-color: rgba(99,102,241,0.3);
}

.card.card-hidden { display: none; }

/* ---- Card Grid ---- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1080px;
}

.card { min-height: 140px; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 24px;
  background: #111114;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: rgba(99,102,241,0.3);
  background: #141418;
  transform: translateY(-2px);
}

.card .card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card .card-icon { color: #818CF8; flex-shrink: 0; }

.card .card-info { display: flex; flex-direction: column; gap: 2px; }

.card .card-name {
  font-size: 16px;
  font-weight: 600;
  color: #FAFAFA;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card .card-meta {
  font-size: 12px;
  color: #3F3F46;
}

.card .card-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card .card-file-tag {
  font-size: 11px;
  color: #70707B;
  padding: 3px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 4px;
}

.card.card-empty {
  border-style: dashed;
  border-color: rgba(255,255,255,0.04);
  opacity: 0.6;
}

.card.card-empty:hover {
  opacity: 0.8;
  border-color: rgba(255,255,255,0.08);
  transform: none;
}

.card .card-delete {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(223,47,74,0.1);
  color: #df2f4a;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
}

.card:hover .card-delete { display: flex; }
.card .card-delete:hover { background: rgba(223,47,74,0.25); }

.card.card-new {
  border-style: dashed;
  border-color: rgba(99,102,241,0.2);
  cursor: pointer;
}

.card.card-new:hover {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.06);
}

.card.card-new .card-icon { color: #6366F1; }

/* ---- Sort Bar ---- */

.sort-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 1080px;
  margin-bottom: 16px;
}

.sort-bar .sort-label {
  font-size: 11px;
  color: #3F3F46;
  margin-right: 8px;
}

.sort-bar .sort-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #3F3F46;
  cursor: pointer;
  transition: all 0.15s;
}

.sort-bar .sort-btn:hover {
  color: #B4B4BD;
  background: rgba(255,255,255,0.04);
}

.sort-bar .sort-btn.active {
  background: rgba(99,102,241,0.12);
  color: #818CF8;
}

/* ---- Pagination ---- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  font-size: 13px;
  color: #70707B;
}

.pagination .page-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: #70707B;
  cursor: pointer;
  transition: all 0.15s;
}

.pagination .page-btn:hover {
  background: rgba(255,255,255,0.04);
  color: #FAFAFA;
  border-color: rgba(255,255,255,0.12);
}

.pagination .page-btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.pagination .page-btn.active {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.25);
  color: #818CF8;
}

.pagination .page-info {
  padding: 0 8px;
  color: #3F3F46;
  font-size: 12px;
}

/* ---- Empty State ---- */

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 24px;
  text-align: center;
}

.empty-state .empty-icon { color: #27272A; }

.empty-state .empty-title {
  font-size: 15px;
  font-weight: 500;
  color: #70707B;
}

.empty-state .empty-hint {
  font-size: 13px;
  color: #27272A;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
}

/* ---- Design Page ---- */

.design-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 80px;
  background: var(--studio-bg, #0a0a0c);
  transition: background 0.2s ease;
}

.design-heading {
  font-size: 14px;
  font-weight: 600;
  color: #FAFAFA;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.design-subtitle {
  font-size: 13px;
  color: #3F3F46;
  margin-bottom: 24px;
}

.design-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3F3F46;
  margin-top: 48px;
  margin-bottom: 12px;
}

/* ---- Artboard Frame ---- */

.artboard-scroll {
  width: 100%;
  overflow-x: auto;
}

.artboard-scroll {
  padding-bottom: 12px;
}

.artboard-scroll::-webkit-scrollbar {
  height: 6px;
}

.artboard-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.artboard-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, #27272A);
  border-radius: 3px;
}

.artboard-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-hover, #3F3F46);
}

.artboard {
  position: relative;
  overflow: hidden;
  zoom: var(--studio-zoom, 1);
  margin: 0 auto;
  width: fit-content;
}

/* ---- Zoom Controls ---- */

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 2px;
}

.zoom-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #70707B;
  cursor: pointer;
  transition: all 0.15s;
}

.zoom-btn:hover {
  color: #B4B4BD;
  background: rgba(255,255,255,0.04);
}

.zoom-btn.active {
  background: rgba(99,102,241,0.15);
  color: #818CF8;
}

/* ---- Background Swatches ---- */

.bg-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bg-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s;
  padding: 0;
  outline: none;
}

.bg-swatch:hover {
  border-color: rgba(255,255,255,0.25);
}

.bg-swatch.active {
  border-color: #818CF8;
}

.bg-swatch-dark { background: #0a0a0c; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.bg-swatch-mid { background: #27272A; }
.bg-swatch-light { background: #D4D4D8; }
.bg-swatch-white { background: #FFFFFF; }

/* ---- View Controls (zoom + bg together) ---- */

.view-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.view-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.06);
}

/* ---- Controls / Toolbar ---- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #111114;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}

.toolbar .toolbar-spacer { flex: 1; }

.btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #B4B4BD;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.15);
  color: #FAFAFA;
}

.btn.active {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.25);
  color: #818CF8;
}

.btn-primary {
  background: #6366F1;
  border-color: #6366F1;
  color: #FAFAFA;
  font-weight: 600;
}

.btn-primary:hover {
  background: #5558E6;
  border-color: #5558E6;
  color: #FAFAFA;
}

.btn-primary.running {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

.btn-primary svg { width: 14px; height: 14px; }

/* ---- Toast Notifications ---- */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  min-width: 340px;
  max-width: 480px;
  background: #18181B;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  font-size: 13px;
  color: #B4B4BD;
  pointer-events: auto;
  animation: toast-in 0.3s ease;
  border-left: 3px solid #3F3F46;
}

.toast.toast-loading { border-left-color: #818CF8; }
.toast.toast-success { border-left-color: #00c875; }
.toast.toast-error   { border-left-color: #df2f4a; }

.toast .toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.toast.toast-loading .toast-icon { color: #818CF8; }
.toast.toast-success .toast-icon { color: #00c875; }
.toast.toast-error   .toast-icon { color: #df2f4a; }

.toast .toast-text { flex: 1; line-height: 1.4; }
.toast .toast-text strong { color: #FAFAFA; font-weight: 600; }

.toast .toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #3F3F46;
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  line-height: 1;
}

.toast .toast-close:hover { color: #70707B; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* ---- Spinner ---- */

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

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(129,140,248,0.2);
  border-top-color: #818CF8;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

/* ---- Footer ---- */

/* ---- Footer ---- */

.studio-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: auto;
  padding: 64px 24px 32px;
  font-size: 12px;
  color: #70707B;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.studio-footer a {
  color: #70707B;
  text-decoration: none;
  transition: color 0.15s;
}

.studio-footer a:hover { color: #818CF8; }

.studio-footer > svg { display: none; }

.studio-footer .footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #3F3F46;
}

/* ---- Assets Modal ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: #111114;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  width: 800px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.modal-overlay.visible .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #FAFAFA;
  flex: 1;
}

.modal-close {
  background: none;
  border: none;
  color: #3F3F46;
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.modal-close:hover {
  color: #FAFAFA;
  background: rgba(255,255,255,0.04);
}

.modal-sort {
  display: flex;
  gap: 4px;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.modal-sort .sort-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #3F3F46;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-sort .sort-btn:hover {
  color: #B4B4BD;
  background: rgba(255,255,255,0.04);
}

.modal-sort .sort-btn.active {
  background: rgba(99,102,241,0.12);
  color: #818CF8;
}

.modal-search {
  padding: 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.modal-search input {
  width: 100%;
  padding: 8px 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: #FAFAFA;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}

.modal-search input::placeholder { color: #3F3F46; }
.modal-search input:focus { border-color: rgba(99,102,241,0.3); }

.modal-body {
  overflow-y: auto;
  padding: 12px;
  flex: 1;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.asset-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.asset-item:hover {
  background: rgba(255,255,255,0.04);
}

.asset-item .asset-delete {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: rgba(223,47,74,0.15);
  color: #df2f4a;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}

.asset-item:hover .asset-delete { display: flex; align-items: center; justify-content: center; }
.asset-item .asset-delete:hover { background: rgba(223,47,74,0.3); }

.asset-preview {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
}

.asset-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.asset-preview .file-icon {
  color: #3F3F46;
}

.asset-name {
  font-size: 11px;
  color: #B4B4BD;
  word-break: break-all;
  line-height: 1.3;
}

.asset-size {
  font-size: 10px;
  color: #3F3F46;
}

.asset-empty {
  padding: 48px 24px;
  text-align: center;
  color: #3F3F46;
  font-size: 13px;
}

.asset-copied {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #18181B;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  color: #00c875;
  z-index: 400;
  animation: toast-in 0.2s ease;
}

/* ---- Light Background Overrides ---- */

.light-bg .design-heading { color: #18181B; }
.light-bg .design-subtitle { color: #71717A; }
.light-bg .design-label { color: #71717A; }

.light-bg .toolbar {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.08);
}

.light-bg .btn:not(.btn-primary) {
  border-color: rgba(0,0,0,0.12);
  color: #3F3F46;
}

.light-bg .btn:not(.btn-primary):hover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.18);
  color: #18181B;
}

.light-bg .zoom-controls {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.08);
}

.light-bg .zoom-btn { color: #71717A; }
.light-bg .zoom-btn:hover { color: #18181B; background: rgba(0,0,0,0.06); }
.light-bg .zoom-btn.active { background: rgba(99,102,241,0.12); color: #6366F1; }

.light-bg .view-divider { background: rgba(0,0,0,0.1); }

.light-bg .bg-swatch-dark { box-shadow: none; }
.light-bg .bg-swatch-white { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }

.light-bg { --scrollbar-thumb: #B4B4BD; --scrollbar-hover: #8B8B96; }
