:root {
  --hikma-navy: #00263E;
  --hikma-deep-blue: #0A1C2A;
  --hikma-cyan: #00B5E2;
  --hikma-glow: rgba(0, 181, 226, 0.45);
  --hikma-white: #FFFFFF;
  --hikma-dark-surface: #0e1a2c;
  --hikma-card-border: rgba(0, 181, 226, 0.35);
  --hikma-accent: #38bdf8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--hikma-navy);
  color: var(--hikma-white);
}

.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  position: relative;
  background: radial-gradient(circle at 50% 20%, #0c2b48 0%, #001626 100%);
  overflow: hidden;
}

/* Header */
.app-header {
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(0, 38, 62, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 181, 226, 0.25);
  z-index: 50;
}

.header-logo {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.logo-pill {
  background: #FFFFFF;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.brand-logo {
  height: 26px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
}

.header-tagline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--hikma-cyan);
  text-transform: uppercase;
  background: rgba(0, 181, 226, 0.12);
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0, 181, 226, 0.35);
  white-space: nowrap;
}

.header-hikma {
  display: flex;
  align-items: center;
}

.hikma-header-logo {
  height: 20px;
  max-width: 90px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.welcome-logo-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  padding: 12px 24px;
  border-radius: 20px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 181, 226, 0.2);
  border: 1px solid rgba(0, 181, 226, 0.3);
}

.welcome-hero-logo {
  height: 60px;
  max-width: 240px;
  width: auto;
  object-fit: contain;
  display: block;
}

.powered-by-hikma {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 14px;
  border-radius: 16px;
  margin: 0 auto 20px;
}

.powered-text {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hikma-welcome-logo {
  height: 18px;
  max-width: 80px;
  width: auto;
  object-fit: contain;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-pill-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 181, 226, 0.4);
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.header-pill-btn:hover {
  background: rgba(0, 181, 226, 0.2);
  border-color: var(--hikma-cyan);
}

/* Screens */
.screen {
  flex: 1;
  display: none;
  position: relative;
  width: 100%;
  height: calc(100dvh - 60px);
  overflow-y: auto;
}

.screen.active {
  display: flex;
}

/* Welcome Screen */
#screen-welcome {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.welcome-card {
  width: 100%;
  max-width: 480px;
  background: rgba(14, 26, 44, 0.75);
  border: 1px solid var(--hikma-card-border);
  border-radius: 20px;
  padding: 30px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 181, 226, 0.1);
  text-align: center;
  backdrop-filter: blur(16px);
}

.product-badge {
  display: inline-block;
  background: rgba(0, 181, 226, 0.15);
  border: 1px solid var(--hikma-cyan);
  color: var(--hikma-cyan);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 12px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.event-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #FFFFFF 0%, #BAE6FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.event-subtitle {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 26px;
}

.section-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #7dd3fc;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.gender-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Signature Hikma Cutout Button */
.hikma-btn {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 64px;
  margin: 0 auto;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: transform 0.15s ease, filter 0.15s ease;
  user-select: none;
}

.hikma-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/assets/button-clean.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 4px 12px rgba(0, 181, 226, 0.45));
  transition: filter 0.2s ease;
  z-index: 1;
}

.hikma-btn:active {
  transform: scale(0.97);
}

.hikma-btn:hover::before {
  filter: drop-shadow(0 6px 18px rgba(0, 181, 226, 0.75)) brightness(1.1);
}

.hikma-btn>div,
.hikma-btn>span {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hikma-btn-content {
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-camera-icon,
.btn-vector-icon {
  flex-shrink: 0;
  stroke: #FFFFFF;
}

.btn-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: #BAE6FD;
  margin-top: 2px;
}

/* Booth Screen */
#screen-booth {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px 14px;
}

.booth-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
  height: 100%;
  justify-content: space-between;
}

/* 9:16 Portrait Stage Container */
.stage-container {
  position: relative;
  height: 63dvh;
  aspect-ratio: 9 / 16;
  width: auto;
  max-width: calc(100vw - 28px);
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 181, 226, 0.2);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: height 0.25s ease;
}

/* In Review Mode: Expand Stage to fill screen nicely! */
.booth-wrapper.in-review .stage-container {
  height: 73dvh;
  max-height: 620px;
}

.booth-wrapper.in-review .style-selector-section {
  display: none !important;
}

.stage-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.live-video {
  transition: transform 0.2s ease;
}

.live-video.mirrored {
  transform: scaleX(-1);
}

.stage-frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 5;
}

#stage-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hold Before/After Pill */
.compare-pill-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(14, 26, 44, 0.85);
  border: 1px solid var(--hikma-cyan);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 18px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 30;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  user-select: none;
}

.compare-pill-btn.visible {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stage-top-controls {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 30;
}

.stage-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(10, 24, 38, 0.88);
  border: 1px solid rgba(0, 181, 226, 0.45);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.stage-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: #FFFFFF;
  transition: stroke 0.2s ease;
}

.stage-icon-btn:hover {
  border-color: var(--hikma-cyan);
  background: rgba(0, 38, 62, 0.95);
  transform: scale(1.08);
}

.stage-icon-btn:hover svg {
  stroke: var(--hikma-cyan);
}

/* AI Laser Scan Overlay */
.ai-scan-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 22, 38, 0.88);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 40;
}

.ai-scan-overlay.active {
  display: flex;
}

.ai-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8, #00B5E2, #38bdf8, transparent);
  box-shadow: 0 0 15px #38bdf8, 0 0 30px #00B5E2;
  animation: laserScan 2.2s ease-in-out infinite alternate;
}

@keyframes laserScan {
  0% {
    top: 15%;
    opacity: 0.7;
  }

  100% {
    top: 85%;
    opacity: 1;
  }
}

