/* ====== MOBILE DEMO MODAL ====== */
.mdemo-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.mdemo-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mdemo-wrapper {
  display: flex;
  align-items: center;
  gap: 48px;
  transform: scale(0.95) translateY(20px);
  transition: transform 300ms ease;
}
.mdemo-overlay.active .mdemo-wrapper {
  transform: scale(1) translateY(0);
}

/* Phone frame */
.mdemo-phone {
  width: 320px;
  height: 640px;
  background: #111827;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.08);
  position: relative;
  flex-shrink: 0;
}
.mdemo-screen {
  width: 100%;
  height: 100%;
  background: #0f172a;
  border-radius: 30px;
  overflow: hidden;
  position: relative;
}

/* Status bar */
.mdemo-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 4px;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 600;
  position: relative;
  z-index: 10;
}
.mdemo-statusbar-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Notch */
.mdemo-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #111827;
  border-radius: 0 0 18px 18px;
  z-index: 20;
}

/* Home indicator */
.mdemo-home-indicator {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  z-index: 10;
}

/* Scene container */
.mdemo-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 350ms ease, transform 350ms ease;
  display: flex;
  flex-direction: column;
}
.mdemo-scene.active {
  opacity: 1;
  transform: translateX(0);
}
.mdemo-scene.exit {
  opacity: 0;
  transform: translateX(-40px);
}

/* App header bar */
.mdemo-appbar {
  padding: 36px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mdemo-appbar-gradient {
  background: linear-gradient(135deg, #0069ff 0%, #00bcd4 100%);
  padding: 36px 16px 14px;
}
.mdemo-appbar-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.mdemo-appbar-title {
  color: white;
  font-size: 15px;
  font-weight: 700;
}
.mdemo-appbar-sub {
  color: rgba(255,255,255,0.6);
  font-size: 10px;
}

/* Content area */
.mdemo-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

/* Tiles */
.mdemo-tile-label {
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 10px;
  padding: 0 2px;
}
.mdemo-tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mdemo-tile {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px;
  transition: all 300ms;
}
.mdemo-tile.highlight {
  border-color: rgba(0, 105, 255, 0.4);
  background: rgba(0, 105, 255, 0.08);
  box-shadow: 0 0 16px rgba(0, 105, 255, 0.1);
}
.mdemo-tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 8px;
}
.mdemo-tile-name {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 600;
}
.mdemo-tile-count {
  color: rgba(255,255,255,0.3);
  font-size: 9px;
  margin-top: 2px;
}

/* Child tiles (detail view) */
.mdemo-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 300ms;
}
.mdemo-list-item.highlight {
  border-color: rgba(0, 105, 255, 0.3);
  background: rgba(0, 105, 255, 0.06);
}
.mdemo-list-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.mdemo-list-text {
  flex: 1;
}
.mdemo-list-title {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 600;
}
.mdemo-list-sub {
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  margin-top: 1px;
}
.mdemo-list-chevron {
  color: rgba(255,255,255,0.15);
  font-size: 14px;
}

