/* =============================================================================
   DARQO REAL ESTATE OS — CINEMA VIDEO LIGHTBOX MODAL & AI SHOWCASE
   Palette: emerald (#072b26 / #0b3a34 / #0f4a42) + gold (#efc970 / #f8e2a4)
   — matches the redesigned home / corporate / about pages.
   ============================================================================= */

#darqo-video-modal {
  --dvm-emerald-950: #05211d;
  --dvm-emerald-900: #072b26;
  --dvm-emerald-800: #0b3a34;
  --dvm-emerald-700: #0f4a42;
  --dvm-gold-300: #f8e2a4;
  --dvm-gold-400: #efc970;
  --dvm-gold-600: #c9963a;
  --dvm-text-soft: #cfe0db;
  --dvm-line: rgba(248, 226, 164, 0.18);

  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(3, 20, 17, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#darqo-video-modal.active {
  opacity: 1;
  pointer-events: auto;
}

#darqo-video-modal button { font-family: inherit; }

.darqo-cinema-frame {
  max-width: 1080px;
  width: 100%;
  max-height: calc(100dvh - 2rem);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--dvm-emerald-800) 0%, var(--dvm-emerald-900) 100%);
  border: 1px solid rgba(248, 226, 164, 0.3);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(14px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
  font-family: 'Cairo', 'DM Sans', sans-serif;
  color: #ffffff;
}
.darqo-cinema-frame::-webkit-scrollbar { display: none; }

#darqo-video-modal.active .darqo-cinema-frame {
  transform: scale(1) translateY(0);
}

/* ── Header ── */
.darqo-cinema-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--dvm-line);
}

.darqo-cinema-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dvm-brand-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(239, 201, 112, 0.4));
}

.dvm-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.3;
}
.dvm-title b { font-family: 'DM Sans', sans-serif; color: var(--dvm-gold-300); font-weight: 800; }

.dvm-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--dvm-text-soft);
}

.dvm-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dvm-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9999px;
  background: rgba(5, 33, 29, 0.6);
  border: 1.5px solid rgba(248, 226, 164, 0.4);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
}
.dvm-chip i { color: var(--dvm-gold-400); }
.dvm-chip:hover { border-color: var(--dvm-gold-400); background: rgba(255, 255, 255, 0.08); }

.dvm-close {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: rgba(5, 33, 29, 0.6);
  border: 1.5px solid rgba(248, 226, 164, 0.4);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}
.dvm-close:hover { background: var(--dvm-gold-400); color: var(--dvm-emerald-900); border-color: var(--dvm-gold-400); }

.darqo-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f5b83d;
  box-shadow: 0 0 8px #f5b83d;
  animation: darqoPulse 2s infinite ease-in-out;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes darqoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.3); }
}

/* Voiceover active state */
.darqo-voice-active {
  background: linear-gradient(145deg, #fbe7ad 0%, #f2cf7c 100%) !important;
  color: var(--dvm-emerald-900) !important;
  border-color: var(--dvm-gold-300) !important;
}
.darqo-voice-active i { color: var(--dvm-emerald-900) !important; }

/* ── Screen ── */
.darqo-cinema-screen-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 62vh;
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
}

.darqo-cinema-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

/* AI Storyboard layer */
.darqo-storyboard-layer {
  position: absolute;
  inset: 0;
  display: none;
  background: var(--dvm-emerald-950);
  overflow: hidden;
}
.darqo-storyboard-layer.active { display: block; }

.darqo-storyboard-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: darqoKenBurns 18s ease-in-out infinite alternate;
  filter: brightness(0.8) saturate(1.1);
  transition: background-image 0.6s ease;
}

@keyframes darqoKenBurns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1.5%, -1%); }
}

.darqo-storyboard-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(5, 33, 29, 0.92) 0%, rgba(5, 33, 29, 0.35) 45%, rgba(5, 33, 29, 0.15) 70%, rgba(5, 33, 29, 0.55) 100%);
  pointer-events: none;
}

