/* ==========================================================================
   Emad Afandi Cafe - World-Class Mobile Camera Experience
   Theme: Luxury Matte Charcoal (#16181a), Deep Black (#0a0a0a),
          Refined Satin Gold (#d4af37, #f5d77f), White (#ffffff)
   Typography: Noto Kufi Arabic, Outfit, Inter
   ========================================================================== */

:root {
  --font-kufi: 'Noto Kufi Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --color-black: #050505;
  --color-dark: #0f1012;
  --color-card: #16181a;
  --color-card-elevated: #1e2023;

  --color-gold: #d4af37;
  --color-gold-light: #f5d77f;
  --color-gold-dark: #a67c00;
  --color-gold-grad: linear-gradient(135deg, #f5d77f 0%, #d4af37 50%, #b8860b 100%);
  --color-gold-subtle: rgba(212, 175, 55, 0.22);
  --color-gold-glow: 0 0 20px rgba(212, 175, 55, 0.35);

  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --safe-top: env(safe-area-inset-top, 16px);
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body.app-body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
  inset: 0;
  background-color: var(--color-black);
  color: var(--text-primary);
  font-family: var(--font-kufi);
  touch-action: none;
}

/* -------------------------------------------------------------
   Camera Root & Canvas Stage
   ------------------------------------------------------------- */
.camera-root {
  width: 100%;
  max-width: 460px;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-black);
  overflow: hidden;
  margin: 0 auto;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

#camera-video {
  display: none;
}

.canvas-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

#photo-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Shutter Flash Animation */
.shutter-flash-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.12s ease-out;
}

.shutter-flash-overlay.active {
  opacity: 0.95;
}

/* -------------------------------------------------------------
   Top Navigation Bar (Safe Area)
   ------------------------------------------------------------- */
.top-nav-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(var(--safe-top) + 8px) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
  z-index: 30;
  pointer-events: auto;
}

.top-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 24, 26, 0.85);
  border: 1px solid var(--color-gold-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  color: var(--color-gold-light);
  font-family: var(--font-kufi);
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.top-pill-btn:active {
  transform: scale(0.94);
  background: rgba(212, 175, 55, 0.25);
}

.pill-dot {
  font-size: 0.85rem;
  line-height: 1;
}

.top-brand-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 10, 10, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand-gold-spark {
  color: var(--color-gold-light);
  font-size: 0.75rem;
}

.brand-text {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.4px;
}

.top-circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(22, 24, 26, 0.85);
  border: 1px solid var(--color-gold-subtle);
  color: var(--color-gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.top-circle-btn:active {
  transform: scale(0.9);
  background: rgba(212, 175, 55, 0.25);
}

/* Floating Guide Pill */
.floating-guide-pill {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 16, 18, 0.9);
  border: 1px solid var(--color-gold-subtle);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 0.72rem;
  color: var(--color-gold-light);
  font-weight: 700;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 25;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
  transition: opacity 0.4s ease;
}

/* Native Camera Fallback Banner (Discreet floating pill) */
.native-camera-fallback {
  position: absolute;
  bottom: 140px;
  left: 20px;
  right: 20px;
  max-width: 360px;
  margin: 0 auto;
  background: rgba(22, 24, 26, 0.95);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.85);
}

.native-camera-fallback span {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-open-native-cam {
  background: var(--color-gold-grad);
  border: none;
  color: #000;
  font-family: var(--font-kufi);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* -------------------------------------------------------------
   Bottom Camera Dock (Carousel + Shutter)
   ------------------------------------------------------------- */
.bottom-camera-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px calc(var(--safe-bottom) + 8px);
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.7) 65%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 30;
  pointer-events: auto;
}

/* AR Title Switcher Strip */
.title-picker-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(15, 16, 18, 0.85);
  border: 1px solid var(--color-gold-subtle);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transition: all 0.25s ease;
}

.title-picker-strip.hidden {
  display: none;
}

.picker-hint {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-gold-light);
  margin-left: 2px;
}

.title-pill-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #d1d5db;
  font-family: var(--font-kufi);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.title-pill-btn.active {
  background: var(--color-gold-grad);
  color: #000000;
  font-weight: 900;
  box-shadow: 0 1px 8px rgba(212, 175, 55, 0.5);
  transform: scale(1.05);
}

/* Filter Carousel Track */
.carousel-strip {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 4px;
}

.carousel-strip::-webkit-scrollbar {
  display: none;
}

