/* SendLoveCard.org - Interactive Video Maker & Customizer Styles */

.editor-wrapper {
  background: #fdf5f7;
  min-height: calc(100vh - 140px);
  padding: 40px 0 80px;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: start;
}

/* LEFT: FORM & CONTROLS */
.editor-panel {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.editor-panel-header {
  padding: 24px 30px;
  background: linear-gradient(135deg, #fff2f5 0%, #fff 100%);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.editor-panel-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--text-main);
}
.editor-badge {
  background: var(--primary-gradient);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

.editor-form-body {
  padding: 30px;
}

.form-section {
  margin-bottom: 28px;
}
.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}
.form-section-title i {
  color: var(--primary);
  font-size: 16px;
}

.form-group-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 57, 86, 0.12);
}
.form-textarea {
  resize: vertical;
  min-height: 70px;
}

/* PHOTO / LOGO UPLOAD BOX */
.photo-upload-zone {
  border: 2px dashed #e8b4c0;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: #fffafa;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}
.photo-upload-zone:hover {
  background: #fff0f3;
  border-color: var(--primary);
}
.photo-preview-thumb {
  max-width: 220px;
  max-height: 120px;
  width: auto;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
  margin: 0 auto 10px;
  border: 2px solid var(--primary);
  background: #ffffff;
  padding: 8px 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: none;
}
.photo-upload-icon {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 6px;
}
.photo-change-hint {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 4px;
  display: none;
}

/* MUSIC SELECTOR */
.music-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.music-option-card {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
}
.music-option-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.music-option-card.selected {
  border-color: var(--primary);
  background: #fff0f3;
  font-weight: 700;
}
.music-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.music-play-btn {
  background: none;
  color: var(--primary);
  font-size: 16px;
  padding: 4px;
}

/* RIGHT: VIDEO PREVIEW CANVAS */
.preview-sticky-wrapper {
  position: sticky;
  top: 100px;
}
.video-preview-card {
  background: #150a0e;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}
.video-canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 520px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#videoCanvas,
.preview-media-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* DYNAMIC VIDEO TEXT & IMAGE OVERLAYS LAYER */
.video-text-overlays-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.text-overlay-item,
.image-overlay-item {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  line-height: 1.25;
  box-sizing: border-box;
  will-change: transform, opacity;
  --anim-duration: 1.2s;
  --anim-delay: 0s;
  --anim-loop-duration: 2.4s;
  --anim-offset-y: 30px;
  --anim-scale-start: 0.75;
}

.text-overlay-item {
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 90%;
  text-shadow: none !important;
}

.image-overlay-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-overlay-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.65));
}

/* INTENSITY MODIFIERS */
.intensity-subtle {
  --anim-duration: 1.8s;
  --anim-loop-duration: 3.5s;
  --anim-offset-y: 15px;
  --anim-scale-start: 0.90;
}
.intensity-normal {
  --anim-duration: 1.2s;
  --anim-loop-duration: 2.4s;
  --anim-offset-y: 30px;
  --anim-scale-start: 0.75;
}
.intensity-high {
  --anim-duration: 0.8s;
  --anim-loop-duration: 1.5s;
  --anim-offset-y: 50px;
  --anim-scale-start: 0.50;
}

/* 1. FADE IN ANIMATION */
@keyframes canvaFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes canvaFadeLoop {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.canva-anim-fade.trigger-start,
.canva-anim-fade.trigger-scroll {
  animation: canvaFadeIn var(--anim-duration) cubic-bezier(0.16, 1, 0.3, 1) var(--anim-delay) forwards;
}
.canva-anim-fade.trigger-loop {
  animation: canvaFadeLoop var(--anim-loop-duration) ease-in-out var(--anim-delay) infinite;
}

/* 2. SLIDE UP ANIMATION */
@keyframes canvaSlideUp {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + var(--anim-offset-y)));
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}
@keyframes canvaSlideUpLoop {
  0%, 100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, calc(-50% - var(--anim-offset-y) * 0.45));
  }
}
.canva-anim-slide_up.trigger-start,
.canva-anim-slide-up.trigger-start,
.canva-anim-slide_up.trigger-scroll,
.canva-anim-slide-up.trigger-scroll {
  animation: canvaSlideUp var(--anim-duration) cubic-bezier(0.16, 1, 0.3, 1) var(--anim-delay) forwards;
}
.canva-anim-slide_up.trigger-loop,
.canva-anim-slide-up.trigger-loop {
  animation: canvaSlideUpLoop var(--anim-loop-duration) ease-in-out var(--anim-delay) infinite;
}

/* 3. ZOOM IN ANIMATION */
@keyframes canvaZoomIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(var(--anim-scale-start));
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes canvaZoomLoop {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.09);
  }
}
.canva-anim-zoom_in.trigger-start,
.canva-anim-zoom-in.trigger-start,
.canva-anim-zoom_in.trigger-scroll,
.canva-anim-zoom-in.trigger-scroll {
  animation: canvaZoomIn var(--anim-duration) cubic-bezier(0.34, 1.56, 0.64, 1) var(--anim-delay) forwards;
}
.canva-anim-zoom_in.trigger-loop,
.canva-anim-zoom-in.trigger-loop {
  animation: canvaZoomLoop var(--anim-loop-duration) ease-in-out var(--anim-delay) infinite;
}

