/* ===== ppt-beautify.css — PPT page specific styles ===== */

/* Background override */
body.page-ppt {
  background: linear-gradient(180deg, #cfe6ff 0%, #eef7ff 44%, #d9efff 100%);
}

.page-ppt header {
  align-items: center;
  padding-bottom: 24px;
}

.page-ppt header .brand,
.page-ppt header nav,
.page-ppt header .auth-area {
  align-self: center;
}

.page-ppt header .brand {
  transform: translateY(5px);
}

/* Showcase background */
.showcase-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.showcase-grid {
  position: absolute;
  inset: -90px -260px -120px -260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
  transform: rotate(-9deg);
  opacity: 0.82;
}
.showcase-row {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  width: max-content;
  animation: showcase-marquee 60s linear infinite;
  will-change: transform;
}
.showcase-row:nth-child(2) { animation-duration: 72s; animation-direction: reverse; margin-left: -180px; }
.showcase-row:nth-child(3) { animation-duration: 66s; margin-left: -90px; }
.showcase-row:nth-child(4) { animation-duration: 78s; animation-direction: reverse; margin-left: -240px; }
.showcase-row:nth-child(5) { animation-duration: 70s; margin-left: -130px; }
.showcase-row:nth-child(6) { animation-duration: 84s; animation-direction: reverse; margin-left: -310px; }

.showcase-tile {
  width: clamp(190px, 17vw, 320px);
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.66);
  background: linear-gradient(145deg, rgba(255,255,255,0.58), rgba(255,255,255,0.2));
  box-shadow: 0 12px 40px rgba(26, 102, 178, 0.1);
  overflow: hidden;
}
.showcase-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.showcase-tile:nth-child(3n+1) { background: linear-gradient(135deg, rgba(5,117,230,0.34), rgba(255,255,255,0.28)); }
.showcase-tile:nth-child(3n+2) { background: linear-gradient(135deg, rgba(2,27,121,0.26), rgba(255,255,255,0.32)); }
.showcase-tile:nth-child(3n+3) { background: linear-gradient(135deg, rgba(255,255,255,0.48), rgba(5,117,230,0.18)); }

.showcase-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(232,246,255,0.62), rgba(247,252,255,0.82) 42%, rgba(226,243,255,0.68)), rgba(255,255,255,0.36);
}
@keyframes showcase-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Hero */
.hero { width: min(980px, 100%); margin: 0 auto 22px; text-align: center; }
.eyebrow { width: fit-content; margin: 0 auto 18px; padding: 8px 18px; border-radius: 999px; color: rgba(7,17,28,0.8); font-size: 14px; font-weight: 900; }
h1 { margin: 0; font-size: clamp(46px, 6.2vw, 88px); line-height: 1.06; font-weight: 950; }
.lead { width: 100%; margin: 18px auto 0; color: rgba(7,17,28,0.72); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.8; font-weight: 800; white-space: nowrap; }

/* Mode switch */
.mode-switch { width: fit-content; margin: 26px auto 0; display: flex; gap: 10px; padding: 8px; border-radius: 999px; }
.mode-switch button { border: 0; min-height: 48px; min-width: 168px; border-radius: 999px; font-weight: 950; color: rgba(7,17,28,0.64); background: transparent; }
.mode-switch button.active { color: #fff; background: var(--brand); box-shadow: 0 18px 42px rgba(5,117,230,0.24); }

.input-mode-switch { display: flex; gap: 8px; margin-bottom: 14px; }
.input-mode-switch button { flex: 1; border: 1px solid rgba(255,255,255,0.6); min-height: 40px; border-radius: 999px; font-weight: 950; font-size: 14px; color: rgba(7,17,28,0.6); background: rgba(255,255,255,0.18); }
.input-mode-switch button.active { color: #fff; background: var(--brand); border-color: transparent; }
.input-mode-switch button:disabled { opacity: 0.42; cursor: not-allowed; }

.text-input-area { min-height: 240px; width: 100%; border: 1px solid rgba(255,255,255,0.66); background: rgba(255,255,255,0.36); color: var(--ink); outline: none; font-weight: 800; border-radius: 18px; padding: 16px; resize: vertical; line-height: 1.8; font-size: 14px; }
.text-input-area::placeholder { color: rgba(7,17,28,0.36); font-weight: 800; }

/* Workspace */
.workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr) 300px; gap: 20px; align-items: stretch; margin-top: 26px; }
.panel, .creator, .result-panel { border-radius: 34px; min-height: 640px; max-height: 720px; overflow: hidden; }
.panel { position: relative; z-index: 12; overflow: visible; }
.creator, .result-panel { position: relative; z-index: 1; }
.panel, .creator, .result-panel { padding: 24px; }
.section-title { margin: 0 0 18px; font-size: 22px; line-height: 1.2; font-weight: 950; }
/* Form panel */
.form-panel {
  min-height: calc(640px - 48px - 44px);
  display: grid;
  gap: 22px;
  align-content: start;
}
.form-row { display: grid; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { color: var(--ink); font-size: 14px; font-weight: 950; }

.prompt-box, .number-box {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.66);
  background: rgba(255,255,255,0.36);
  color: var(--ink);
  outline: none;
  font-weight: 850;
  border-radius: 18px;
}
.prompt-box { min-height: 148px; resize: vertical; padding: 16px; line-height: 1.8; }
.number-box { min-height: 48px; padding: 0 12px; }

