/* Wedding Editor V2 - Canva-inspired Styles */

/* Font Declarations - Matching Backend Fonts */
@font-face {
  font-family: 'Andalucia';
  src: url("/assets/Andalucia-7fee7b9b.ttf") format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Maginia';
  src: url("/assets/Maginia-526547fe.otf") format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'BrushScript';
  src: url("/assets/BrushScript-f4f01bab.ttf") format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* Note: Herculanum and MarkerFelt are system fonts referenced in Ruby code
   Using CSS fallbacks that match the style */

/* ============================================
   PHOTO UPLOAD SCREEN STYLES
   ============================================ */

.photo-upload-screen {
  position: fixed !important;
  top: 72px !important;
  left: 240px !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf3 100%);
  z-index: 100 !important;
  overflow-y: auto;
  transition: left 0.3s ease;
}

.upload-screen-container {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}

/* When sidebar is collapsed */
body.sidebar-collapsed .photo-upload-screen {
  left: 60px !important;
}

/* Mobile - cover entire screen */
@media (max-width: 768px) {
  .photo-upload-screen {
    top: 60px !important;
    left: 0 !important;
  }
  
  .upload-screen-container {
    min-height: calc(100vh - 60px);
  }
}

/* Header */
.upload-screen-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 20px 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.upload-header-content {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.back-button {
  background: #f3f4f6;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #374151;
}

.back-button:hover {
  background: #e5e7eb;
  transform: translateX(-2px);
}

.upload-title {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px 0;
}

.upload-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
}

/* Main Content */
.upload-screen-content {
  flex: 1;
  max-width: 100%;
  margin: 40px auto;
  padding: 0 40px 40px 40px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 500px;
  gap: 40px;
  align-items: start;
}

/* Examples Section (Left) */
.upload-examples-section {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.examples-header {
  margin-bottom: 24px;
}

.examples-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
}

.examples-header p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.example-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.example-photo-card {
  text-align: center;
}

.example-photo-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.example-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.example-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(34, 197, 94, 0.95);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.example-caption {
  text-align: left;
}

.example-caption strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.example-caption p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

/* Photo Tips */
.photo-tips {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 24px;
  border-radius: 12px;
  color: white;
}

.photo-tips h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: white;
}

.photo-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.photo-tips li {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
  color: rgba(255, 255, 255, 0.95);
}

.photo-tips li:before {
  content: '•';
  position: absolute;
  left: 0;
  font-weight: bold;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
}

.photo-tips li:last-child {
  margin-bottom: 0;
}

.photo-tips strong {
  color: white;
  font-weight: 600;
}

/* Upload Form Section (Right) */
.upload-form-section {
  position: sticky;
  top: 40px;
}

.upload-form-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.upload-form-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f3f4f6;
}

.upload-form-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
}

.upload-form-header p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.upload-inputs-container {
  margin-bottom: 24px;
}

/* ============================================
   EVENT CONFIGURATION SCREEN
   ============================================ */

.event-config-content {
  flex: 1;
  max-width: 900px;
  margin: 40px auto;
  padding: 0 40px 40px 40px;
  width: 100%;
}

.config-form-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.config-section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 2px solid #f3f4f6;
}

.config-section:last-of-type {
  border-bottom: none;
  margin-bottom: 32px;
}

.config-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
}

.config-section-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px 0;
}

.event-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.event-option-card {
  position: relative;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.event-option-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.event-option-card input[type="checkbox"],
.event-option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.event-option-card input:checked + .event-icon,
.event-option-card input:checked ~ .event-icon {
  transform: scale(1.2);
}

.event-option-card input:checked ~ * {
  color: #667eea;
}

.event-option-card:has(input:checked) {
  border-color: #667eea;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.event-icon {
  font-size: 36px;
  transition: transform 0.2s ease;
  margin-bottom: 4px;
}

.event-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  transition: color 0.2s ease;
}

.event-description {
  font-size: 11px;
  color: #6b7280;
  transition: color 0.2s ease;
}

/* Attire Inputs */
.attire-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.input-group {
  margin-bottom: 0;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

.label-icon {
  font-size: 18px;
}

.text-input,
.textarea-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  transition: all 0.2s ease;
  font-family: inherit;
}

.text-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.text-input::placeholder,
.textarea-input::placeholder {
  color: #9ca3af;
}

.textarea-input {
  resize: vertical;
  min-height: 120px;
}