/* 4. BOUNCE IN ANIMATION */
@keyframes canvaBounceIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
  }
  70% {
    transform: translate(-50%, -50%) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes canvaBounceLoop {
  0%, 20%, 50%, 80%, 100% {
    transform: translate(-50%, -50%);
  }
  40% {
    transform: translate(-50%, calc(-50% - 15px));
  }
  60% {
    transform: translate(-50%, calc(-50% - 7px));
  }
}
.canva-anim-bounce.trigger-start,
.canva-anim-bounce.trigger-scroll {
  animation: canvaBounceIn var(--anim-duration) cubic-bezier(0.215, 0.61, 0.355, 1) var(--anim-delay) forwards;
}
.canva-anim-bounce.trigger-loop {
  animation: canvaBounceLoop var(--anim-loop-duration) ease-in-out var(--anim-delay) infinite;
}

/* 5. TYPEWRITER EFFECT */
@keyframes canvaTypewriterIn {
  0% {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}
@keyframes canvaTypewriterLoop {
  0%, 10% {
    clip-path: inset(0 100% 0 0);
    opacity: 1;
  }
  45%, 75% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
  90%, 100% {
    clip-path: inset(0 0 0 100%);
    opacity: 0.4;
  }
}
.canva-anim-typewriter.trigger-start,
.canva-anim-typewriter.trigger-scroll {
  animation: canvaTypewriterIn var(--anim-duration) steps(30, end) var(--anim-delay) forwards;
}
.canva-anim-typewriter.trigger-loop {
  animation: canvaTypewriterLoop calc(var(--anim-loop-duration) * 1.5) ease-in-out var(--anim-delay) infinite;
}

/* 6. GLITTER GLOW */
@keyframes canvaGlowIn {
  0% {
    opacity: 0;
    filter: drop-shadow(0 0 0px rgba(255,215,0,0));
    text-shadow: 0 0 0px rgba(255,215,0,0);
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(255,215,0,0.85));
    text-shadow: 0 0 16px rgba(255,215,0,0.9), 0 0 28px rgba(255,215,0,0.6);
  }
}
@keyframes canvaGlowLoop {
  0%, 100% {
    filter: drop-shadow(0 0 4px rgba(255,215,0,0.5));
    text-shadow: 0 0 6px rgba(255,215,0,0.6), 0 0 12px rgba(255,215,0,0.3);
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(255,215,0,0.95));
    text-shadow: 0 0 20px rgba(255,215,0,1), 0 0 36px rgba(255,223,0,0.8), 0 0 50px rgba(255,215,0,0.6);
  }
}
.canva-anim-glow.trigger-start,
.canva-anim-glow.trigger-scroll {
  animation: canvaGlowIn var(--anim-duration) ease-out var(--anim-delay) forwards;
}
.canva-anim-glow.trigger-loop {
  animation: canvaGlowLoop var(--anim-loop-duration) ease-in-out var(--anim-delay) infinite;
}

/* CANVAS OVERLAYS */
.canvas-scene-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 5;
}
.canvas-audio-visualizer {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  z-index: 5;
}
.viz-bar {
  width: 3px;
  height: 100%;
  background: var(--accent-gold);
  border-radius: 2px;
  animation: vizJump 0.8s ease-in-out infinite alternate;
}
.viz-bar:nth-child(2) { animation-delay: 0.2s; }
.viz-bar:nth-child(3) { animation-delay: 0.4s; }
.viz-bar:nth-child(4) { animation-delay: 0.1s; }

@keyframes vizJump {
  0% { height: 20%; }
  100% { height: 100%; }
}

/* VIDEO CONTROLS BAR */
.video-controls-bar {
  padding: 16px 20px;
  background: #200e16;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
}
.btn-control-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.btn-control-play:hover {
  transform: scale(1.08);
}
.video-progress-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.video-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
}
.video-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--primary-gradient);
  transition: width 0.1s linear;
}
.video-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #f7cbd5;
  font-weight: 600;
}

/* BOTTOM ACTION BAR IN CUSTOMIZER */
.customizer-checkout-box {
  margin-top: 20px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.summary-title {
  font-size: 15px;
  font-weight: 700;
}
.summary-price {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
}
.btn-proceed-pay {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(230, 57, 86, 0.35);
  transition: all 0.25s;
}
.btn-proceed-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(230, 57, 86, 0.5);
}

/* RENDERING SPINNER MODAL */
.render-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.render-overlay.active {
  opacity: 1;
  visibility: visible;
}
.render-spinner {
  width: 70px;
  height: 70px;
  border: 5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}
.render-progress-text {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}
.render-subtext {
  font-size: 14px;
  color: #f7cbd5;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 992px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .preview-sticky-wrapper {
    position: static;
  }
  .video-canvas-container {
    max-height: 440px;
  }
}