.darqo-storyboard-hud {
  position: absolute;
  inset: 0;
  padding: 20px 24px 70px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none;
}

.dvm-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dvm-hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 9999px;
  background: rgba(5, 33, 29, 0.72);
  border: 1px solid rgba(248, 226, 164, 0.4);
  font-size: 12px;
  font-weight: 800;
  color: var(--dvm-gold-300);
  backdrop-filter: blur(8px);
}
.dvm-hud-pill.muted { color: var(--dvm-text-soft); font-weight: 600; }

.darqo-hud-card {
  max-width: 600px;
  background: rgba(7, 43, 38, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(248, 226, 164, 0.35);
  border-radius: 22px;
  padding: 18px 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  margin-top: auto;
  animation: darqoFadeInUp 0.45s ease-out;
  pointer-events: auto;
}
.darqo-hud-card h4 { font-size: 20px; font-weight: 900; color: #ffffff; margin: 0 0 6px; }
.darqo-hud-card p { font-size: 13.5px; line-height: 1.7; color: #e3eeeb; margin: 0 0 12px; }

.dvm-hud-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--dvm-line);
  padding-top: 10px;
}
.dvm-hud-kpi { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 800; color: var(--dvm-gold-300); }
.dvm-hud-kpi i { color: var(--dvm-gold-400); }

.dvm-hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: linear-gradient(145deg, #fbe7ad 0%, #f2cf7c 100%);
  color: var(--dvm-emerald-900);
  font-size: 12px;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

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

/* Big center play / replay button */
.darqo-cinema-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fbe7ad 0%, #f2cf7c 60%, #e2b257 100%);
  border: 0;
  color: var(--dvm-emerald-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 0 0 10px rgba(248, 226, 164, 0.18), 0 14px 34px rgba(0, 0, 0, 0.45);
  z-index: 20;
}
.darqo-cinema-center-btn:hover {
  transform: translate(-50%, -50%) scale(1.07);
  box-shadow: 0 0 0 14px rgba(248, 226, 164, 0.22), 0 18px 40px rgba(0, 0, 0, 0.5);
}

/* Bottom controls */
.darqo-cinema-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(5, 33, 29, 0.95) 0%, rgba(5, 33, 29, 0.55) 60%, transparent 100%);
  padding: 18px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 25;
}
/* Tour mode has no seekable timeline */
.darqo-cinema-screen-wrap.is-tour .darqo-progress-track,
.darqo-cinema-screen-wrap.is-tour #darqoVolumeBtn,
.darqo-cinema-screen-wrap.is-tour #darqoTimeDisplay { display: none; }

.darqo-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
  position: relative;
  cursor: pointer;
  transition: height 0.15s ease;
}
.darqo-progress-track:hover,
.darqo-progress-track:focus-visible { height: 9px; }

.darqo-progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  background: linear-gradient(270deg, var(--dvm-gold-600), var(--dvm-gold-300));
  border-radius: 9999px;
  transition: width 0.1s linear;
}
/* thumb at the leading edge (RTL: fill grows from the right) */
.darqo-progress-fill::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dvm-gold-300);
  box-shadow: 0 0 0 3px rgba(5, 33, 29, 0.6);
  transform: translate(-50%, -50%);
}

.darqo-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.dvm-ctrl-group { display: flex; align-items: center; gap: 14px; }