.input-hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 6px 0 0 0;
}

/* Prompt Section */
.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-slider {
  position: relative;
  width: 48px;
  height: 26px;
  background: #e5e7eb;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: #667eea;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

/* Form Actions */
.config-form-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

/* Responsive */
@media (max-width: 768px) {
  .event-config-content {
    padding: 0 20px 24px 20px;
    margin: 24px auto;
  }

  .config-form-card {
    padding: 24px;
  }

  .attire-inputs-grid {
    grid-template-columns: 1fr;
  }

  .prompt-header {
    flex-direction: column;
    gap: 16px;
  }

  .config-form-actions {
    flex-direction: column;
  }

  .btn-secondary-large,
  .btn-primary-large {
    width: 100%;
  }
}

/* Credit Info Box */
.credit-info-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.credit-info-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.credit-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.credit-label {
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.credit-balance {
  font-size: 14px;
  color: #78350f;
  margin: 0;
  line-height: 1.6;
}

/* Form Actions */
.upload-form-actions {
  display: flex;
  gap: 12px;
}

.btn-secondary-large {
  flex: 1;
  padding: 14px 24px;
  border: 2px solid #e5e7eb;
  background: white;
  color: #374151;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary-large:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-primary-large {
  flex: 2;
  padding: 14px 24px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary-large:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.btn-primary-large:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Responsive */
@media (max-width: 1200px) {
  .upload-screen-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .upload-form-section {
    position: static;
  }
}

@media (max-width: 768px) {
  .upload-screen-header {
    padding: 16px 20px;
  }

  .upload-screen-content {
    padding: 0 20px 24px 20px;
    margin: 24px auto;
  }

  .upload-title {
    font-size: 22px;
  }

  .upload-examples-section,
  .upload-form-card {
    padding: 24px;
  }

  .example-photos-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .upload-form-actions {
    flex-direction: column;
  }

  .btn-secondary-large,
  .btn-primary-large {
    width: 100%;
  }
}

/* ============================================
   GENERATION PROGRESS SCREEN
   ============================================ */

.generation-progress-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 72px);
  padding: 40px;
  background: transparent;
}

.generation-progress-card {
  background: white;
  border-radius: 20px;
  padding: 48px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.progress-icon {
  margin-bottom: 24px;
}

.spinner-large {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  border: 6px solid #f3f4f6;
  border-top: 6px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.progress-title {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
}

.progress-subtitle {
  font-size: 16px;
  color: #6b7280;
  margin: 0 0 32px 0;
}

.progress-status {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-value {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.status-value.processing {
  color: #667eea;
}

.status-value.completed {
  color: #10b981;
}

.status-value.failed {
  color: #ef4444;
}

.progress-bar-container {
  margin-bottom: 40px;
}

.progress-bar {
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 999px;
  transition: width 0.5s ease;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 2px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
}

.progress-step.active .step-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-align: center;
}

.progress-step.active .step-label {
  color: #667eea;
}

.progress-info {
  background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
  border-radius: 12px;
  padding: 20px;
  margin-top: 32px;
}

.progress-info p {
  font-size: 14px;
  color: #4c1d95;
  margin: 0 0 8px 0;
  line-height: 1.6;
}

.progress-info p:last-child {
  margin-bottom: 0;
}

.completed-slides {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px solid #f3f4f6;
}

.completed-slides h4 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px 0;
}

.slides-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.slide-preview-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slide-preview-thumb img,
.slide-preview-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-preview-thumb video {
  background: #000;
  cursor: pointer;
}

.slide-preview-thumb video:hover {
  opacity: 0.9;
}

.slide-number {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .generation-progress-container {
    padding: 20px;
  }

  .generation-progress-card {
    padding: 32px 24px;
  }

  .progress-title {
    font-size: 22px;
  }

  .progress-status {
    flex-direction: column;
    gap: 16px;
  }

  .progress-steps {
    flex-wrap: wrap;
  }

  .step-label {
    font-size: 10px;
  }
}

/* Global Editor Container */
.wedding-editor-container {
  position: fixed;
  top: 72px; /* Account for main app header */
  left: 0;
  right: 0;
  bottom: 0;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 768px) {
  .wedding-editor-container {
    top: 60px; /* Smaller header on mobile */
  }
}

/* Loading Screen */
.editor-loading {
  position: fixed;
  top: 72px; /* Match editor container top */
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

@media (max-width: 768px) {
  .editor-loading {
    top: 60px;
  }
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-spinner-large {
  width: 60px;
  height: 60px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #667eea;
  border-right: 5px solid #764ba2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toolbar */
.editor-toolbar {
  height: 60px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.toolbar-left h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #333;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.credit-badge {
  padding: 8px 16px;
  background: linear-gradient(135deg, #f8f9ff 0%, #e8ebfa 100%);
  border: 1px solid #e0e7ff;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
}

/* Main Editor Workspace */
.editor-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  z-index: 1;
  /* Account for main app sidebar (240px or 256px) */
  margin-left: 256px;
  width: calc(100% - 256px);
  transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* Adjust editor-main when sidebar is collapsed */
body.sidebar-collapsed .editor-main,
.sidebar.collapsed ~ * .editor-main {
  margin-left: 64px;
  width: calc(100% - 64px);
}

/* Mobile: no sidebar margin */
@media (max-width: 768px) {
  .editor-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

.editor-workspace {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  /* Ensure workspace takes full available width */
  flex: 1;
  min-width: 0;
}

/* Left Sidebar - Workflow Tree */
.editor-sidebar-left {
  width: 240px; /* Reduced from 280px */
  background: white;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.editor-sidebar-left .sidebar-header {
  padding: 12px 15px; /* Reduced vertical padding */
  border-bottom: 1px solid #e0e0e0;
}

.editor-sidebar-left .sidebar-header h3 {
  margin: 0 0 3px 0;
  font-size: 15px;
  font-weight: 600;
}

.workflow-tree {
  flex: 1;
  overflow-y: auto;
  padding: 12px; /* Reduced from 15px */
}

.workflow-slides-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workflow-slide-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.workflow-slide-item:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateX(3px);
}

.workflow-slide-item.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.slide-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-right: 12px;
  flex-shrink: 0;
}

.workflow-slide-item.selected .slide-number {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.slide-details {
  display: flex;
  align-items: center;
  flex: 1;
}

.slide-icon {
  font-size: 22px;
  margin-right: 10px;
}

.slide-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.workflow-slide-item.selected .slide-name {
  font-weight: 600;
}

/* Workflow Info Card (Sidebar) */
.workflow-info-card {
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border-radius: 10px;
  padding: 15px; /* Reduced from 20px */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0; /* Reduced from 12px */
  border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item:first-child {
  padding-top: 0;
}

.info-label {
  font-size: 12px; /* Reduced from 13px */
  color: #666;
  font-weight: 500;
}

.info-value {
  font-size: 13px; /* Reduced from 14px */
  color: #333;
  font-weight: 600;
}

.info-value.completed {
  color: #10b981;
}

.info-value.pending {
  color: #f59e0b;
}

/* Center Canvas */
.editor-canvas {
  flex: 1;
  background: #e8e8e8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 200; /* Higher than sidebars to ensure filmstrip is on top */
  min-width: 0; /* Prevent flex item from overflowing */
  isolation: isolate; /* Create new stacking context */
  /* Ensure canvas takes full available width between sidebars */
  width: 100%;
  max-width: 100%;
}

.canvas-header {
  min-height: 60px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.canvas-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.canvas-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.canvas-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f9fafb;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* Prevent flex overflow */
  isolation: isolate; /* Create new stacking context */
  z-index: 1; /* Ensure it's above any background elements */
  /* Ensure viewport takes full available width */
  margin: 0;
  padding: 0;
}

.canvas-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px;
  background: #ffffff;
  position: relative;
  min-height: 0; /* Allow flex shrinking */
  width: 100%;
  max-width: 100%;
  /* Ensure content is truly centered */
  margin: 0 auto;
}

/* Fabric.js Canvas Styling */
#wedding-canvas {
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  background: white;
}

.preview-canvas-9-16 {
  width: 360px;
  height: 640px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.preview-placeholder {
  width: 360px;
  height: 640px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.preview-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

/* Configuration Preview Placeholder */
.config-preview-placeholder {
  width: 360px;
  height: 640px;
  background: linear-gradient(135deg, #fef7ed 0%, #fff9f0 50%, #fef7ed 100%);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.invitation-preview-mock {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #fffbf5 100%);
}

/* Decorative Borders */
.preview-decorative-top,
.preview-decorative-bottom {
  height: 40px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    #d4af37 10%, 
    #d4af37 20%, 
    transparent 30%,
    transparent 70%,
    #d4af37 80%,
    #d4af37 90%,
    transparent 100%
  );
  position: relative;
  opacity: 0.6;
}

.preview-decorative-top::before,
.preview-decorative-bottom::before {
  content: '✦ ✦ ✦';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #d4af37;
  font-size: 14px;
  letter-spacing: 8px;
  font-weight: 300;
}

.preview-decorative-top {
  border-radius: 12px 12px 0 0;
}

.preview-decorative-bottom {
  border-radius: 0 0 12px 12px;
  margin-top: auto;
}

/* Main Content */
.preview-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
}

.preview-couple-icon {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.preview-invitation-title {
  font-size: 28px;
  font-weight: 700;
  color: #8b4513;
  margin: 0 0 20px 0;
  font-family: 'Georgia', 'Times New Roman', serif;
  letter-spacing: 1px;
}

.preview-divider {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
  margin: 0 auto 24px;
  position: relative;
}

.preview-divider::before,
.preview-divider::after {
  content: '❦';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #d4af37;
  font-size: 16px;
}

.preview-divider::before {
  left: -20px;
}

.preview-divider::after {
  right: -20px;
}

.preview-invitation-text {
  font-size: 16px;
  color: #5a4a3a;
  margin: 0 0 12px 0;
  font-family: 'Georgia', serif;
  line-height: 1.6;
}

.preview-invitation-subtext {
  font-size: 13px;
  color: #8b7355;
  margin: 0;
  font-style: italic;
  line-height: 1.5;
}

/* Preview Badge */
.preview-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-icon {
  font-size: 12px;
}

.badge-text {
  font-size: 10px;
}

/* Right Sidebar - Properties Panel */
.editor-sidebar-right {
  width: 400px;
  background: white;
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.editor-sidebar-right .sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #fafafa;
}

.editor-sidebar-right .sidebar-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.properties-panel {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

/* Configuration Sidebar Styles */
.config-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.config-section-sidebar {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f3f4f6;
}

.config-section-sidebar:last-of-type {
  border-bottom: none;
}

.config-section-title-sidebar {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px 0;
}

.config-section-subtitle-sidebar {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

/* Event Options Grid - Sidebar */
.event-options-grid-sidebar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.event-option-card-sidebar {
  position: relative;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.event-option-card-sidebar:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.event-option-card-sidebar input[type="checkbox"],
.event-option-card-sidebar input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.event-option-card-sidebar:has(input:checked) {
  border-color: #667eea;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.event-icon-sidebar {
  font-size: 24px;
  transition: transform 0.2s ease;
  margin-bottom: 2px;
}

.event-name-sidebar {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  transition: color 0.2s ease;
}

.event-description-sidebar {
  font-size: 10px;
  color: #6b7280;
  transition: color 0.2s ease;
}

/* Event Attire Fields */
.event-attire-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.event-attire-card {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 0;
}

.event-attire-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
  padding: 8px 12px;
  margin: -8px -12px 12px -12px;
  border-radius: 8px 8px 0 0;
}

.event-attire-header:hover {
  background-color: #f3f4f6;
}

.event-attire-title {
  font-size: 14px;
  font-weight: 700;
  color: #667eea;
  margin: 0;
  text-transform: capitalize;
  flex: 1;
}

.attire-toggle-btn {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  padding: 0;
  margin-left: 8px;
}

.attire-toggle-btn:hover {
  background-color: #e5e7eb;
}

.toggle-icon {
  font-size: 20px;
  font-weight: bold;
  color: #667eea;
  line-height: 1;
}

.event-attire-content {
  transition: opacity 0.2s ease;
}

/* Progressive Slide Display Styles */
.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.filmstrip-thumb {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.filmstrip-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  z-index: 10;
}

.attire-placeholder {
  text-align: center;
  padding: 20px;
}

/* Input Groups - Sidebar */
.input-group-sidebar {
  margin-bottom: 0;
}

.input-label-sidebar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

.label-icon {
  font-size: 16px;
}

.text-input-sidebar,
.textarea-input-sidebar {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #111827;
  transition: all 0.2s ease;
  font-family: inherit;
}

.text-input-sidebar:focus,
.textarea-input-sidebar:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.text-input-sidebar::placeholder,
.textarea-input-sidebar::placeholder {
  color: #9ca3af;
}

.textarea-input-sidebar {
  resize: vertical;
  min-height: 100px;
}

.input-hint-sidebar {
  font-size: 11px;
  color: #9ca3af;
  margin: 6px 0 0 0;
}

/* Prompt Header - Sidebar */
.prompt-header-sidebar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

/* Toggle Switch - Sidebar */
.toggle-switch-sidebar {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toggle-switch-sidebar input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-slider-sidebar {
  position: relative;
  width: 40px;
  height: 22px;
  background: #e5e7eb;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.toggle-slider-sidebar::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch-sidebar input:checked + .toggle-slider-sidebar {
  background: #667eea;
}

.toggle-switch-sidebar input:checked + .toggle-slider-sidebar::before {
  transform: translateX(18px);
}

/* Credit Info Box - Sidebar */
.credit-info-box-sidebar {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #fbbf24;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 20px;
}

.credit-info-content-sidebar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.credit-icon-sidebar {
  font-size: 24px;
  flex-shrink: 0;
}

.credit-label-sidebar {
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  margin: 0 0 4px 0;
}

.credit-balance-sidebar {
  font-size: 13px;
  color: #78350f;
  margin: 0;
  line-height: 1.4;
}

/* Config Action Section */
.config-action-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid #f3f4f6;
}

.btn-primary-sidebar {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary-sidebar:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary-sidebar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.action-hint {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  margin: 10px 0 0 0;
}

.properties-header h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.property-group {
  margin-bottom: 20px;
}

.property-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

.property-input,
.property-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.property-textarea {
  resize: vertical;
  min-height: 80px;
}

.property-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
}

.hint-text {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
}

.placeholders-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.placeholder-btn {
  padding: 6px 10px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.placeholder-btn:hover {
  background: #e0e0e0;
  border-color: #667eea;
}

/* Buttons */
.btn-primary,
.btn-cancel,
.btn-secondary,
.btn-back,
.btn-icon,
.btn-choose-asset {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-cancel {
  background: #e0e0e0;
  color: #333;
}

.btn-cancel:hover {
  background: #d0d0d0;
}

.btn-back {
  background: transparent;
  color: #667eea;
  border: 1px solid #667eea;
}

.btn-icon {
  padding: 8px 12px;
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.btn-icon:hover {
  background: #e8e8e8;
}

.btn-choose-asset {
  width: 100%;
  background: #f5f5f5;
  color: #333;
  border: 2px dashed #ddd;
  text-align: left;
}

.btn-choose-asset:hover {
  border-color: #667eea;
  background: #fafafa;
}

.btn-remove {
  background: transparent;
  color: #e53e3e;
  border: none;
  padding: 2px 8px;
  font-size: 20px;
  cursor: pointer;
  border-radius: 4px;
}

.btn-remove:hover {
  background: rgba(229, 62, 62, 0.1);
}

/* Modals */
.editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-content,
.modal-content-large {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-content-large {
  max-width: 900px;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.btn-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.btn-close:hover {
  background: #f0f0f0;
  color: #333;
}

.modal-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Upload Grid */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.upload-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-label {
  font-weight: 500;
  font-size: 14px;
}

.required-mark {
  color: #e53e3e;
  margin-left: 2px;
}

.upload-dropzone {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.upload-dropzone:hover {
  border-color: #667eea;
  background: #f5f7ff;
}

.upload-dropzone.dragover {
  border-color: #667eea;
  background: #e8ebfa;
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.browse-link {
  color: #667eea;
  text-decoration: underline;
  cursor: pointer;
}

.upload-hint {
  font-size: 12px;
  color: #999;
  margin-top: 5px;
}

.file-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.file-preview img {
  width: 100%;
  border-radius: 6px;
}

.remove-file {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #e53e3e;
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-file:hover {
  background: #c53030;
}

/* Asset Browser */
.asset-browser-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.tab-btn:hover {
  color: #333;
  background: #f5f5f5;
}

.asset-search {
  margin-bottom: 20px;
}

.asset-search input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  max-height: 400px;
  overflow-y: auto;
}

.asset-card {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.asset-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.asset-thumbnail {
  width: 100%;
  height: 120px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.asset-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-placeholder {
  font-size: 48px;
}

.asset-info {
  padding: 10px;
}

.asset-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-meta {
  font-size: 11px;
  color: #999;
}

/* Review Summary */
.review-summary {
  padding: 20px 0;
}

.review-section {
  margin-bottom: 30px;
}

.review-section h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #333;
}

.review-section ul {
  list-style: none;
  padding: 0;
}

.review-section li {
  padding: 12px;
  background: #f5f5f5;
  border-radius: 6px;
  margin-bottom: 10px;
}

.warning {
  color: #e53e3e;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .editor-sidebar-left,
  .editor-sidebar-right {
    width: 240px;
  }
}

@media (max-width: 768px) {
  .editor-workspace {
    flex-direction: column;
  }

  .editor-sidebar-left,
  .editor-sidebar-right {
    width: 100%;
    max-height: 30vh;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* Utility Classes */
.no-selection {
  padding: 40px 20px;
  text-align: center;
  color: #999;
}

.form-select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

.form-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.loading,
.error,
.no-assets {
  padding: 40px;
  text-align: center;
  color: #999;
}

.error {
  color: #e53e3e;
}

.credit-check-section {
  margin-top: 20px;
  padding: 15px;
  background: #f5f7ff;
  border: 1px solid #d0d7ff;
  border-radius: 8px;
}

.credit-info p {
  margin: 5px 0;
}

/* Job Progress Styles */
.job-progress-container,
.job-results-container {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.progress-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-header h3 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #333;
  font-weight: 600;
}

.progress-header p {
  font-size: 16px;
  color: #666;
  margin-top: 10px;
}

.progress-bar {
  width: 100%;
  max-width: 600px;
  height: 12px;
  background: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  margin: 20px auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.5s ease;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
  }
}

.slides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin: 30px 0;
  padding: 0 20px;
}

@media (min-width: 1400px) {
  .slides-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

.slide-preview-card,
.slide-result-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.slide-preview-card:hover,
.slide-result-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.slide-preview-card.pending {
  border: 2px solid #e5e7eb;
}

.slide-preview-card.completed {
  border: 2px solid #10b981;
}

.slide-preview-card.completed:hover {
  border-color: #059669;
}

@keyframes pulse-card {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.9;
  }
}

.slide-result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.slide-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 177.78%; /* 9:16 aspect ratio */
  background: #f5f5f5;
  overflow: hidden;
}

.slide-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-thumbnail.blurred img {
  filter: blur(10px);
}

.placeholder-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
}

/* Shimmer effect for loading slides */
.slide-preview-card.pending .slide-thumbnail::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.slide-result-card:hover .slide-overlay,
.slide-preview-card:hover .slide-overlay {
  opacity: 1;
}

.btn-view,
.btn-download,
.btn-edit,
.btn-edit-overlay {
  background: white;
  color: #667eea;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-view:hover,
.btn-download:hover,
.btn-edit:hover,
.btn-edit-overlay:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  background: #667eea;
  color: white;
}

/* Overlay Editor Styles */
.current-slide-preview {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  margin-bottom: 30px;
}

.current-slide-preview h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
}

.overlay-grid-section h4 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
}

.asset-grid-overlay {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
}

.overlay-option {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.overlay-option:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.overlay-option.selected {
  border-color: #10b981;
  background: #f0fdf4;
}

.overlay-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 177.78%; /* 9:16 aspect ratio */
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.overlay-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.current-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #10b981;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.overlay-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  color: #333;
}

.btn-select-overlay {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-select-overlay:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.overlay-option.selected .btn-select-overlay {
  background: #10b981;
}

.overlay-option.selected .btn-select-overlay:hover {
  background: #059669;
}

/* Text Editor Styles (Canva-like) */
.text-editor-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
  max-height: 600px;
}

.text-editor-preview {
  display: flex;
  flex-direction: column;
}

.text-editor-preview h4,
.text-editor-fields h4 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.slide-preview-container {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  background: #f5f5f5;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.slide-preview-image {
  width: 100%;
  display: block;
}

.text-overlay-preview {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  text-align: center;
  color: #333;
  font-family: 'Georgia', serif;
  pointer-events: none;
}

.text-preview-event-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
  color: #1a1a1a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.text-preview-event-date {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}

.text-preview-event-time {
  font-size: 12px;
  margin-bottom: 6px;
  color: #333;
}

.text-preview-event-venue {
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  color: #333;
}

.text-editor-fields {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-right: 10px;
}

.text-field-group {
  margin-bottom: 20px;
}

.text-field-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.text-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.text-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #999;
  font-style: italic;
}

.text-editor-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.text-editor-actions .btn-secondary,
.text-editor-actions .btn-primary {
  flex: 1;
  padding: 12px 20px;
  font-size: 15px;
}

/* Additional button style for text button */
.btn-edit-text {
  background: white;
  color: #667eea;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-edit-text:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  background: #667eea;
  color: white;
}

.slide-info {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slide-info h4 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.status-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.status-badge.completed {
  background: #d4edda;
  color: #155724;
}

.status-badge.pending {
  background: #fff3cd;
  color: #856404;
}

.progress-footer {
  text-align: center;
  margin-top: 30px;
  padding: 20px;
}

.progress-footer button {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.progress-footer button:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.results-header {
  text-align: center;
  margin-bottom: 30px;
}

.results-header h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #333;
}

.results-header p {
  color: #666;
  font-size: 16px;
}

/* Success Notification */
.success-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  background: #d4edda;
  color: #155724;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.success-notification p {
  margin: 0 0 10px 0;
  font-weight: 600;
}

.success-notification button {
  background: #155724;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.success-notification button:hover {
  background: #0f4419;
}

/* Single Slide View */
.single-slide-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
}

.slide-preview-large {
  position: relative;
  max-width: 450px;
  width: 100%;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  margin-bottom: 30px;
}

.slide-thumbnail-large {
  position: relative;
  width: 100%;
  padding-top: 177.78%; /* 9:16 aspect ratio */
  background: #f5f5f5;
  overflow: hidden;
}

.slide-thumbnail-large img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-thumbnail-large.blurred img {
  filter: blur(8px);
}

.placeholder-icon-large {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  opacity: 0.3;
}

.generating-overlay,
.no-preview-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  font-weight: 600;
  font-size: 16px;
  color: #667eea;
  text-align: center;
  z-index: 10;
}

.no-preview-overlay {
  color: #999;
  background: rgba(255, 255, 255, 0.9);
}

.slide-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.edit-slide-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.edit-slide-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.status-text {
  font-size: 16px;
  color: #666;
  padding: 15px 30px;
  background: #fff3cd;
  border-radius: 8px;
  margin: 0;
}

/* Properties Panel Enhancements */
.slide-status-card {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8ebfa 100%);
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 25px;
  border: 2px solid #e0e7ff;
}

.status-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.slide-status-card h5 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #333;
}

.slide-status-card p {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.edit-options h5 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.edit-option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #999;
  cursor: not-allowed;
  transition: all 0.2s ease;
}

.edit-option-btn:not(:disabled) {
  color: #333;
  cursor: pointer;
  border-color: #667eea;
}

.edit-option-btn:not(:disabled):hover {
  background: #f8f9ff;
  transform: translateX(3px);
}

.coming-soon {
  font-size: 11px;
  padding: 3px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-weight: 600;
}

/* ============================================
   CANVA-LIKE EDITOR LAYOUT
   ============================================ */

/* Main Canva Layout */
.canva-editor-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: #f5f5f5;
}

.canva-main-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 20px;
  overflow: hidden;
}

.canvas-slide-container {
  height: calc(90vh - 180px); /* Fill height minus toolbar and filmstrip */
  width: auto;
  aspect-ratio: 9 / 16;
  max-width: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.editable-slide {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide-base-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Overlay PNG Layer - Draggable */
.slide-overlay-image {
  position: absolute;
  width: 100%;
  height: 30%; /* Default: 30% height at bottom */
  bottom: 0;
  left: 0;
  object-fit: contain;
  object-position: bottom center;
  z-index: 2;
  cursor: move;
  transition: opacity 0.2s ease;
  opacity: 0.9;
}

.slide-overlay-image:hover {
  opacity: 1;
  outline: 2px dashed #667eea;
}

.slide-overlay-image.dragging {
  cursor: grabbing;
  opacity: 0.7;
}

/* Text Overlay Container */
.text-overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

/* Editable Text Elements - Base Styles */
.text-element {
  position: absolute;
  cursor: text;
  outline: none;
  transition: all 0.2s ease;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid transparent;
  min-width: 80px;
  text-align: center;
  color: #FFFFFF; /* Pure white - matches backend */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Better contrast for white text */
  left: 10%;
  right: 10%;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.text-element:hover:not(:focus) {
  background: rgba(102, 126, 234, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
}

.text-element:focus,
.text-element.editing {
  background: rgba(102, 126, 234, 0.15);
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

/* Event Name - Andalucia Font, 70px, NOT bold */
.text-event-name {
  font-family: 'Andalucia', 'Brush Script MT', 'Great Vibes', cursive;
  font-size: 70px;
  font-weight: normal; /* NOT bold for title */
  top: calc(70% + 60px); /* Overlay starts at 70%, plus 60px padding */
  line-height: 1.2;
}

.text-edit-indicator {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #667eea;
  color: white;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.text-element:hover .text-edit-indicator {
  opacity: 1;
}

.text-element.selected .text-edit-indicator {
  opacity: 1;
  background: #10b981;
}

/* Event Date - Maginia Font, 37px, bold */
.text-event-date {
  font-family: 'Maginia', 'Playfair Display', 'Georgia', serif;
  font-size: 37px;
  font-weight: bold;
  top: calc(70% + 170px); /* 60px padding + 110px offset */
  line-height: 1.3;
}

/* Event Time - Maginia Font, 35px, bold */
.text-event-time {
  font-family: 'Maginia', 'Playfair Display', 'Georgia', serif;
  font-size: 35px;
  font-weight: bold;
  top: calc(70% + 210px); /* 60px padding + 150px offset */
  line-height: 1.3;
}

/* Event Venue - Maginia Font, 37px, bold */
.text-event-venue {
  font-family: 'Maginia', 'Playfair Display', 'Georgia', serif;
  font-size: 37px;
  font-weight: bold;
  top: calc(70% + 250px); /* 60px padding + 190px offset */
  line-height: 1.3;
}

/* Event Location - Maginia Font, 33px, bold */
.text-event-location {
  font-family: 'Maginia', 'Playfair Display', 'Georgia', serif;
  font-size: 33px;
  font-weight: bold;
  top: calc(70% + 290px); /* 60px padding + 230px offset */
  line-height: 1.3;
}

/* Overlay Controls */
.overlay-controls {
  padding: 15px;
  background: white;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid #e5e7eb;
}

.overlay-controls h5 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 0 0 12px 0;
}

.overlay-control-group {
  margin-bottom: 12px;
}

.overlay-control-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #666;
  margin-bottom: 6px;
}

.overlay-control-group input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.overlay-control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
}

.overlay-control-group input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
}

.overlay-value-display {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #667eea;
  margin-left: 8px;
}

.overlay-preset-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-overlay-preset {
  flex: 1;
  padding: 6px 12px;
  font-size: 11px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-overlay-preset:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.btn-overlay-preset.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* Bottom Filmstrip */
.canva-filmstrip {
  height: 120px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  clip-path: inset(0);
  contain: layout style paint;
  /* Ensure filmstrip stays within canvas bounds - prevent horizontal overflow */
  left: 0;
  right: 0;
  /* Force containment */
  will-change: transform;
  transform: translateZ(0); /* Create new stacking context */
}

.filmstrip-header {
  padding: 8px 20px;
  background: #f9fafb;
  color: #1f2937;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

.btn-change-overlay {
  background: #667eea;
  color: white;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-change-overlay:hover {
  background: #764ba2;
  transform: translateY(-1px);
}

.filmstrip-slides {
  flex: 1;
  display: flex;
  gap: 10px;
  padding: 8px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  background: white;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  position: relative;
  /* Prevent horizontal overflow beyond container */
  min-width: 0;
  contain: layout;
  /* Center align the slides */
  justify-content: center;
  align-items: center;
}

.filmstrip-slides::-webkit-scrollbar {
  height: 8px;
}

.filmstrip-slides::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

.filmstrip-slides::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.filmstrip-slides::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.filmstrip-slide {
  position: relative;
  width: 60px;
  height: 80px; /* 9:16 aspect ratio */
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #e5e7eb;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  background: white;
  contain: layout;
}

.filmstrip-slide:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.filmstrip-slide.active {
  border-color: #667eea;
  border-width: 3px;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.filmstrip-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.filmstrip-slide .slide-number {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(102, 126, 234, 0.9);
  color: white;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filmstrip-slide .slide-name {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  font-size: 9px;
  color: white;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 4px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  border-radius: 0 0 6px 6px;
}

/* Text Editor Panel (Right Sidebar) */
.text-editor-panel {
  padding: 15px 0;
}

.regeneration-note {
  margin-top: 15px;
  padding: 10px;
  background: #fff3cd;
  border: 1px solid #ffecb5;
  border-radius: 6px;
  text-align: center;
}

.regeneration-note small {
  color: #856404;
  font-size: 11px;
}

.slide-info-card {
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

