/* TikTok Style Premium Template */

:root {
  --bg-color: #000;
  --text-color: #fff;
  --text-muted: #ddd;
  
  --accent: #5ABDB2;
  --accent-glow: rgba(90, 189, 178, 0.5);
  
  --glass-bg: rgba(20, 20, 20, 0.6);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-blur: blur(20px);

  --radius: 12px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden; /* Prevent scrolling, single screen app */
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.2;
}

/* TikTok Full Screen Container */
.tiktok-container {
  position: relative;
  width: 100vw;
  height: 100dvh; /* use dynamic viewport height for mobile */
  background: #000;
  overflow: hidden;
}

.tiktok-feed {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
.tiktok-feed::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.video-slide {
  position: relative;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.video-slide video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.video-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 40%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

/* UI Overlay */
.overlay-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  pointer-events: none; /* Let clicks pass through except on interactive elements */
}

/* Top Nav */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.25rem;
  pointer-events: auto;
}

.wordmark {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.icon-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

/* TikTok Layout Styles */
.tiktok-layout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.tiktok-bottom-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 20px;
  padding-bottom: 30px; /* Safe area */
  gap: 20px;
}

.tiktok-text-area {
  flex: 1;
  pointer-events: auto;
  /* Reserve a band beneath the headline for the per-slide chat bubbles */
  margin-bottom: 130px;
}

.tiktok-action-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  pointer-events: auto;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  text-decoration: none;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.action-btn:hover .icon-circle {
  transform: scale(1.1);
}

.icon-circle svg {
  width: 24px;
  height: 24px;
}

.bg-white {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
}

.bg-blue {
  background: #2AABEE;
  color: #fff;
}

.bg-gray {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 20px;
  font-weight: bold;
}

.main-title {
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.pop-text {
  color: #FFFFFF;
  display: inline-block;
  text-shadow: 0 0 20px rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.9);
}

/* Chat thread — iMessage-style bubbles pinned to each video slide.
   Living inside .video-slide means they scroll away with their video. */
.chat-thread {
  position: absolute;
  left: 20px;
  bottom: 30px; /* sits in the band below the headline */
  z-index: 5;   /* above video (1) and gradient (2), below the fixed UI (10) */
  max-width: min(78vw, 440px); /* narrow column, kept to the left */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none; /* never block swiping the feed */
}

.chat-bubble {
  --enter-x: 0px;
  position: relative;
  width: fit-content;
  max-width: 100%;
  padding: 0.5rem 0.8rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.35;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  /* Pre-animation resting state */
  opacity: 0;
  transform: translateX(var(--enter-x)) translateY(10px) scale(0.9);
}

/* Sent — iMessage blue with white text */
.chat-bubble.user {
  align-self: flex-end;
  --enter-x: 40px; /* flies in from the right */
  background: #0a84ff;
  color: #fff;
  border-bottom-right-radius: 5px;
}

/* Received — iMessage grey with black text */
.chat-bubble.agent {
  align-self: flex-start;
  --enter-x: -40px; /* flies in from the left */
  background: #e9e9eb;
  color: #1c1c1e;
  border-bottom-left-radius: 5px;
}

/* Fly-in trigger */
.chat-bubble.fly-in {
  animation: bubbleFlyIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bubbleFlyIn {
  0%   { opacity: 0; transform: translateX(var(--enter-x)) translateY(10px) scale(0.9); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}

/* Typing indicator shown before the agent replies (dark dots on the grey bubble) */
.chat-bubble.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 0.7rem 0.85rem;
}
.chat-bubble.typing .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  animation: typingDot 1.2s infinite ease-in-out;
}
.chat-bubble.typing .dot:nth-child(2) { animation-delay: 0.18s; }
.chat-bubble.typing .dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1;   }
}

/* Desktop: keep the two bubbles clustered together on the left, under the headline */
@media (min-width: 768px) {
  .chat-thread {
    max-width: 340px;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-bubble { opacity: 1; transform: none; }
  .chat-bubble.fly-in { animation: none; }
  .chat-bubble.typing .dot { animation: none; }
}

/* Info Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* Slide up from bottom like a mobile sheet */
  justify-content: center;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: #111;
  width: 100%;
  max-width: 36rem;
  max-height: 85vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.hidden .modal-content {
  transform: translateY(100%);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 { margin: 0; font-size: 1.5rem; }

.close-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-btn:hover { background: rgba(255,255,255,0.2); }

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.modal-body h3 {
  color: #fff;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.modal-body section:first-child h3 { margin-top: 0; }

.steps { padding-left: 1.5rem; margin: 0; }
.steps li { margin-bottom: 0.5rem; }
.steps strong { color: #fff; }

.faq details {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0.75rem 0;
}
.faq summary { cursor: pointer; font-weight: 600; color: #fff; outline: none; }
.faq p { margin: 0.5rem 0 0 1rem; }

.disclosure {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