.filter-capsules-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.filter-capsule {
  background: rgba(22, 24, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.capsule-icon {
  font-size: 0.82rem;
  line-height: 1;
}

.capsule-label {
  font-size: 0.69rem;
  font-weight: 700;
  color: #e2e8f0;
  font-family: var(--font-kufi);
  line-height: 1.2;
}

.filter-capsule.active {
  background: var(--color-gold-grad);
  border-color: #f5d77f;
  box-shadow: 0 2px 14px rgba(212, 175, 55, 0.45);
  transform: scale(1.03);
}

.filter-capsule.active .capsule-label {
  color: #000000;
  font-weight: 900;
}

/* Shutter Row */
.shutter-action-bar {
  width: 100%;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px 8px 0;
}

.dock-side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  min-width: 56px;
}

.dock-btn-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(22, 24, 26, 0.85);
  border: 1px solid var(--color-gold-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: all 0.18s ease;
}

.dock-side-btn:active .dock-btn-icon-box {
  transform: scale(0.9);
  background: rgba(212, 175, 55, 0.25);
}

.dock-btn-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Shutter Trigger */
.shutter-center-anchor {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shutter-trigger {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shutter-ring {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3.5px solid #ffffff;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 175, 55, 0.35);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s ease;
}

.shutter-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-gold-grad);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.shutter-trigger:active .shutter-ring {
  transform: scale(0.92);
  border-color: var(--color-gold);
}

.shutter-trigger:active .shutter-core {
  transform: scale(0.88);
}

/* -------------------------------------------------------------
   Post-Capture Bottom Sheet Drawer
   ------------------------------------------------------------- */
.post-capture-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.post-capture-sheet.hidden {
  opacity: 0;
  pointer-events: none;
}

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sheet-drawer {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  background: var(--color-card);
  border: 1px solid var(--color-gold-subtle);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  padding: 12px 18px calc(var(--safe-bottom) + 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.95), var(--color-gold-glow);
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-capture-sheet.hidden .sheet-drawer {
  transform: translateY(100%);
}

.drawer-pull-bar {
  width: 44px;
  height: 5px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 4px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title-group {
  text-align: right;
}

.drawer-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.drawer-subtitle {
  font-size: 0.72rem;
  color: var(--color-gold-light);
  font-weight: 600;
}

.btn-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-drawer-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Image Preview in Sheet */
.drawer-preview-wrap {
  position: relative;
  width: 100%;
  max-height: 34vh;
  display: flex;
  justify-content: center;
  background: #000;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gold-subtle);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.preview-aspect-box {
  height: 100%;
  aspect-ratio: 9 / 16;
  max-height: 34vh;
}

.drawer-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.preview-tag-badge {
  position: absolute;
  top: 8px;
  left: 10px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-gold-subtle);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-gold-light);
}

/* Clickable Mention Tutorial Guide */
.clickable-mention-card {
  background: rgba(212, 175, 55, 0.08);
  border: 1px dashed var(--color-gold);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}

.mention-guide-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-sparkle {
  font-size: 1rem;
}

.guide-head-text {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-gold-light);
}

.mention-guide-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.guide-step-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.step-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-gold);
  color: #000;
  font-weight: 900;
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.mention-hl {
  color: var(--color-gold-light);
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
}

/* Primary Platform Share Buttons */
.drawer-share-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-platform-share {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-kufi);
  text-align: right;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-platform-share:active {
  transform: scale(0.98);
}

.platform-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.ig-bg {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  box-shadow: 0 4px 12px rgba(223, 40, 159, 0.35);
}

.fb-bg {
  background: #1877f2;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.35);
}

.btn-ig-share {
  background: rgba(220, 39, 142, 0.1);
  border-color: rgba(220, 39, 142, 0.35);
}

.btn-ig-share:hover {
  background: rgba(220, 39, 142, 0.16);
}

.btn-fb-share {
  background: rgba(24, 119, 242, 0.1);
  border-color: rgba(24, 119, 242, 0.35);
}

.btn-fb-share:hover {
  background: rgba(24, 119, 242, 0.16);
}

.platform-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.platform-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.platform-hint {
  font-size: 0.67rem;
  color: var(--text-secondary);
}

.platform-chevron {
  font-size: 1.1rem;
  color: var(--color-gold-light);
}

/* Secondary Drawer Actions */
.drawer-sub-actions {
  display: flex;
  gap: 8px;
}

.btn-sub-action {
  flex: 1;
  background: var(--color-card-elevated);
  border: 1px solid var(--color-gold-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  color: var(--color-gold-light);
  font-family: var(--font-kufi);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-sub-action:active {
  transform: scale(0.97);
  background: rgba(212, 175, 55, 0.15);
}

/* Direct Social Page Links */
.direct-pages-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0 2px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.direct-page-link {
  color: var(--color-gold-light);
  text-decoration: none;
  font-weight: 700;
}

.direct-page-link:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------
   Stand & NFC Dialog
   ------------------------------------------------------------- */
.stand-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.stand-dialog-backdrop.hidden {
  display: none;
}

.stand-dialog-card {
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  background: var(--color-card);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.95), var(--color-gold-glow);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-header h3 {
  font-size: 1rem;
  color: var(--color-gold-light);
  font-weight: 800;
}

.btn-dialog-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-stand-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #000;
}

.btn-dialog-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--color-gold-grad);
  color: #000;
  font-weight: 800;
  padding: 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.82rem;
}

.nfc-quick-guide {
  background: #0f1012;
  border: 1px solid var(--color-gold-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: right;
}

.nfc-quick-guide h4 {
  font-size: 0.78rem;
  color: var(--color-gold-light);
  margin-bottom: 6px;
}

.nfc-quick-guide ol {
  padding-right: 18px;
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* -------------------------------------------------------------
   Toast Popup
   ------------------------------------------------------------- */
.toast-popup {
  position: fixed;
  bottom: 220px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 24, 26, 0.95);
  border: 1px solid var(--color-gold);
  color: var(--color-gold-light);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  z-index: 500;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-popup.hidden {
  opacity: 0;
  transform: translate(-50%, -10px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}
