/* preview-modal.css */
:root {
  --navy: #17145f;
  --text: #11163b;
  --muted: #58617f;
  --line: #dde3ef;
  --bg-soft: #f0f2f7;
  --white: #ffffff;
}

/* Modal Overlay - Lightened Transparency */
.preview-modal {
  position: fixed; 
  inset: 0; 
  display: none; 
  align-items: center; 
  justify-content: center;
  padding: 24px; 
  background: rgba(11, 15, 43, 0.4); /* Lowered from 0.85 to 0.4 */
  backdrop-filter: blur(4px); /* Kept light blur for focus */
  z-index: 3000;
}
.preview-modal.is-open { display: flex; }

/* Fixed Dimension Card */
.preview-card {
  width: 95vw; 
  max-width: 1100px; 
  height: 80vh; 
  min-height: 550px;
  background: var(--white); 
  border-radius: 24px; 
  display: flex; 
  flex-direction: column; 
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15); 
  overflow: hidden;
}

/* Navy Header Section */
.preview-head {
  padding: 20px 32px; 
  background: var(--navy); 
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; 
  justify-content: space-between; 
  align-items: center;
}
.preview-head h3 { margin: 0; font-size: 22px; color: #ffffff; letter-spacing: -0.5px; }
.preview-head p { margin: 4px 0 0; color: rgba(255,255,255,0.7); font-size: 14px; }

.preview-close {
  background: rgba(255,255,255,0.1); 
  border: none; 
  width: 36px; 
  height: 36px; 
  border-radius: 8px;
  font-size: 24px; 
  cursor: pointer; 
  color: #ffffff; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  transition: background 0.2s;
}
.preview-close:hover { background: rgba(255,255,255,0.2); }

/* Layout Grid */
.preview-body { display: grid; grid-template-columns: 1.25fr 0.75fr; flex: 1; overflow: hidden; }

/* Media Stage (Left) */
.preview-stage { background: var(--bg-soft); padding: 30px; overflow-y: auto; height: 100%; }
.preview-media-grid { display: grid; gap: 12px; }
.preview-media-grid.count-1 .media-item { aspect-ratio: 16/9; }
.preview-media-grid.count-2 { grid-template-columns: 1fr 1fr; }
.preview-media-grid.count-3 { grid-template-columns: 1fr 1fr; }
.preview-media-grid.count-3 .media-item:first-child { grid-column: span 2; }

.media-item {
  position: relative; 
  background: #e6ebf5; 
  border-radius: 12px; 
  overflow: hidden;
  border: 1px solid var(--line); 
  display: flex; 
  align-items: center; 
  justify-content: center;
}
.media-item.is-broken::before { content: "🖼️"; font-size: 40px; opacity: 0.2; }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Panel Section (Right) */
.preview-panel { padding: 30px; border-left: 1px solid var(--line); overflow-y: auto; height: 100%; }
.preview-step {
  padding: 16px; 
  border-radius: 12px; 
  background: #f8fafc; 
  margin-bottom: 10px;
  cursor: pointer; 
  display: flex; 
  gap: 12px; 
  border: 2px solid transparent; 
  transition: all 0.2s ease;
}
.preview-step.active-step { background: #fff; border-color: var(--navy); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

.step-no {
  width: 24px; 
  height: 24px; 
  background: #ddd; 
  border-radius: 50%; 
  display: flex;
  align-items: center; 
  justify-content: center; 
  font-size: 11px; 
  font-weight: 800; 
  flex-shrink: 0;
}
.preview-step.active-step .step-no { background: var(--navy); color: #fff; }
.preview-step h4 { margin: 0 0 4px; font-size: 16px; color: var(--text); }
.preview-step p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Responsive */
@media (max-width: 900px) {
  .preview-body { grid-template-columns: 1fr; }
  .preview-panel { border-left: none; border-top: 1px solid var(--line); }
}

/* --- Polished Demo Modal --- */
.demo-modal {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(11, 15, 43, 0.5); backdrop-filter: blur(6px); z-index: 4000;
}
.demo-modal.is-open { display: flex; animation: modalFadeIn 0.3s ease; }

.demo-modal-card {
  width: 100%; max-width: 680px; background: #fff; border-radius: 24px;
  padding: 40px; box-shadow: 0 25px 70px rgba(0,0,0,0.25); border: 1px solid var(--line);
}

/* --- Optimized Header Fix --- */
.demo-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; 
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: nowrap; /* This is the key "no-wrap" fix */
}

/* This targets the div containing the H3 and P */
.demo-modal-head > div {
  flex: 1;
  min-width: 0; 
}

.demo-modal-head h3 { 
  margin: 0; 
  color: var(--navy); 
  font-size: 28px; /* Slightly smaller to prevent crowding */
  letter-spacing: -0.5px; 
  font-weight: 800;
  line-height: 1.2;
}

.demo-modal-head p { 
  margin: 4px 0 0; 
  color: var(--muted); 
  font-size: 14px; 
  line-height: 1.4; 
}
/* Form Elements */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.demo-field label {
  display: block; font-size: 13px; font-weight: 700; color: var(--navy);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}

.demo-field input, .demo-field select, .demo-field textarea {
  width: 100%; padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 12px;
  background: #f8fafc; font-family: inherit; font-size: 15px; color: var(--text);
  transition: all 0.2s ease;
}

.demo-field input:focus, .demo-field select:focus, .demo-field textarea:focus {
  outline: none; border-color: var(--navy); background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 20, 95, 0.1);
}

/* Button Styling */
.demo-submit-wrap {
  margin-top: 32px; display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px; border-top: 1px solid #edf2f7;
}

.demo-btn {
  background: var(--navy); color: #fff; padding: 16px 32px; border: none;
  border-radius: 14px; font-weight: 700; cursor: pointer; transition: transform 0.2s;
}
.demo-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(23, 20, 95, 0.2); }

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) { .demo-grid { grid-template-columns: 1fr; } }

/* 1. The container that holds everything */
.custom-multiselect {
  position: relative;
  width: 100%;
}

/* 2. The box the user clicks on */
.select-display {
  padding: 13px 14px;
  border: 1px solid #d9e1ef;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
}

/* 3. The little arrow on the right */
.select-display::after {
  content: "▾";
  position: absolute;
  right: 15px;
  color: #58617f;
}

/* 4. The actual list (HIDDEN BY DEFAULT) */
.options-container {
  display: none; /* This is the key "hide" command */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d9e1ef;
  border-radius: 12px;
  margin-top: 5px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 3000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* 5. Show the list only when this class is added via JS */
.options-container.is-active { 
  display: block; 
}

/* Fixes the jagged alignment and the big gap */
.options-container label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important; /* This controls the space between box and text */
  padding: 10px 14px !important;
  cursor: pointer;
  font-weight: 400 !important;
  color: #11163b !important;
  border-bottom: 1px solid #f3f6fb;
  margin: 0 !important;
  transition: background 0.2s ease;
  font-size: 14px !important;
  line-height: 1 !important; /* Keeps text from shifting vertically */
}

/* Ensure the checkbox itself doesn't have extra "push" */
.options-container input[type="checkbox"] {
  margin: 0 !important;
  width: 16px !important;
  height: 16px !important;
  cursor: pointer;
  flex-shrink: 0; /* Prevents the box from getting squished */
}

.options-container label:hover {
  background: #f1f4fa !important;
}

/* Optional: Adds a subtle scrollbar for a pro feel */
.options-container::-webkit-scrollbar {
  width: 6px;
}
.options-container::-webkit-scrollbar-thumb {
  background: #d9e1ef;
  border-radius: 10px;
}