:root {
  --bg-page: #05080f;
  --bg-phone: #0b0f17;
  --bg-panel: #111827;
  --bg-card: rgba(30, 41, 59, 0.65);
  --bg-card-hover: rgba(51, 65, 85, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-emerald: rgba(16, 185, 129, 0.45);
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --danger: #ef4444;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-arabic: 'Amiri', 'Traditional Arabic', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 20% 15%, rgba(16, 185, 129, 0.14), transparent 45%),
              radial-gradient(circle at 80% 85%, rgba(245, 158, 11, 0.1), transparent 45%),
              var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Top Showcase Header (Desktop Wrapper) */
.showcase-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--emerald-500), #047857);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-syariah {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.showcase-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.75);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-top:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-top.primary {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600));
  border-color: var(--emerald-400);
  color: #fff;
}

/* Main Workspace Layout */
.workspace-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 16px 24px;
}

/* Side Helper Cards on Desktop */
.desktop-side-info {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-card {
  background: rgba(17, 24, 39, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(12px);
}

.info-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--emerald-400);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
}

.shortcut-tip {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.shortcut-tip strong {
  color: var(--text-main);
}

/* MOBILE PHONE SIMULATOR FRAME */
.phone-frame {
  width: 406px;
  height: 852px;
  background: var(--bg-phone);
  border-radius: 48px;
  border: 10px solid #1e293b;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75),
              0 0 0 2px rgba(255, 255, 255, 0.08),
              0 0 50px rgba(16, 185, 129, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Dynamic Island & Status Bar */
.phone-statusbar {
  height: 36px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  background: #070a10;
  position: relative;
  flex-shrink: 0;
}

.dynamic-island {
  width: 96px;
  height: 20px;
  background: #000;
  border-radius: 20px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 7px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
}

.island-cam {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #1e3a8a 30%, #090d16 70%);
}

/* App Top Header Inside Phone */
.app-topbar {
  height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090d16;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.syariah-meter {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.35);
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-export {
  background: linear-gradient(135deg, var(--emerald-500), #047857);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-export:hover {
  filter: brightness(1.1);
}

/* VIDEO PREVIEW STAGE (9:16 Vertical Canvas Area) */
.preview-container {
  position: relative;
  height: 345px;
  background: #04060a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.tiktok-canvas-wrap {
  width: 194px;
  height: 335px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #111827;
}

#sceneCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

#uploadedVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  display: none;
}

/* Interactive Overlays inside 9:16 Canvas */
.canvas-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.draggable-item {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  transition: box-shadow 0.15s ease;
}

.draggable-item:active {
  cursor: grabbing;
}

.draggable-item.selected {
  outline: 1.5px dashed var(--emerald-400);
  outline-offset: 2px;
}

/* 1. Blur / Sensor Aurat Zone */
.blur-zone {
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(52, 211, 153, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.blur-zone.hide-guide {
  border-color: transparent;
}

.blur-badge {
  font-size: 8px;
  font-weight: 700;
  color: #ecfdf5;
  background: rgba(6, 78, 59, 0.78);
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.blur-zone.hide-guide .blur-badge {
  display: none;
}

/* 2. Ayat / Hadits Card Overlay */
.ayat-overlay-card {
  left: 10px;
  right: 10px;
  top: 42px;
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(9, 13, 22, 0.76);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(251, 191, 36, 0.35);
  text-align: center;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.ayat-overlay-card.style-emerald {
  background: linear-gradient(160deg, rgba(6, 78, 59, 0.88), rgba(9, 13, 22, 0.9));
  border-color: rgba(52, 211, 153, 0.5);
}

.ayat-overlay-card.style-gold {
  background: linear-gradient(160deg, rgba(69, 26, 3, 0.88), rgba(15, 23, 42, 0.9));
  border-color: rgba(251, 191, 36, 0.6);
}

.ayat-overlay-card.style-minimal {
  background: rgba(0, 0, 0, 0.38);
  border-color: rgba(255, 255, 255, 0.2);
}

.ayat-arabic {
  font-family: var(--font-arabic);
  font-size: 15px;
  line-height: 1.55;
  color: var(--gold-400);
  margin-bottom: 5px;
  direction: rtl;
}

.ayat-translation {
  font-size: 9.5px;
  line-height: 1.38;
  color: #f1f5f9;
  font-weight: 500;
  margin-bottom: 4px;
}

.ayat-source {
  font-size: 8px;
  font-weight: 700;
  color: var(--emerald-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 3. Stiker Islami Overlay */
.sticker-item {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(6, 78, 59, 0.88);
  border: 1px solid var(--gold-400);
  color: #fef3c7;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

/* TikTok Safe Area Guides */
.tiktok-safe-zone {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  opacity: 0.85;
}

.tiktok-right-icons {
  position: absolute;
  right: 7px;
  bottom: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.tt-icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.tiktok-bottom-caption {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 140px;
  line-height: 1.3;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 6px;
  border-radius: 6px;
}

/* Floating Quick Action Pills beside the 9:16 canvas */
.canvas-side-controls {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.canvas-left-controls {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-pill-btn {
  background: rgba(17, 24, 39, 0.88);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.mini-pill-btn:hover,
.mini-pill-btn.active {
  border-color: var(--emerald-400);
  color: var(--emerald-400);
  background: rgba(6, 78, 59, 0.45);
}

/* AI Scan Laser Animation */
.ai-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--emerald-400), var(--gold-400), transparent);
  box-shadow: 0 0 12px var(--emerald-400);
  top: -10px;
  opacity: 0;
  pointer-events: none;
}

.ai-scan-line.scanning {
  animation: scanSweep 1.3s ease-in-out forwards;
}

@keyframes scanSweep {
  0% { top: 0%; opacity: 1; }
  50% { top: 96%; opacity: 1; }
  100% { top: 0%; opacity: 0; }
}

/* PLAYBACK & TIMELINE SECTION */
.timeline-section {
  background: #090d16;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 12px 8px;
  flex-shrink: 0;
}

.playback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.play-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--emerald-500);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
}

.time-code {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted);
}

.timeline-tracks {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #05080e;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 25%;
  width: 2px;
  background: #fff;
  z-index: 10;
  pointer-events: none;
}

.playhead::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -4px;
  width: 10px;
  height: 10px;
  background: var(--emerald-400);
  border-radius: 2px;
  transform: rotate(45deg);
}

.track-row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 16px;
}

.track-label {
  width: 58px;
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.track-bar {
  flex: 1;
  height: 13px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding: 0 6px;
  overflow: hidden;
  white-space: nowrap;
}

.track-video {
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}

.track-aurat {
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.track-ayat {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}

.track-audio {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #d8b4fe;
}

/* TOOL DRAWER PANEL (Interactive Feature Content) */
.tool-drawer {
  flex: 1;
  background: var(--bg-panel);
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-drawer::-webkit-scrollbar {
  width: 4px;
}
.tool-drawer::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.tool-pane {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.tool-pane.active {
  display: flex;
}

/* Feature Cards inside Tool Drawer */
.feature-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
}

.feature-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.feature-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.feature-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: 0.2s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--emerald-500);
}
input:checked + .slider:before {
  transform: translateX(16px);
}

/* Audio List Items */
.audio-chips-filter {
  display: flex;
  gap: 6px;
}

.chip-btn {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.chip-btn.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border-color: var(--emerald-500);
}

.item-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s;
}

.audio-row:hover,
.audio-row.selected {
  border-color: var(--emerald-400);
  background: rgba(6, 78, 59, 0.3);
}

.audio-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audio-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
}

.audio-sub {
  font-size: 9.5px;
  color: var(--text-muted);
}

.use-btn {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.4);
  cursor: pointer;
}

/* Stickers & Blur Controls */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.sticker-btn {
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.sticker-btn:hover {
  border-color: var(--gold-400);
  background: rgba(69, 26, 3, 0.35);
}

.range-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--emerald-500);
}

/* Bottom Navigation Tabs inside Phone */
.app-bottom-nav {
  height: 58px;
  background: #070a10;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px 6px;
  flex-shrink: 0;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.15s;
}

.nav-tab .tab-icon {
  font-size: 15px;
}

.nav-tab.active {
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
}

/* Modal Export Syariah Verified */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  background: #111827;
  border: 1px solid var(--border-emerald);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--emerald-400);
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(6, 78, 59, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.caption-box {
  width: 100%;
  height: 68px;
  background: #090d16;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  padding: 8px;
  font-size: 10.5px;
  font-family: var(--font-sans);
  resize: none;
  margin-bottom: 10px;
}

.toast-msg {
  position: absolute;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 78, 59, 0.95);
  color: #ecfdf5;
  border: 1px solid var(--emerald-400);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 60;
  white-space: nowrap;
}

.toast-msg.show {
  opacity: 1;
}

@media (max-width: 960px) {
  .desktop-side-info {
    display: none;
  }
}
