/* Participă (nova-publish.js): chooser sheet, camera and review screen.
   Windows use the shared glass material (--window-glass over --window-scrim);
   the camera is full-screen black, as in short-video apps. */

html.np-open,
html.np-open body { overflow: hidden; }

.np-root {
  position: fixed;
  inset: var(--np-top, 0) 0 auto;
  height: var(--np-height, 100dvh);
  z-index: 10000;
  display: grid;
  place-items: center;
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}
.np-root[hidden] { display: none; }
.np-root [hidden] { display: none !important; }
.np-root button { font: inherit; color: inherit; }

.np-scrim {
  position: absolute;
  inset: 0;
  background: var(--window-scrim);
  -webkit-backdrop-filter: var(--window-scrim-filter);
  backdrop-filter: var(--window-scrim-filter);
  animation: np-fade .18s ease;
}
.np-root[data-screen="review"] .np-scrim { position: fixed; }

.np-icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.np-icon-btn:hover { background: var(--bg-hover); }

.np-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.np-btn:hover:not(:disabled) { background: var(--bg-hover); }
.np-btn:disabled { opacity: .45; cursor: default; }
.np-btn.is-primary { border-color: transparent; background: #fcd34d; color: #111827; }
.np-btn.is-primary:hover:not(:disabled) { background: #fbbf24; }
.np-link { margin-left: auto; padding: 0; border: 0; background: none; color: var(--secondary); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }

/* ------------------------------------------------------------ chooser */

.np-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: calc(100vw - 24px);
  max-width: 440px;
  max-height: var(--np-height, 100dvh);
  overflow-y: auto;
  padding: 18px 18px 20px;
  border: 1px solid var(--border-light);
  border-radius: 22px;
  background: var(--window-glass);
  -webkit-backdrop-filter: var(--window-glass-filter);
  backdrop-filter: var(--window-glass-filter);
  box-shadow: var(--shadow-xl);
  animation: np-rise .22s cubic-bezier(.2, .8, .2, 1);
}
.np-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.np-sheet-head h2 { margin: 0; font-family: "Poppins", sans-serif; font-size: var(--fs-lg); }

.np-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  color: #111827 !important;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(245, 158, 11, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.np-hero:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(245, 158, 11, .36); }
.np-hero-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 16px; background: rgba(17, 24, 39, .12); font-size: var(--fs-lg); }
.np-hero-text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.np-hero-text strong { font-family: "Poppins", sans-serif; font-size: 1.0625rem; line-height: 1.2; }
.np-hero-text span { font-size: var(--fs-sm); opacity: .8; }
.np-chevron { opacity: .6; }

.np-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-card) 70%, transparent);
  text-align: left;
  cursor: pointer;
}
.np-option:hover { background: var(--bg-hover); }
.np-option > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.np-option strong { font-family: "Poppins", sans-serif; font-size: 1.0625rem; line-height: 1.2; }
.np-option span span { color: var(--text-secondary); font-size: var(--fs-sm); }
/* Same tile as Filmează-te's icon: 52px, rounded, a soft tint that stays visible on hover. */
.np-option-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 16px; background: rgba(17, 24, 39, .07); color: var(--text-secondary); font-size: var(--fs-lg); }
html.dark .np-option-icon { background: rgba(255, 255, 255, .08); }
/* Dark theme: the two rows a little lighter than the sheet, so they read as buttons. */
html.dark .np-option { background: rgba(255, 255, 255, .05); }
html.dark .np-option:hover { background: rgba(255, 255, 255, .09); }

/* ------------------------------------------------------------- camera */