.select-box {
  width: 100%;
  min-height: 48px;
  padding: 0 40px 0 16px;
  color: var(--ink);
  outline: none;
  font-weight: 850;
  border-radius: 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,0.72);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2307111c' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center,
    linear-gradient(145deg, rgba(255,255,255,0.66), rgba(255,255,255,0.24)), rgba(255,255,255,0.36);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.9), 0 8px 24px rgba(26, 102, 178, 0.1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.select-box:hover { border-color: var(--blue-start); box-shadow: inset 1px 1px 0 rgba(255,255,255,0.9), 0 12px 32px rgba(5,117,230,0.16); }
.select-box:focus { border-color: var(--blue-start); box-shadow: inset 1px 1px 0 rgba(255,255,255,0.9), 0 0 0 3px rgba(5,117,230,0.15); }
.select-box.native-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
/* Glass select */
.glass-select { position: relative; }
.glass-select.open { z-index: 80; }
.glass-select-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 18px;
  padding: 0 14px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(255,255,255,0.68), rgba(255,255,255,0.24)), rgba(255,255,255,0.34);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.9), 0 8px 24px rgba(26, 102, 178, 0.1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-weight: 900;
}
.glass-select-button:hover,
.glass-select.open .glass-select-button {
  border-color: rgba(5,117,230,0.72);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.92), 0 14px 34px rgba(5,117,230,0.18), 0 0 0 3px rgba(5,117,230,0.12);
}
.glass-select-arrow {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transition: transform 180ms ease;
}
.glass-select.open .glass-select-arrow { transform: rotate(180deg); }

.glass-select-menu {
  position: absolute;
  z-index: 25;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(320px, 42vh);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.76);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,0.72), rgba(255,255,255,0.34)), rgba(225,242,255,0.56);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.92), 0 24px 54px rgba(5,117,230,0.2);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  backdrop-filter: blur(14px) saturate(115%);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.glass-select.drop-up .glass-select-menu {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(4px) scale(0.98);
}
.glass-select.open .glass-select-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.glass-select-option {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 13px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  color: rgba(7,17,28,0.8);
  background: transparent;
  font-weight: 900;
  text-align: left;
}
.glass-select-option:hover { background: rgba(255,255,255,0.52); color: var(--ink); }
.glass-select-option.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(5,117,230,0.22);
}
.glass-select-menu::-webkit-scrollbar { width: 8px; }
.glass-select-menu::-webkit-scrollbar-track { background: rgba(255,255,255,0.3); border-radius: 999px; }
.glass-select-menu::-webkit-scrollbar-thumb { background: rgba(5,117,230,0.36); border-radius: 999px; }

.run-btn { width: 100%; min-height: 54px; border: 0; border-radius: 14px; color: #fff; background: var(--brand); font-weight: 950; font-size: 16px; }

/* Creator panel */
.creator { display: grid; grid-template-rows: auto 1fr auto; gap: 16px; }
.upload-box {
  min-height: 112px;
  border-radius: 22px;
  border: 1px dashed rgba(7, 117, 230, 0.28);
  background: rgba(255,255,255,0.26);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  font-weight: 950;
  color: var(--muted);
  cursor: pointer;
}
.upload-box input { display: none; }
.upload-box span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; font-weight: 800; }