.dvm-ctrl {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.dvm-ctrl:hover { background: rgba(255, 255, 255, 0.12); color: var(--dvm-gold-300); }

.dvm-time {
  color: var(--dvm-text-soft);
  font-family: 'DM Sans', monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dvm-chapter-label { color: var(--dvm-gold-300); font-weight: 800; font-size: 12.5px; }

/* ── Chapters bar ── */
.darqo-cinema-chapters-bar {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--dvm-line);
}

.darqo-chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 16px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(5, 33, 29, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  cursor: pointer;
  /* colours switch instantly; only motion/border animate (an 'all' transition
     could leave a pill stuck half-way between active and inactive colours) */
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.darqo-chapter-pill:hover { border-color: var(--dvm-gold-400); transform: translateY(-1px); }

.darqo-chapter-pill.active {
  background: linear-gradient(145deg, #fbe7ad 0%, #f2cf7c 100%);
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--dvm-emerald-900);
  box-shadow: 0 6px 16px rgba(239, 201, 112, 0.3);
}

.darqo-pill-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(248, 226, 164, 0.18);
  color: var(--dvm-gold-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 900;
  font-family: 'DM Sans', sans-serif;
}
.darqo-chapter-pill.active .darqo-pill-num { background: var(--dvm-emerald-700); color: var(--dvm-gold-300); }

/* ── Footer ── */
.darqo-cinema-footer {
  padding: 14px 20px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.darqo-cinema-status { display: flex; align-items: center; gap: 12px; }
.dvm-foot-icon {
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  background: var(--dvm-emerald-700);
  border: 2px solid var(--dvm-gold-400);
  color: var(--dvm-gold-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.dvm-foot-title { font-size: 15px; font-weight: 900; color: #ffffff; }
.dvm-foot-kpi { font-size: 12px; font-weight: 700; color: var(--dvm-gold-300); }

.darqo-cinema-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.dvm-btn-ghost,
.dvm-btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.dvm-btn-ghost {
  background: rgba(5, 33, 29, 0.45);
  border: 1.5px solid rgba(239, 201, 112, 0.75);
  color: #ffffff;
}
.dvm-btn-ghost:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
.dvm-btn-gold {
  background: linear-gradient(145deg, #fbe7ad 0%, #f2cf7c 60%, #e2b257 100%);
  border: 0;
  color: var(--dvm-emerald-900);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}
.dvm-btn-gold:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3); }

/* ── Accessibility ── */
#darqo-video-modal button:focus-visible,
#darqo-video-modal [tabindex]:focus-visible {
  outline: 3px solid var(--dvm-gold-400);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  #darqo-video-modal,
  .darqo-cinema-frame,
  .darqo-hud-card,
  .darqo-chapter-pill,
  .darqo-cinema-center-btn { transition: none !important; animation: none !important; }
  .darqo-storyboard-bg { animation: none !important; }
  .darqo-live-dot { animation: none !important; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #darqo-video-modal { padding: 0; align-items: flex-end; }
  .darqo-cinema-frame { border-radius: 22px 22px 0 0; max-height: 100dvh; }
  .darqo-cinema-header { padding: 12px 14px; }
  .dvm-brand-mark { width: 32px; height: 32px; }
  .dvm-title { font-size: 13.5px; }
  .dvm-subtitle { display: none; }
  .dvm-chip span { display: none; }
  .dvm-chip { width: 36px; padding: 0; justify-content: center; }
  .darqo-cinema-screen-wrap { max-height: none; }
  .darqo-storyboard-hud { padding: 12px 12px 58px; }
  .dvm-hud-pill.muted { display: none; }
  .darqo-hud-card { padding: 12px 14px; border-radius: 16px; }
  .darqo-hud-card h4 { font-size: 15px; }
  .darqo-hud-card p { display: none; }
  .dvm-hud-btn { display: none; }
  .darqo-cinema-center-btn { width: 60px; height: 60px; font-size: 19px; }
  .dvm-chapter-label { display: none; }
  .darqo-cinema-chapters-bar { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 10px 14px; }
  .darqo-cinema-chapters-bar::-webkit-scrollbar { display: none; }
  .darqo-chapter-pill { flex-shrink: 0; }
  .darqo-cinema-footer { padding: 12px 14px 16px; }
  .darqo-cinema-actions { width: 100%; }
  .dvm-btn-ghost, .dvm-btn-gold { flex: 1 1 100%; }
}