/* Chat panel */
.mdemo-chat {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #111827;
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  transform: translateY(100%);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 30;
  display: flex;
  flex-direction: column;
  max-height: 75%;
}
.mdemo-chat.open {
  transform: translateY(0);
}
.mdemo-chat-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  margin: 8px auto;
}
.mdemo-chat-header {
  padding: 4px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mdemo-chat-title {
  color: white;
  font-size: 14px;
  font-weight: 600;
}
.mdemo-chat-messages {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.mdemo-msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 300ms, transform 300ms;
}
.mdemo-msg.visible {
  opacity: 1;
  transform: translateY(0);
}
.mdemo-msg.bot {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.mdemo-msg.user {
  background: #0069ff;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.mdemo-msg.typing {
  background: rgba(255,255,255,0.06);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: rgba(255,255,255,0.4);
}
.mdemo-quick-replies {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 14px 6px;
  opacity: 0;
  transition: opacity 300ms;
}
.mdemo-quick-replies.visible { opacity: 1; }
.mdemo-quick-reply {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 105, 255, 0.3);
  color: #60a5fa;
  font-size: 11px;
  font-weight: 500;
  background: rgba(0, 105, 255, 0.08);
  transition: all 200ms;
}
.mdemo-quick-reply.selected {
  background: #0069ff;
  color: white;
  border-color: #0069ff;
}
.mdemo-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.mdemo-chat-input-field {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 7px 14px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}
.mdemo-chat-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0069ff, #00bcd4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* FAB */
.mdemo-fab {
  position: absolute;
  bottom: 20px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0069ff, #00bcd4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(0, 105, 255, 0.35);
  z-index: 10;
  transition: all 300ms;
}
.mdemo-fab.pulse {
  animation: mdemo-fab-pulse 1.5s ease infinite;
}
@keyframes mdemo-fab-pulse {
  0% { box-shadow: 0 4px 16px rgba(0, 105, 255, 0.35); }
  50% { box-shadow: 0 4px 24px rgba(0, 105, 255, 0.6), 0 0 0 8px rgba(0, 105, 255, 0.1); }
  100% { box-shadow: 0 4px 16px rgba(0, 105, 255, 0.35); }
}

/* Welcome screen */
.mdemo-welcome-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0069ff 0%, #00bcd4 60%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}
.mdemo-welcome-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
}
.mdemo-welcome-title {
  color: white;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}
.mdemo-welcome-sub {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  line-height: 1.5;
  max-width: 240px;
}
.mdemo-welcome-btn {
  margin-top: 28px;
  background: white;
  color: #0069ff;
  border: none;
  padding: 12px 32px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.mdemo-welcome-skip {
  margin-top: 12px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}

/* Profile screen */
.mdemo-profile-header {
  text-align: center;
  padding: 40px 20px 20px;
  background: linear-gradient(180deg, rgba(0,105,255,0.15) 0%, transparent 100%);
}
.mdemo-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0069ff, #00bcd4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 10px;
  border: 3px solid rgba(255,255,255,0.1);
}
.mdemo-profile-name {
  color: white;
  font-size: 16px;
  font-weight: 700;
}
.mdemo-profile-email {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  margin-top: 2px;
}
.mdemo-profile-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 14px;
}
.mdemo-profile-stat-val {
  color: white;
  font-size: 16px;
  font-weight: 700;
}
.mdemo-profile-stat-lbl {
  color: rgba(255,255,255,0.35);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Push notification toast */
.mdemo-notification {
  position: absolute;
  top: 32px;
  left: 12px;
  right: 12px;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 40;
  transform: translateY(-120%);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}
.mdemo-notification.show {
  transform: translateY(0);
}
.mdemo-notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0069ff, #00bcd4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.mdemo-notif-text {
  flex: 1;
}
.mdemo-notif-title {
  color: white;
  font-size: 11px;
  font-weight: 600;
}
.mdemo-notif-body {
  color: rgba(255,255,255,0.5);
  font-size: 10px;
  margin-top: 1px;
}
.mdemo-notif-time {
  color: rgba(255,255,255,0.25);
  font-size: 9px;
  flex-shrink: 0;
}

/* Side panel (narration) */
.mdemo-info {
  width: 300px;
  flex-shrink: 0;
}
.mdemo-info-step {
  color: #00bcd4;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.mdemo-info-title {
  color: white;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}
.mdemo-info-desc {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.mdemo-info-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mdemo-info-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
}
.mdemo-info-features li span:first-child {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

/* Navigation dots */
.mdemo-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
}
.mdemo-nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 200ms;
}
.mdemo-nav-dot.active {
  background: #00bcd4;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  transform: scale(1.3);
}
.mdemo-nav-dot.done {
  background: rgba(0, 229, 255, 0.35);
}

/* Close button */
.mdemo-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 200ms;
  z-index: 100;
}
.mdemo-close:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Responsive */
@media (max-width: 860px) {
  .mdemo-wrapper { flex-direction: column; gap: 24px; }
  .mdemo-info { width: auto; text-align: center; padding: 0 20px; }
  .mdemo-info-title { font-size: 20px; }
  .mdemo-info-features { display: none; }
  .mdemo-phone { transform: scale(0.85); }
  .mdemo-nav { flex-direction: row; position: static; transform: none; margin-top: -12px; }
}
