/* ===== EDITOR LAYOUT ===== */
.editor-body {
  background: #fff5f7;
  min-height: 100vh;
  overflow: hidden;
}

.editor-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.topbar-left .logo { font-size: 1.1rem; }
.topbar-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dark);
}

.topbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.875rem;
}

.editor-layout {
  display: flex;
  height: 100vh;
  padding-top: 60px;
}

/* ===== LEFT PANEL ===== */
.editor-panel {
  width: 420px;
  min-width: 380px;
  background: white;
  border-right: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: #fff8f9;
  overflow-x: auto;
  flex-shrink: 0;
}

.panel-tab {
  flex: 1;
  min-width: 80px;
  padding: 14px 8px;
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.25s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.panel-tab:hover { color: var(--dark); }
.panel-tab.active {
  color: var(--gold-dark);
  border-bottom-color: var(--gold);
  background: white;
}

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

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Form styles */
.form-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.form-section-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #f0d8e0;
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fff8f9;
  color: var(--dark);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 70px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 6px 12px;
  background: #fff8f9;
  border-radius: 8px;
  border: 1px solid #f0d8e0;
  transition: all 0.2s;
}

.radio-label:has(input:checked) {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-dark);
}

.radio-label input { accent-color: var(--gold); }

.family-block {
  background: #fff8f9;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.family-block h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--dark);
}

.hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.875rem;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #e8c8d0;
  border-radius: 24px;
  transition: 0.3s;
}

.slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: var(--gold);
}

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

/* Upload zone */
.upload-zone {
  border: 2px dashed #e8c8d0;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: #fff8f9;
  position: relative;
  overflow: hidden;
}

.upload-zone:hover {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.05);
}

.upload-zone.multi { padding: 20px; }

.upload-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.upload-placeholder p { font-size: 0.9rem; font-weight: 500; margin-bottom: 4px; }
.upload-placeholder small { font-size: 0.75rem; color: var(--text-light); }

