/* ==========================================================================
   ALTAPIXELS DECK STUDIO — Multi-Client Proposal Deck Builder & PDF Exporter
   ========================================================================== */

:root {
  --bg: #09090b;
  --sidebar: #111116;
  --card: #16161d;
  --text: #f5f5f7;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #e5c287;
  --accent-soft: rgba(229, 194, 135, 0.14);
  --danger: #f87171;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.text-accent { color: var(--accent); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }

.app-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
}

/* ==========================================================================
   LEFT SIDEBAR — DECK MANAGER & LIVE EDITOR
   ========================================================================== */

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.sidebar-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #b68947);
  color: #09090b;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
}
.brand-title { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; }
.brand-sub { font-size: 10.5px; color: var(--text-muted); }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deck-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deck-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.18s ease;
}

.deck-item:hover { border-color: var(--border-strong); }
.deck-item.active { background: var(--accent-soft); border-color: var(--accent); }

.deck-item-info { min-width: 0; flex: 1; }
.deck-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-item-meta { font-size: 11px; color: var(--text-muted); }

.icon-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
}

.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(248, 113, 113, 0.5); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.field input, .field textarea, .field select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #09090b; }
.btn-primary:hover { background: #f0d39f; }
.btn-secondary { background: rgba(255, 255, 255, 0.06); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }

.lang-switcher {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.lang-btn {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.lang-btn.active { background: var(--accent); color: #09090b; }

/* ==========================================================================
   RIGHT WORKSPACE — 16:9 SLIDE STAGE
   ========================================================================== */

.workspace {
  padding: 22px 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.slide-counter {
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.slide-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 520px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0d0d11;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
}

.slide {
  display: none;
  width: 100%;
  height: 100%;
  padding: 42px 48px;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(700px 380px at 92% 8%, rgba(229, 194, 135, 0.1), transparent 60%),
    radial-gradient(550px 360px at 8% 95%, rgba(124, 140, 255, 0.08), transparent 60%),
    #0e0e13;
}

.slide.active { display: flex; animation: slideIn 0.22s ease; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-header-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slide-footer-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.slide-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 0;
}

.slide-h1 { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.07; letter-spacing: -0.03em; margin-bottom: 14px; }
.slide-h2 { font-size: clamp(22px, 2.5vw, 34px); line-height: 1.12; letter-spacing: -0.025em; margin-bottom: 12px; }
.slide-lead { font-size: 15px; color: var(--text-muted); max-width: 640px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.slide-panel {
  background: rgba(255, 255, 255, 0.038);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.check-list { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.check-list li { display: flex; gap: 8px; align-items: flex-start; }
.check-list li::before { content: '✓'; color: var(--accent); font-weight: 700; flex-shrink: 0; }

.showcase-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.showcase-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.showcase-meta { padding: 12px 14px; }
.showcase-meta h4 { font-size: 13.5px; margin-bottom: 3px; }
.showcase-meta p { font-size: 11.5px; color: var(--text-muted); }

.timeline-week {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  padding: 15px;
}
.timeline-week .wk { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; color: var(--accent); text-transform: uppercase; margin-bottom: 4px; }
.timeline-week h4 { font-size: 14.5px; margin-bottom: 6px; }
.timeline-week ul { list-style: none; font-size: 11.5px; color: var(--text-muted); display: flex; flex-direction: column; gap: 5px; }

.thumb-strip { display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; }
.thumb-btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 9px;
  padding: 8px 7px;
  text-align: left;
  cursor: pointer;
}
.thumb-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.thumb-num { font-size: 10.5px; font-weight: 700; color: var(--accent); display: block; }
.thumb-label { font-size: 10.5px; color: var(--text-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 150;
  background: #18181f;
  border: 1px solid var(--accent);
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 12.5px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--border); }
  .slide-stage { aspect-ratio: auto; min-height: 580px; }
  .thumb-strip { grid-template-columns: repeat(5, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media print {
  @page { size: landscape; margin: 0; }
  body { background: #0e0e13 !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .sidebar, .toolbar, .thumb-strip, .toast { display: none !important; }
  .app-shell { display: block !important; }
  .workspace { padding: 0 !important; }
  .slide-stage { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; aspect-ratio: auto !important; overflow: visible !important; }
  .slide {
    display: flex !important;
    width: 100vw !important;
    height: 100vh !important;
    page-break-after: always;
    break-after: page;
    padding: 38px 48px !important;
  }
  .slide:last-child { page-break-after: auto; break-after: auto; }
}
