/* Unicorn Slides. The app follows the Unicorn Works theme; each slide follows its own presentation theme. */
html, body { height: 100%; overflow: hidden; }
body { display: grid; grid-template-rows: auto auto 1fr auto; }
.top { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .home { border: 0; background: none; padding: 2px; border-radius: 10px; }
.top .home:hover { background: var(--surface-2); }
.doc-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.doc-name input { font: 600 18px 'Fredoka', sans-serif; border: 1px solid transparent; background: none; color: var(--text); padding: 2px 6px; border-radius: 8px; max-width: 460px; }
.doc-name input:hover, .doc-name input:focus { border-color: var(--line); background: var(--surface-2); outline: none; }
.doc-name span { font-size: 12px; padding-left: 7px; }
.early { background: linear-gradient(135deg, #fef3c7, #fce7f3); color: #9a3412; border-color: #fcd34d; }
[data-theme="galaxy"] .early, [data-theme="midnight"] .early { background: #3b2a12; color: #fde68a; border-color: #92400e; }
.file-btns { display: flex; gap: 6px; align-items: center; }
.u-btn.sm { padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.u-btn.present { background: linear-gradient(135deg, #f59e0b, #ec4899); color: #fff; border-color: transparent; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 30; min-width: 250px; display: grid; }
.menu button { text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 10px; font-weight: 700; color: var(--text); }
.menu button:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.menu.ctx { position: fixed; z-index: 60; min-width: 210px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); align-items: center; min-height: 46px; }
.grp { display: flex; gap: 2px; align-items: center; padding-right: 8px; border-right: 1px solid var(--line); }
.grp:last-child { border-right: 0; }
.toolbar button, .toolbar .color { min-width: 30px; height: 32px; border: 1px solid transparent; background: none; border-radius: 8px; font: 800 13.5px 'Nunito', sans-serif; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: var(--text); padding: 0 6px; position: relative; cursor: pointer; }
.toolbar button span { font-size: 12.5px; }
.toolbar button:hover, .toolbar .color:hover { background: var(--surface); border-color: var(--line); }
.toolbar button.on { background: var(--glow); border-color: var(--accent); }
.toolbar select { height: 32px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; font: 700 12.5px 'Nunito', sans-serif; padding: 0 4px; }
#fontSel { width: 140px; } #sizeSel { width: 60px; }
.color { font-weight: 900; text-decoration: underline 3px var(--accent-2); }
.color input { position: absolute; inset: auto 0 0 0; width: 100%; height: 6px; opacity: 0; cursor: pointer; }
body:not(.has-text) .txt-only, body:not(.has-item) .item-only { opacity: .35; pointer-events: none; }
@media (max-width: 1300px) { .toolbar button span { display: none; } }
.pop { position: absolute; left: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 10px; z-index: 40; display: grid; gap: 4px; }
.shapes-pop { grid-template-columns: repeat(4, 54px); }
.shapes-pop button { height: 48px; width: 54px; }
.shapes-pop svg { width: 34px; height: 30px; }
.stick-pop { grid-template-columns: repeat(8, 38px); width: 340px; }
.stick-pop button { font-size: 24px; height: 38px; width: 38px; padding: 0; }
.stick-pop h4, .layouts-pop h4 { grid-column: 1 / -1; margin: 4px 2px; font: 800 11px 'Nunito', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.main { display: grid; grid-template-columns: 210px 1fr; min-height: 0; }
.strip { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.strip-list { overflow: auto; padding: 12px 12px 10px 8px; display: grid; gap: 12px; align-content: start; flex: 1; }
.thumb { display: grid; grid-template-columns: 22px 1fr; gap: 4px; align-items: start; border: 0; background: none; padding: 0; cursor: pointer; position: relative; }
.thumb b { font: 800 11.5px 'Nunito', sans-serif; color: var(--muted); text-align: right; padding-top: 2px; }
.thumb .tv { width: 168px; height: 94.5px; overflow: hidden; border-radius: 8px; border: 2px solid var(--line); position: relative; background: #fff; }
.thumb .tv > .slide { transform: scale(.13125); transform-origin: 0 0; pointer-events: none; }
.thumb.on .tv { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.thumb.drop-before::before, .thumb.drop-after::after { content: ''; position: absolute; left: 26px; right: 0; height: 4px; border-radius: 4px; background: var(--accent-2); }
.thumb.drop-before::before { top: -8px; } .thumb.drop-after::after { bottom: -8px; }
.thumb .tr { position: absolute; left: 0; bottom: 0; font-size: 11px; }
.new-wrap { padding: 10px 12px; border-top: 1px solid var(--line); }
.newslide { width: 100%; justify-content: center; }
.layouts-pop { left: 12px; top: auto; bottom: calc(100% + 4px); grid-template-columns: repeat(2, 150px); }
.layouts-pop button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 6px; text-align: center; font: 800 12px 'Nunito', sans-serif; color: var(--text); }
.layouts-pop button:hover { border-color: var(--accent); }
.layouts-pop .lv { width: 136px; height: 76.5px; overflow: hidden; border-radius: 6px; position: relative; margin-bottom: 4px; }
.layouts-pop .lv > .slide { transform: scale(.10625); transform-origin: 0 0; pointer-events: none; }

.work { display: grid; grid-template-rows: 1fr auto; min-height: 0; min-width: 0; }
.stage-area { position: relative; overflow: hidden; display: grid; place-items: center; background: radial-gradient(900px 400px at 50% 0%, var(--glow), transparent 70%), var(--bg-2); }
.stage-wrap { position: relative; box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 22px 50px rgba(60, 30, 120, .2); border-radius: 4px; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.notes-bar { border-top: 1px solid var(--line); background: var(--surface); padding: 8px 14px; }
.notes-bar textarea { width: 100%; height: 64px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font: 600 13.5px 'Nunito', sans-serif; padding: 8px 10px; }
.status { display: flex; gap: 16px; align-items: center; padding: 6px 16px; background: var(--surface); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 700; }
.status .grow { flex: 1; }

/* a slide (used by the stage, thumbnails, the show and printing) */
.slide { position: relative; width: 1280px; height: 720px; overflow: hidden; }
.it { position: absolute; }
.it .tx { width: 100%; height: 100%; display: flex; flex-direction: column; padding: 8px 12px; box-sizing: border-box; white-space: pre-wrap; word-wrap: break-word; outline: none; line-height: 1.2; }
.it .tx.vm { justify-content: center; } .it .tx.vb { justify-content: flex-end; }
.it .tx > div { min-height: 1em; }
.it .tx.bul > div { padding-left: 1.1em; position: relative; }
.it .tx.bul > div::before { content: '•'; position: absolute; left: .1em; color: var(--bul, currentColor); }
.it .tx:empty::before { content: attr(data-ph); opacity: .45; }
.stage .it.ph-empty { outline: 2px dashed rgba(139, 92, 246, .35); outline-offset: -2px; }
.slide.no-ph .it.ph-empty { display: none; }
.it svg { position: absolute; inset: 0; overflow: visible; }
.it img { width: 100%; height: 100%; display: block; object-fit: fill; pointer-events: none; user-select: none; }
.it.picph { border: 3px dashed rgba(139, 92, 246, .5); border-radius: 12px; display: grid; place-items: center; font: 800 22px 'Nunito', sans-serif; color: rgba(109, 40, 217, .7); background: rgba(255, 255, 255, .35); }
.slide.no-ph .it.picph { display: none; }

/* editing on the stage */
.stage .it { cursor: move; }
.stage .it.editing { cursor: text; }
.stage .it.editing .tx { outline: 2px solid rgba(139, 92, 246, .55); }
.selbox { position: absolute; outline: 2px solid #8b5cf6; pointer-events: none; z-index: 9000; }
.selbox.multi { outline-style: dashed; }
.hdl { position: absolute; width: 14px; height: 14px; background: #fff; border: 2.5px solid #8b5cf6; border-radius: 50%; pointer-events: auto; z-index: 9001; }
.hdl[data-h="nw"], .hdl[data-h="se"] { cursor: nwse-resize; } .hdl[data-h="ne"], .hdl[data-h="sw"] { cursor: nesw-resize; }
.hdl[data-h="n"], .hdl[data-h="s"] { cursor: ns-resize; } .hdl[data-h="e"], .hdl[data-h="w"] { cursor: ew-resize; }
.guide { position: absolute; background: #ec4899; z-index: 9002; pointer-events: none; }
.marquee { position: absolute; border: 2px dashed #8b5cf6; background: rgba(139, 92, 246, .08); z-index: 9003; pointer-events: none; }

/* the show */
.show { position: fixed; inset: 0; background: #000; z-index: 100; display: grid; place-items: center; cursor: none; }
.show.cursor { cursor: default; }
.show-slide { position: relative; }
.show-slide .slide { transform-origin: 0 0; position: absolute; left: 0; top: 0; }
.show-count { position: fixed; right: 18px; bottom: 12px; color: rgba(255, 255, 255, .5); font: 800 13px 'Nunito', sans-serif; }
.show .end { color: #fff; font: 600 28px 'Fredoka', sans-serif; text-align: center; }
.t-fade { animation: tFade .6s ease both; } .t-slide { animation: tSlide .55s cubic-bezier(.2, .8, .2, 1) both; } .t-zoom { animation: tZoom .55s cubic-bezier(.2, .8, .2, 1) both; } .t-flip { animation: tFlip .7s ease both; }
@keyframes tFade { from { opacity: 0; } } @keyframes tSlide { from { transform: translateX(100%); opacity: .2; } } @keyframes tZoom { from { transform: scale(.6); opacity: 0; } } @keyframes tFlip { from { transform: perspective(1600px) rotateY(80deg); opacity: 0; } }
.show .stage-anim { position: relative; width: 100%; height: 100%; overflow: hidden; }

.recover { position: fixed; left: 50%; top: 150px; transform: translateX(-50%); z-index: 40; background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow); max-width: 640px; }
.modal { position: fixed; inset: 0; background: rgba(10, 5, 30, .45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px 24px; width: min(860px, 100%); box-shadow: var(--shadow); max-height: 88vh; overflow: auto; }
.modal-box h2 { margin-bottom: 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.themes button { border: 2px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 6px; text-align: center; font: 800 13px 'Nunito', sans-serif; color: var(--text); }
.themes button:hover, .themes button.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.themes .lv { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; position: relative; margin-bottom: 5px; }
.themes .lv > .slide { transform-origin: 0 0; pointer-events: none; position: absolute; }
.toast { position: fixed; left: 50%; bottom: 46px; transform: translateX(-50%) translateY(140px); background: var(--sidebar); color: var(--sidebar-text); padding: 10px 18px; border-radius: 14px; font-weight: 800; transition: transform .25s; z-index: 120; max-width: 80vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.print-area { display: none; }
@media print {
  @page { size: 13.333in 7.5in; margin: 0; }
  body { display: block; overflow: visible; background: #fff; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block; }
  .print-area .slide { break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
