/* ─── Pitch Deck Generator Styles ─────────────────────────────────────────── */

.pd-page {
  background: var(--c-bg);
  min-height: 100vh;
  color: var(--c-text);
  font-family: var(--font-display);
}

.pd-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ─── Builder Header ─────────────────────────────────────────────────────── */
.pd-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.pd-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
}

.pd-header p {
  color: #8B8B9A;
  font-size: 0.95rem;
}

/* ─── Template Selector ─────────────────────────────────────────────────── */
.pd-templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.pd-template-card {
  background: #1A1A22;
  border: 2px solid #252535;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.pd-template-card:hover {
  border-color: #4F4F6A;
  background: #1E1E2A;
}

.pd-template-card.selected {
  border-color: #6366F1;
  background: #1E1E38;
}

.pd-template-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pd-template-card-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #E0E0F0;
  display: block;
  margin-bottom: 0.25rem;
}

.pd-template-card-desc {
  font-size: 0.78rem;
  color: #6B6B80;
}

/* ─── Form Inputs ───────────────────────────────────────────────────────── */
.pd-form {
  background: #1A1A22;
  border-radius: 16px;
  padding: 1.75rem;
  border: 1px solid #252535;
  margin-bottom: 1.5rem;
}

.pd-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pd-form-row.single {
  grid-template-columns: 1fr;
}

.pd-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pd-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #8B8B9A;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pd-input,
.pd-textarea,
.pd-select {
  background: #141420;
  border: 1px solid #252535;
  border-radius: 8px;
  color: #E0E0F0;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.pd-input:focus,
.pd-textarea:focus,
.pd-select:focus {
  outline: none;
  border-color: #6366F1;
}

.pd-textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}

.pd-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B8B9A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2rem;
}

/* ─── Generate Button ───────────────────────────────────────────────────── */
.pd-generate-btn {
  width: 100%;
  padding: 0.9rem;
  background: #6366F1;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.15s, transform 0.1s;
}

.pd-generate-btn:hover { background: #5558E3; }
.pd-generate-btn:active { transform: scale(0.98); }
.pd-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pd-loading {
  display: none;
  text-align: center;
  padding: 2rem;
}

.pd-loading.visible { display: block; }

.pd-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #252535;
  border-top-color: #6366F1;
  border-radius: 50%;
  animation: pd-spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* ─── Slide Editor ──────────────────────────────────────────────────────── */
.pd-editor {
  margin-top: 2rem;
  display: none;
}

.pd-editor.visible { display: block; }

.pd-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.pd-editor-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.pd-editor-actions {
  display: flex;
  gap: 0.5rem;
}

.pd-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.15s, opacity 0.15s;
}

.pd-btn-outline {
  background: transparent;
  border: 1px solid #252535;
  color: #8B8B9A;
}
.pd-btn-outline:hover { border-color: #4F4F6A; color: #E0E0F0; }

.pd-btn-secondary {
  background: #252535;
  color: #E0E0F0;
}
.pd-btn-secondary:hover { background: #2E2E40; }

.pd-btn-primary {
  background: #6366F1;
  color: #fff;
}
.pd-btn-primary:hover { background: #5558E3; }

.pd-btn-pro {
  background: linear-gradient(135deg, #8B5CF6, #6366F1);
  color: #fff;
}
.pd-btn-pro:hover { opacity: 0.9; }

.pd-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Slides Grid ───────────────────────────────────────────────────────── */
.pd-slides-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pd-slide-card {
  background: #1A1A22;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #252535;
  transition: border-color 0.15s;
}

.pd-slide-card:hover { border-color: #4F4F6A; }

.pd-slide-preview {
  padding: 1.25rem 1.5rem;
  position: relative;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pd-slide-type-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6366F1;
  font-weight: 700;
}

.pd-slide-heading-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.pd-slide-body-display {
  font-size: 0.82rem;
  color: #8B8B9A;
  line-height: 1.4;
}

.pd-slide-accent-display {
  font-size: 0.78rem;
  font-weight: 600;
  color: #8B5CF6;
  margin-top: 0.2rem;
}

.pd-slide-expand {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: #6B6B80;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem 0.4rem;
  transition: color 0.15s;
}
.pd-slide-expand:hover { color: #E0E0F0; }

.pd-slide-edit-panel {
  display: none;
  border-top: 1px solid #252535;
  padding: 1.25rem 1.5rem;
  gap: 0.75rem;
  flex-direction: column;
}

.pd-slide-edit-panel.open { display: flex; }

.pd-slide-edit-panel input,
.pd-slide-edit-panel textarea {
  width: 100%;
  box-sizing: border-box;
}

.pd-slide-edit-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Watermark overlay */
.pd-watermark-strip {
  text-align: center;
  padding: 0.5rem;
  background: #1E1E2A;
  border-top: 1px solid #252535;
  font-size: 0.72rem;
  color: #6B6B80;
}

.pd-watermark-strip a {
  color: #6366F1;
  text-decoration: none;
}

.pd-watermark-strip a:hover { text-decoration: underline; }

/* Upgrade modal */
.pd-upgrade-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.pd-upgrade-modal.open { display: flex; }

.pd-upgrade-box {
  background: #1A1A22;
  border: 1px solid #252535;
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.pd-upgrade-box h2 { font-size: 1.4rem; color: #fff; margin-bottom: 0.5rem; }
.pd-upgrade-box p { color: #8B8B9A; font-size: 0.9rem; margin-bottom: 1.5rem; }
.pd-upgrade-price { font-size: 2rem; font-weight: 800; color: #6366F1; margin-bottom: 1rem; }
.pd-upgrade-price span { font-size: 0.9rem; color: #6B6B80; font-weight: 400; }
.pd-upgrade-features { list-style: none; padding: 0; margin: 0 0 1.5rem; text-align: left; }
.pd-upgrade-features li { padding: 0.4rem 0; color: #E0E0F0; font-size: 0.88rem; }
.pd-upgrade-features li::before { content: '✓ '; color: #6366F1; }

/* ─── Styled slide preview ──────────────────────────────────────────────── */
.pd-slide-styled {
  border-radius: 10px;
  min-height: 120px;
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
}

.pd-slide-inner-wrap {
  position: relative;
  z-index: 1;
}

.pd-slide-num-badge {
  position: absolute;
  top: 10px; right: 14px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  color: rgba(255,255,255,0.8);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
}

.pd-slide-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid #252535;
  background: #161620;
}

.pd-btn-sm { padding: 4px 12px; font-size: 0.78rem; }

.pd-slide-url-hint {
  font-size: 0.7rem;
  color: #4a4a5a;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .pd-form-row { grid-template-columns: 1fr; }
  .pd-templates-grid { grid-template-columns: 1fr; }
  .pd-editor-actions { flex-wrap: wrap; }
}