.main-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  align-self: center;
  border-radius: 28px;
  border: 1px dashed rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.24);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-weight: 900;
  overflow: hidden;
  padding: 24px;
}
.main-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.creator-actions { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.secondary { border: 0; border-radius: 999px; min-height: 52px; padding: 0 22px; font-weight: 950; display: inline-flex; align-items: center; justify-content: center; color: rgba(7,17,28,0.76); background: rgba(255,255,255,0.34); border: 1px solid rgba(255,255,255,0.62); }
.message { min-height: 22px; color: rgba(7,17,28,0.72); font-size: 14px; font-weight: 850; line-height: 1.6; text-align: center; white-space: pre-wrap; }

/* Progress */
.progress-wrap { display: none; padding: 20px 24px; }
.progress-wrap.show { display: block; }
.progress-track { width: 100%; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.4); overflow: hidden; }
.progress-fill { height: 100%; width: 34%; border-radius: 3px; background: var(--brand); animation: progress-slide 1.4s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes progress-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.progress-text { margin-top: 12px; text-align: center; color: var(--muted); font-size: 13px; font-weight: 850; }
.progress-actions { margin-top: 12px; display: flex; justify-content: center; }
.progress-cancel { min-height: 42px; min-width: 148px; border: 0; border-radius: 999px; padding: 0 20px; font-weight: 950; font-size: 14px; }
.progress-cancel[hidden] { display: none; }

/* Result panel */
.result-panel { display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.thumb-list {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px 12px 18px 12px;
}
.thumb-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  border: 1px solid rgba(5,117,230,0.32);
  background: #04173b;
  border-radius: 14px;
  padding: 0;
  text-align: left;
  font-weight: 900;
  color: rgba(7,17,28,0.74);
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 8px 20px rgba(4,23,59,0.14);
}
.thumb-card.active { border-color: var(--blue-start); background: #04173b; box-shadow: 0 0 0 3px var(--blue-start), 0 12px 30px rgba(5,117,230,0.22); }
.thumb-card img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 13px; background: #04173b; }

.thumb-fallback {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  color: rgba(7,17,28,0.66);
  background: rgba(255,255,255,0.34);
  font-size: 13px;
  line-height: 1.5;
}
.slide-error {
  width: min(520px, 100%);
  margin: auto;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(5,117,230,0.18);
  background: rgba(255,255,255,0.36);
  color: rgba(7,17,28,0.72);
  line-height: 1.8;
  font-weight: 850;
}

.thumb-overlay {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  background: linear-gradient(to top, rgba(255,255,255,0.72) 0%, transparent 60%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
  font-size: 13px;
  color: var(--ink);
}
.thumb-card:hover .thumb-overlay { opacity: 1; transform: translateY(0); }
.empty-thumbs { color: var(--muted); font-weight: 850; line-height: 1.7; text-align: center; padding: 30px 12px; }

/* Outline panel */
.outline-panel { display: none; flex-direction: column; gap: 14px; max-height: 600px; overflow-y: auto; padding-right: 4px; }
.outline-panel.show { display: flex; }
.outline-project-title { width: 100%; border: 1px solid rgba(255,255,255,0.66); background: rgba(255,255,255,0.36); color: var(--ink); outline: none; font-weight: 950; border-radius: 14px; padding: 10px 16px; font-size: 17px; }
.outline-nav-editor { display: grid; gap: 10px; border: 1px solid rgba(5,117,230,0.18); border-radius: 18px; padding: 14px; background: rgba(255,255,255,0.26); }
.outline-nav-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.outline-nav-head strong { color: var(--ink); font-size: 15px; font-weight: 950; }
.outline-nav-head span { color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.5; }
.outline-nav-add, .outline-nav-remove { border: 0; border-radius: 999px; min-height: 34px; padding: 0 12px; font-size: 12px; font-weight: 950; white-space: nowrap; }
.outline-nav-add { color: #fff; background: var(--brand); }
.outline-nav-remove { color: rgba(7,17,28,0.68); background: rgba(255,255,255,0.42); border: 1px solid rgba(255,255,255,0.6); }
.outline-nav-rows { display: grid; gap: 8px; }
.outline-nav-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(120px, 0.75fr) auto; gap: 8px; align-items: center; }
.outline-nav-title, .outline-nav-pages { width: 100%; border: 1px solid rgba(255,255,255,0.5); background: rgba(255,255,255,0.34); color: var(--ink); outline: none; font-weight: 850; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.outline-slide-card { border: 1px solid rgba(255,255,255,0.6); border-radius: 18px; padding: 14px; background: rgba(255,255,255,0.22); display: grid; gap: 8px; }
.outline-slide-head { display: flex; align-items: center; gap: 10px; }
.outline-slide-num { font-size: 13px; font-weight: 950; color: #fff; background: var(--brand); border-radius: 999px; padding: 3px 12px; white-space: nowrap; }
.outline-slide-type { font-size: 13px; font-weight: 800; color: var(--muted); }
.outline-slide-title, .outline-slide-subtitle { width: 100%; border: 1px solid rgba(255,255,255,0.5); background: rgba(255,255,255,0.28); color: var(--ink); outline: none; font-weight: 850; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.outline-slide-content { width: 100%; min-height: 72px; border: 1px solid rgba(255,255,255,0.5); background: rgba(255,255,255,0.28); color: var(--ink); outline: none; font-weight: 800; border-radius: 10px; padding: 8px 12px; font-size: 13px; resize: vertical; line-height: 1.7; }
.outline-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.outline-actions button { flex: 1; min-height: 44px; border: 0; border-radius: 999px; font-weight: 950; font-size: 14px; }
.outline-btn-retry { color: rgba(7,17,28,0.7); background: rgba(255,255,255,0.34); border: 1px solid rgba(255,255,255,0.6) !important; }
.outline-btn-confirm { color: #fff; background: var(--brand); }
.outline-btn-cancel { color: #fff; background: linear-gradient(135deg, #b91c1c, #ef4444); }
/* Templates */
.templates { margin-top: 22px; padding: 24px; border-radius: 34px; }
.templates-head { margin-bottom: 18px; }
.templates-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; font-weight: 800; }
.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.template {
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 26px;
  padding: 12px;
  background: rgba(255,255,255,0.26);
  text-align: left;
  transition: background 240ms ease, box-shadow 240ms ease, transform 240ms ease;
  box-shadow: 0 0 0 0 transparent;
  transform: scale(1);
}
.template.active {
  outline: 3px solid var(--blue-start);
  background: rgba(255,255,255,0.42);
  box-shadow: 0 12px 40px rgba(5,117,230,0.15);
  transform: scale(1.02);
}
.template-preview { aspect-ratio: 16 / 9; border-radius: 18px; background: var(--brand); overflow: hidden; position: relative; margin-bottom: 12px; }
.template-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.template strong { display: block; color: var(--ink); font-size: 16px; font-weight: 950; }
.template span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.5; }

/* Revise panel */
.revise-panel {
  display: none;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,0.38), rgba(255,255,255,0.14));
  overflow: hidden;
}
.revise-panel.show { display: flex; }

.revise-messages {
  max-height: 160px;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.revise-messages:empty { display: none; }

.revise-bubble {
  max-width: 88%;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.6;
  word-break: break-word;
}
.revise-bubble.user {
  align-self: flex-end;
  color: #fff;
  background: var(--brand);
  border-bottom-right-radius: 4px;
}
.revise-bubble.system {
  align-self: flex-start;
  color: rgba(7,17,28,0.7);
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.5);
  border-bottom-left-radius: 4px;
}

.revise-input-row {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.4);
}
.revise-input {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.32);
  color: var(--ink);
  outline: none;
  font-weight: 750;
  font-size: 13px;
}
.revise-input::placeholder { color: rgba(7,17,28,0.36); }
.revise-send {
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  min-height: 40px;
  color: #fff;
  background: var(--brand);
  font-weight: 950;
  font-size: 13px;
  white-space: nowrap;
}
.revise-send:disabled { opacity: 0.6; }

/* PPT dialog */
.ppt-dialog { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; padding: 24px; background: rgba(188,215,241,0.34); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.ppt-dialog.show { display: grid; }
.ppt-dialog-card { width: min(460px, 100%); border-radius: 32px; padding: 28px; color: var(--ink); }
.ppt-dialog-card h2 { margin: 0 0 10px; font-size: 25px; line-height: 1.25; }
.ppt-dialog-card p { margin: 0 0 20px; color: rgba(7,17,28,0.68); font-weight: 800; line-height: 1.7; }
.ppt-dialog-card button { width: 100%; border: 0; border-radius: 999px; min-height: 52px; color: #fff; background: var(--brand); font-weight: 950; }

/* Responsive — PPT page */
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .panel, .creator, .result-panel { min-height: auto; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .showcase-tile { width: clamp(170px, 24vw, 280px); }
}

@media (max-width: 768px) {
  .lead { white-space: normal; }
  nav a { flex: 1; min-width: 0; }
  .mode-switch, .creator-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .mode-switch button, .secondary, .run-btn { width: 100%; min-width: 0; }
  .template-grid, .form-grid { grid-template-columns: 1fr; }
  .outline-nav-head, .outline-nav-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .showcase-tile { width: clamp(140px, 40vw, 220px); }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-row { animation: none; }
}