.np-root[data-screen="camera"] { background: #000; }
.np-camera { position: absolute; inset: 0; overflow: hidden; background: #000; color: #fff; }
.np-camera-video, .np-camera-freeze { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; background: #000; }
.np-camera-video.is-mirrored, .np-camera-freeze.is-mirrored { transform: scaleX(-1); }

.np-cam-btn {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff !important;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  cursor: pointer;
}
.np-cam-btn svg { filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55)); }
.np-cam-btn:disabled { opacity: .35; }
.np-cam-btn[aria-pressed="true"] { color: #fcd34d !important; }
.np-cam-btn.is-round { width: 48px; height: 48px; place-items: center; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; background: rgba(20, 23, 29, .35); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.np-cam-top > button { width: 40px; height: 40px; place-items: center; border-radius: 50%; background: rgba(20, 23, 29, .35); }

.np-cam-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 24px;
  background: linear-gradient(rgba(0, 0, 0, .45), transparent);
}
.np-cam-progress { position: relative; flex: 1; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .28); }
.np-cam-progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: #fcd34d; }
.np-cam-progress-min { position: absolute; top: -2px; width: 2px; height: 9px; border-radius: 1px; background: #fff; }
.np-cam-timer { min-width: 92px; font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }


.np-cam-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  padding: 36px 28px calc(env(safe-area-inset-bottom, 0px) + 28px);
  background: linear-gradient(transparent, rgba(0, 0, 0, .5));
}

.np-cam-zoom { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; width: min(100%, 288px); min-height: 44px; margin-bottom: 12px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 999px; background: rgba(20, 23, 29, .76); font-size: var(--fs-sm); }
.np-cam-zoom input { flex: 1; min-width: 0; height: 32px; margin: 0; accent-color: #fcd34d; cursor: pointer; }
.np-cam-zoom output { min-width: 3.25em; text-align: right; font-variant-numeric: tabular-nums; }

.np-rec {
  position: relative;
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  padding: 0;
  border: 5px solid #fff;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.np-rec span { width: 62px; height: 62px; border-radius: 50%; background: #ef4444; transition: width .2s ease, height .2s ease, border-radius .2s ease; }
.np-camera.is-recording .np-rec span { width: 30px; height: 30px; border-radius: 8px; }
.np-camera.is-recording:not(.is-long-enough) .np-rec { opacity: .7; }
.np-camera.is-recording [data-np="flip"],
.np-camera.is-recording [data-np="upload"] { visibility: hidden; }

.np-cam-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .55); cursor: pointer; }
.np-cam-error-card { cursor: default; }
/* The top bar (with the close button) stays above the error layer. */
.np-cam-top { z-index: 2; }
.np-cam-error-card { position: relative; }
.np-cam-error-close { position: absolute; top: 10px; right: 10px; color: var(--text-secondary); }
.np-cam-error-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  padding: 24px 22px;
  border-radius: 20px;
  background: var(--window-glass);
  -webkit-backdrop-filter: var(--window-glass-filter);
  backdrop-filter: var(--window-glass-filter);
  color: var(--text-primary);
  text-align: center;
}
.np-cam-error-card > i { font-size: var(--fs-xl); color: #f59e0b; }
.np-cam-error-card strong { font-size: var(--fs-md); }
.np-cam-error-card p { margin: 0 0 8px; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.5; }
.np-cam-error-card div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ------------------------------------------------------------- review */

.np-review {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(820px, calc(100vw - 32px));
  max-height: calc(var(--np-height, 100dvh) - 32px);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  background: var(--window-glass);
  -webkit-backdrop-filter: var(--window-glass-filter);
  backdrop-filter: var(--window-glass-filter);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: np-rise .22s cubic-bezier(.2, .8, .2, 1);
}
.np-review-head { display: flex; flex-shrink: 0; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.np-review-head h2 { flex: 1; margin: 0; font-size: var(--fs-md); text-align: center; }
.np-review-body { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-content: start; gap: 14px 22px; min-height: 0; flex: 1; padding: 20px; overflow-y: auto; }

.np-player { position: relative; align-self: start; aspect-ratio: var(--np-video-ratio, 9 / 16); max-height: min(560px, calc(100dvh - 140px)); border-radius: 16px; background: #000; overflow: hidden; }
.np-player video { width: 100%; height: 100%; object-fit: contain; display: block; }
.np-player.is-landscape { align-self: center; max-height: none; }
.np-player-sound, .np-player-toggle { position: absolute; bottom: 10px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .64); color: #fff !important; cursor: pointer; }
.np-player-sound { right: 10px; }
.np-player-toggle { left: 10px; }
.np-player-toggle.is-paused { top: 50%; left: 50%; bottom: auto; width: 52px; height: 52px; transform: translate(-50%, -50%); }

@media (min-width: 769px) {
  .np-review-body > :not(.np-player) { grid-column: 2; }
  .np-review-body > .np-player { grid-column: 1; grid-row: 1 / span 3; }
}

/* The trim strip (nova-publish.js setupTrim): a long clip's chosen part. */
.np-trim { display: flex; flex-direction: column; gap: 8px; }
.np-trim[hidden] { display: none; }
.np-trim-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); }
.np-trim-head span { color: var(--text-primary); font-weight: 600; }
.np-trim-head b { color: var(--text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.np-trim > small { color: var(--text-muted); font-size: var(--fs-xs); }
.np-trim-track {
  position: relative;
  height: 44px;
  margin: 0 8px;
  border-radius: 10px;
  background: var(--bg-hover);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.np-trim-sel {
  position: absolute;
  top: 0;
  bottom: 0;
  box-sizing: border-box;
  border: 3px solid #f5b301;
  border-left-width: 0;
  border-right-width: 0;
  background: color-mix(in srgb, #f5b301 18%, transparent);
  cursor: grab;
}
.np-trim-track.is-dragging .np-trim-sel { cursor: grabbing; }
.np-trim-play { position: absolute; z-index: 1; top: 0; bottom: 0; width: 24px; transform: translateX(-50%); cursor: ew-resize; }
.np-trim-play::after { content: ""; position: absolute; top: 5px; bottom: 5px; left: 50%; width: 3px; transform: translateX(-50%); border-radius: 3px; background: #fff; box-shadow: 0 0 2px 1px #000; pointer-events: none; }
.np-trim-handle {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 16px;
  margin-left: -8px;
  border-radius: 6px;
  background: #f5b301;
  cursor: ew-resize;
  touch-action: none;
}
.np-trim-handle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 16px; margin: -8px 0 0 -1.5px; border-radius: 2px; background: rgba(0, 0, 0, .35); }
.np-trim-handle:focus-visible, .np-trim-play:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
.np-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.np-field textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--fs-md);
  line-height: 1.45;
  resize: none;
}
.np-field textarea:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 18%, transparent); }

.np-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
}
.np-status > span:first-of-type { flex: 1; min-width: 0; }
.np-status.is-error { background: color-mix(in srgb, #ef4444 12%, transparent); color: var(--text-primary); }
.np-status.is-error > i { color: #ef4444; }

.np-actions { display: flex; flex-shrink: 0; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border-light); }
.np-actions .np-btn { flex: 1; min-width: 0; font-size: var(--fs-sm); }
.np-actions .is-primary { flex: 1.4; }

/* ------------------------------------------------------------- phones */

@media (max-width: 768px) {
  .np-camera-video, .np-camera-freeze { object-fit: cover; }

  html:has(.np-root[data-screen="review"]:not([hidden])) :is(.app-container, .mobile-tabbar) {
    filter: var(--window-scrim-filter);
  }
  .np-root[data-screen="review"] .np-scrim { -webkit-backdrop-filter: none; backdrop-filter: none; }

  .np-root[data-screen="choose"] { place-items: end center; overflow: hidden; overflow: clip; }
  .np-sheet {
    width: 100%;
    max-height: var(--np-height, 100dvh);
    padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    animation: np-sheet-up .32s cubic-bezier(.25, .65, .35, 1) both;
  }


  .np-review {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: var(--bg-main);
  }
  .np-review-head { padding-top: calc(env(safe-area-inset-top, 0px) + 8px); }
  .np-review-body { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; }
  .np-review-body > :not(.np-player) { flex-shrink: 0; }
  .np-field textarea { height: 52px; padding-block: 10px; }
  .np-player { align-self: stretch; flex: 1 0 clamp(140px, 34dvh, 300px); aspect-ratio: auto; max-height: none; }
  .np-player.is-landscape { align-self: stretch; }
  .np-actions { padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 10px); background: var(--bg-main); }
}

/* Closing (nova-publish.js animateOut): the opening, in reverse. */
.np-root.is-closing { pointer-events: none; }
.np-root.is-closing .np-scrim { animation: np-fade-out .2s ease forwards; }
.np-root.is-closing > :not(.np-scrim) { animation: np-sink .2s cubic-bezier(.4, 0, 1, 1) forwards; }
@media (max-width: 768px) {
  .np-root.is-closing .np-sheet { animation: np-sheet-down .22s cubic-bezier(.4, 0, 1, 1) forwards; }
}

@keyframes np-fade { from { opacity: 0; } }
@keyframes np-fade-out { to { opacity: 0; } }
@keyframes np-sink { to { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes np-sheet-down { to { transform: translateY(100%); } }
@keyframes np-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes np-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .np-root * { animation: none !important; transition: none !important; }
}