.ai-spinner-ring {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(0, 181, 226, 0.2);
  border-top-color: var(--hikma-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 18px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-scan-title {
  font-size: 15px;
  font-weight: 800;
  color: #BAE6FD;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.ai-scan-sub {
  font-size: 12px;
  color: #94a3b8;
  max-width: 280px;
  line-height: 1.4;
}

/* Countdown & Flash */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: 0 0 30px var(--hikma-cyan);
  z-index: 35;
  background: rgba(0, 0, 0, 0.3);
}

.countdown-overlay.active {
  display: flex;
}

.flash-overlay {
  position: absolute;
  inset: 0;
  background: #FFFFFF;
  opacity: 0;
  pointer-events: none;
  z-index: 45;
  transition: opacity 0.1s ease;
}

.flash-overlay.flash {
  opacity: 0.9;
}

.status-pill {
  position: absolute;
  bottom: 12px;
  background: rgba(14, 26, 44, 0.85);
  border: 1px solid rgba(0, 181, 226, 0.35);
  color: #bae6fd;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  z-index: 25;
  max-width: 90%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hairstyle Selector */
.style-selector-section {
  width: 100%;
  margin-top: 8px;
}

.selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 4px;
}

.selector-title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.selector-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--hikma-cyan);
}

.style-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}

.style-option-card {
  background: rgba(14, 26, 44, 0.7);
  border: 1px solid rgba(0, 181, 226, 0.25);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.style-option-card.selected {
  border-color: var(--hikma-cyan);
  background: rgba(0, 181, 226, 0.22);
  box-shadow: 0 0 12px rgba(0, 181, 226, 0.4);
}

.style-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-bottom: 5px;
  color: #FFFFFF;
}

.style-badge svg {
  width: 20px;
  height: 20px;
  stroke: #FFFFFF;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.2s ease;
}

.style-option-card.selected .style-badge svg {
  stroke: var(--hikma-cyan);
  filter: drop-shadow(0 0 6px rgba(0, 181, 226, 0.65));
}

.style-name {
  font-size: 10.5px;
  font-weight: 600;
  color: #f1f5f9;
  text-align: center;
  line-height: 1.2;
}

/* Action Rows */
.booth-actions-row {
  width: 100%;
  margin-top: 8px;
}

.actions-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.secondary-actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.ghost-link-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.ghost-link-btn:hover {
  color: #e2e8f0;
}

/* Modals */
.app-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.app-modal.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: #0f1f33;
  border: 1px solid var(--hikma-card-border);
  border-radius: 20px;
  padding: 26px 20px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 18px;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  background: #071322;
  border: 1px solid rgba(0, 181, 226, 0.4);
  border-radius: 10px;
  color: #FFFFFF;
  font-size: 14px;
  margin-bottom: 20px;
  outline: none;
}

.modal-input:focus {
  border-color: var(--hikma-cyan);
  box-shadow: 0 0 10px var(--hikma-glow);
}

.modal-qr-box {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  background: #FFFFFF;
  padding: 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-buttons-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-btn {
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.modal-btn.primary {
  background: var(--hikma-cyan);
  color: #00263E;
}

.modal-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

/* Thank You Video Modal */
.video-modal .video-modal-card {
  width: 100%;
  max-width: 420px;
  height: 75dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.video-modal video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}

.retake-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 181, 226, 0.45);
  color: #E2E8F0;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

.retake-action-btn:hover {
  background: rgba(0, 181, 226, 0.2);
  border-color: var(--hikma-cyan);
}

.video-close-btn,
.video-skip-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.7);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  z-index: 30;
  backdrop-filter: blur(6px);
}

/* Post-Video Finish Overlay */
.post-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 22, 38, 0.94);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  border-radius: 16px;
}

.post-video-overlay.active {
  display: flex;
}

.post-video-card {
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(14, 26, 44, 0.9);
  border: 1px solid rgba(0, 181, 226, 0.35);
  border-radius: 20px;
  padding: 26px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.post-video-title {
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.post-video-subtitle {
  font-size: 13px;
  color: #94A3B8;
  margin-bottom: 20px;
}

.post-video-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.quit-action-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 320px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.quit-action-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(14, 26, 44, 0.95);
  border: 1px solid var(--hikma-cyan);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 200;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}


/* Mobile Header & Logo Responsiveness */
@media (max-width: 440px) {
  .app-header {
    padding: 0 10px;
  }

  .brand-logo {
    height: 22px;
  }

  .logo-pill {
    padding: 3px 8px;
  }

  .header-tagline {
    font-size: 9.5px;
    padding: 4px 8px;
    letter-spacing: 0px;
  }

  .hikma-header-logo {
    height: 16px;
  }

  .welcome-logo-capsule {
    padding: 10px 18px;
  }

  .welcome-hero-logo {
    height: 52px;
  }
}

/* Event Photo Disclaimer & Consent Box */
.event-disclaimer {
  margin-top: 18px;
  padding: 10px 14px;
  background: rgba(10, 28, 42, 0.7);
  border: 1px solid rgba(0, 181, 226, 0.25);
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}

.disclaimer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hikma-cyan);
  margin-top: 2px;
  flex-shrink: 0;
}

.disclaimer-icon svg {
  stroke: var(--hikma-cyan);
}

.disclaimer-text {
  font-size: 10px;
  line-height: 1.45;
  color: #94a3b8;
}

.disclaimer-text strong {
  color: #e2e8f0;
}

.booth-sub-note {
  margin-top: 8px;
  font-size: 10.5px;
  color: #64748b;
  text-align: center;
  letter-spacing: 0.2px;
}