.upload-preview {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.gallery-thumbs .thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.gallery-thumbs .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs .thumb .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Timeline */
.timeline-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.timeline-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.timeline-item .tl-time {
  width: 100px;
  padding: 8px 10px;
  border: 1px solid #f0d8e0;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #fff8f9;
}

.timeline-item .tl-event {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #f0d8e0;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #fff8f9;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fce4ec;
  color: var(--text-light);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #f8d0d8;
  color: #c0392b;
}

/* Style templates */
.style-templates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.style-item {
  text-align: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 12px;
  border: 2px solid transparent;
  transition: all 0.25s;
}

.style-item:hover { background: #fff8f9; }
.style-item.active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}

.style-preview {
  height: 70px;
  border-radius: 8px;
  margin-bottom: 6px;
}

.style-preview.classic { background: linear-gradient(145deg, #1a1410, #3d2b1f); }
.style-preview.modern { background: linear-gradient(145deg, #f5f0eb, #e8dfd4); }
.style-preview.floral { background: linear-gradient(145deg, #fdf2f4, #f8e4e8); }
.style-preview.luxury { background: linear-gradient(145deg, #1a1410, #2c241c); }
.style-preview.style-3d {
  background:
    linear-gradient(135deg, rgba(232,160,180,.5), transparent 50%),
    linear-gradient(225deg, rgba(201,168,76,.4), transparent 50%),
    linear-gradient(145deg, #2a1520, #5c1a2a);
  position: relative;
  overflow: hidden;
}
.style-preview.style-3d::after {
  content: '';
  position: absolute; inset: 12px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 4px;
  transform: perspective(200px) rotateY(-12deg);
  background: rgba(255,255,255,.08);
}

.style-item span {
  font-size: 0.8rem;
  font-weight: 500;
}

.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.25s;
}

.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active {
  border-color: var(--dark);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--dark);
}

/* ===== PREVIEW AREA ===== */
.preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8e8ec;
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
}

.device-switch {
  display: flex;
  gap: 4px;
  background: white;
  border-radius: 8px;
  padding: 3px;
}

.device-btn {
  width: 36px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.device-btn.active {
  background: var(--gold);
  box-shadow: 0 2px 6px rgba(201,168,76,0.3);
}

.preview-frame-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.preview-frame {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  overflow: hidden;
  transition: all 0.4s ease;
}

.preview-frame.mobile {
  width: 375px;
  max-width: 100%;
  min-height: 700px;
}

.preview-frame.desktop {
  width: 100%;
  max-width: 680px;
  min-height: 800px;
}

/* ===== INVITATION STYLES ===== */
.invitation {
  font-family: var(--font-sans);
  color: var(--dark);
  min-height: 100%;
}

.inv-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  overflow: hidden;
}

.inv-hero.classic {
  background: linear-gradient(160deg, #1a1410 0%, #2c241c 50%, #3d2b1f 100%);
  color: var(--gold-light);
}

.inv-hero.modern {
  background: linear-gradient(160deg, #faf6f0, #f0e8dc);
  color: var(--dark);
}

.inv-hero.floral {
  background: linear-gradient(160deg, #fdf6f7, #f8e8ec);
  color: #8b4550;
}

.inv-hero.luxury {
  background: linear-gradient(160deg, #0f0c0a 0%, #1a1410 40%, #2a2018 100%);
  color: var(--gold);
}

.inv-hero.\\3d,
.inv-hero[class~="3d"] {
  background: linear-gradient(160deg, #2a1520 0%, #5c1a2a 45%, #c48b98 100%);
  color: #fff8f0;
  perspective: 800px;
}
.invitation.is-3d .inv-hero {
  animation: hero3dFloat 6s ease-in-out infinite;
}
@keyframes hero3dFloat {
  0%, 100% { transform: rotateY(-4deg) rotateX(2deg); }
  50% { transform: rotateY(4deg) rotateX(-2deg); }
}

.inv-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

.inv-title {
  font-family: var(--font-script);
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.inv-names {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.inv-names .amp {
  font-family: var(--font-script);
  font-size: 1.6rem;
  display: block;
  margin: 4px 0;
  opacity: 0.8;
}

.inv-date {
  font-size: 0.95rem;
  letter-spacing: 2px;
  opacity: 0.85;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.inv-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(201, 168, 76, 0.5);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.inv-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(160deg, rgba(255,255,255,0.15), rgba(0,0,0,0.08));
  border: 2px dashed rgba(201, 168, 76, 0.45);
  color: inherit;
  opacity: 0.85;
}

.inv-photo-empty span { font-size: 1.6rem; opacity: 0.8; }
.inv-photo-empty small {
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.7;
}

.inv-section {
  padding: 32px 28px;
  text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.inv-section:last-child { border-bottom: none; }

.inv-section-title {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--gold-dark);
  margin-bottom: 16px;
}

.inv-intro {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-light);
  font-style: italic;
  max-width: 320px;
  margin: 0 auto;
}

.inv-family {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  text-align: center;
}

.inv-family h4 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--gold-dark);
}

.inv-family p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text);
}

.inv-event-card {
  background: #fff8f9;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  text-align: left;
}

.inv-event-card h4 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--dark);
}

.inv-event-card .time {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin-bottom: 4px;
}

.inv-event-card .address {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.countdown-item {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: white;
  border-radius: 12px;
  padding: 12px 10px;
  min-width: 64px;
  text-align: center;
}

.countdown-item .num {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.countdown-item .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
}

.inv-timeline {
  text-align: left;
  max-width: 280px;
  margin: 0 auto;
}

.inv-timeline-item {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-left: 2px solid var(--gold);
  margin-left: 8px;
  padding-left: 16px;
  position: relative;
}

.inv-timeline-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 16px;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
}

.inv-timeline-item .tl-t {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gold-dark);
  min-width: 50px;
}

.inv-timeline-item .tl-e {
  font-size: 0.9rem;
}

.rsvp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: white;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.35);
  transition: all 0.3s;
  margin-top: 8px;
}

.rsvp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(201, 168, 76, 0.45);
}

.inv-thanks {
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--gold-dark);
  line-height: 1.5;
}

.inv-footer {
  padding: 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-light);
  background: #fff8f9;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.4s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.success-icon { font-size: 3rem; margin-bottom: 12px; }

.modal-body h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.modal-body p {
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.share-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.share-link-box input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #f0d8e0;
  border-radius: 10px;
  font-size: 0.85rem;
  background: #fff8f9;
}

.share-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Responsive editor */
@media (max-width: 900px) {
  .editor-layout {
    flex-direction: column;
  }

  .editor-panel {
    width: 100%;
    min-width: 100%;
    height: auto;
    max-height: 50vh;
  }

  .preview-area {
    height: 50vh;
  }

  .preview-frame.mobile {
    width: 100%;
    max-width: 340px;
  }

  .btn-preview-mobile {
    display: inline-flex;
  }
}

@media (min-width: 901px) {
  #btnPreviewMobile { display: none; }
}

/* Demo music list */
.demo-music-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.demo-music-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 160, 180, 0.25);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: 0.2s;
}
.demo-music-item:hover { border-color: #e8a0b4; }
.demo-music-item.active {
  border-color: #d47890;
  background: #fdf0f4;
  box-shadow: 0 0 0 2px rgba(212, 120, 144, 0.2);
}
.demo-music-item.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.demo-music-item .play-ico {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #f0b8c8, #d47890);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; flex-shrink: 0;
}
.demo-music-item span { font-size: 0.88rem; font-weight: 500; }
