/* MyVideoAsk CSS Styles 🤖 */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-color: #0b0f19;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --brand-primary: #7d00fe;
  --brand-primary-hover: #6a00d8;
  --brand-light: #f3e8ff;
  --border-color: #e2e8f0;
  --border-focus: #7d00fe;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* App Wrapper */
.app-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ==========================================================================
   DESKTOP DUAL-COLUMN LAYOUT (> 860px)
   ========================================================================== */

.main-card {
  background: var(--card-bg);
  width: 100%;
  max-width: 1080px;
  min-height: 640px;
  height: 82vh;
  max-height: 780px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Left: Video Pane */
.video-pane {
  position: relative;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Big Play Button Overlay */
.play-overlay-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
  transition: transform var(--transition-fast), background var(--transition-fast);
  z-index: 12;
}

.play-overlay-btn:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: #ffffff;
}

.play-overlay-btn svg {
  width: 34px;
  height: 34px;
  fill: var(--brand-primary);
  margin-left: 5px;
}

/* Top Video Controls Bar */
.video-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
}

.video-timer {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.02em;
}

.control-btn-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Language Switcher inside Top Bar */
.lang-switcher-bar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 2px 6px;
  margin-right: 0.25rem;
}

.lang-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  font-weight: 600;
  font-size: 0.72rem;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  color: #ffffff;
}

.lang-btn.active {
  color: #ffffff;
  font-weight: 700;
  background: var(--brand-primary);
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(125, 0, 254, 0.4);
}

.lang-divider {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.7rem;
  user-select: none;
}

.video-btn {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.video-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.video-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* Video Bottom Progress Line */
.video-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  z-index: 12;
  cursor: pointer;
}

.video-progress-bar {
  height: 100%;
  background: var(--brand-primary);
  width: 0%;
  transition: width 0.1s linear;
}

/* Subtitles Overlay */
.subtitles-overlay {
  position: absolute;
  bottom: 1.5rem;
  left: 1.25rem;
  right: 1.25rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.4;
  z-index: 11;
  pointer-events: none;
  opacity: 1;
  transition: opacity var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

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

/* Right: Content Pane */
.content-pane {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow-y: auto;
  max-height: 100%;
  background: #ffffff;
}

.step-card {
  display: none;
  flex-direction: column;
  animation: fadeIn var(--transition-normal);
}

.step-card.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Step 1: Choice Options */
.step-options-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.choice-btn {
  background: #f1f5f9;
  border: 2px solid transparent;
  border-radius: 9999px;
  padding: 1rem 1.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
  text-align: left;
}

.choice-btn:hover {
  background: #e2e8f0;
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.choice-badge {
  background: var(--brand-primary);
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.choice-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Step 2: Response Type Grid */
.step2-header {
  text-align: center;
  margin-bottom: 2rem;
}

.step2-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.step2-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.response-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.response-type-card {
  background: #f8fafc;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.response-type-card:hover {
  border-color: var(--brand-primary);
  background: var(--brand-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.response-type-icon {
  width: 36px;
  height: 36px;
  color: var(--brand-primary);
}

.response-type-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

/* Response Input Sub-panes (Text, Audio, Video) */
.response-input-pane {
  display: none;
}

.response-input-pane.active {
  display: block;
  animation: fadeIn var(--transition-normal);
}

.pane-header {
  margin-bottom: 1.25rem;
}

.back-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--brand-primary);
}

/* Form Styles */
.form-group {
  margin-bottom: 0.9rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #ffffff;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(125, 0, 254, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.two-col-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.submit-btn {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(125, 0, 254, 0.3);
}

.submit-btn:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(125, 0, 254, 0.4);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Audio & Video Recording UI */
.recorder-box {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
}

.record-btn-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ef4444;
  border: 4px solid #ffffff;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.record-btn-circle:hover {
  transform: scale(1.06);
}

.record-btn-circle.recording {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.record-btn-circle svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}

.record-timer {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.audio-preview-player, .video-preview-player {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.live-video-preview {
  width: 100%;
  max-height: 220px;
  border-radius: var(--radius-md);
  background: #000;
  object-fit: cover;
}

.retake-btn {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.retake-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

/* Step 3: Calendly Container */
.calendly-wrapper {
  width: 100%;
  height: 520px;
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendly-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Notification & Status Messages */
.status-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.5rem;
  display: none;
}

.status-msg.error {
  display: block;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.status-msg.success {
  display: block;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ==========================================================================
   MOBILE RESPONSIVE DESIGN (<= 860px)
   ========================================================================== */

@media (max-width: 860px) {
  body {
    background-color: #000000;
  }

  .app-wrapper {
    padding: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #000000;
  }

  .main-card {
    width: 100%;
    max-width: 480px;
    height: 100%;
    min-height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #000000;
    overflow: hidden;
  }

  /* Video Pane Fills the Whole Container */
  .video-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
  }

  .video-pane::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.05) 100%);
    z-index: 5;
  }

  .video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Big Play Button on Mobile */
  .play-overlay-btn {
    z-index: 12;
  }

  /* Top Controls on Mobile */
  .video-controls {
    padding: 1rem 0.9rem;
    z-index: 25;
  }

  .video-timer {
    font-size: 0.8rem;
  }

  .lang-switcher-bar {
    padding: 2px 5px;
    gap: 0.15rem;
  }

  .lang-btn {
    padding: 0.1rem 0.3rem;
    font-size: 0.7rem;
  }

  /* Subtitles on Mobile: Floating cleanly above choice buttons */
  .subtitles-overlay {
    bottom: 12.8rem;
    left: 1.25rem;
    right: 1.25rem;
    max-width: 420px;
    margin: 0 auto;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    z-index: 12;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }

  /* Content Pane on Mobile */
  .content-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    padding: 1.25rem;
    background: transparent;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  /* Step 1 Options on Mobile (Floating Glassmorphism Buttons) */
  #step1Card {
    display: none;
    width: 100%;
    pointer-events: auto;
    margin-bottom: 1.5rem;
  }

  #step1Card.active {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  #step1Card .step-options-container {
    width: 100%;
    max-width: none;
    gap: 0.85rem;
  }

  #step1Card .choice-btn {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: 9999px;
    padding: 0.95rem 1.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: all var(--transition-fast);
  }

  #step1Card .choice-btn:active {
    background: rgba(125, 0, 254, 0.7);
    transform: scale(0.98);
  }

  #step1Card .choice-badge {
    background: var(--brand-primary);
    color: #ffffff;
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  /* Step 2 (Response Selection & Forms) on Mobile */
  #step2Card {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    background: transparent;
    pointer-events: none;
    padding: 1.25rem;
    overflow: hidden;
    flex-direction: column;
    justify-content: flex-end;
  }

  #step2Card.active {
    display: flex;
  }

  #step2TypeSelection {
    pointer-events: auto;
    width: 100%;
    margin-bottom: 1.5rem;
    animation: fadeIn var(--transition-normal);
  }

  #step2TypeSelection .step2-header {
    display: none;
  }

  #step2TypeSelection .response-types-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  #step2TypeSelection .response-type-card {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    padding: 1.1rem 0.5rem;
    gap: 0.6rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: all var(--transition-fast);
  }

  #step2TypeSelection .response-type-card:active {
    background: rgba(125, 0, 254, 0.7);
    transform: scale(0.96);
  }

  #step2TypeSelection .response-type-icon {
    color: #ffffff;
    width: 32px;
    height: 32px;
  }

  #step2TypeSelection .response-type-label {
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
  }

  #step2BackToIntroBtn {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    display: inline-flex;
    margin: 0 auto;
  }

  /* Sub-panes (Text and Audio forms) take full clean view when selected */
  #paneText.active,
  #paneAudio.active {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 35;
    background: #ffffff;
    pointer-events: auto;
    padding: 2rem 1.25rem;
    overflow-y: auto;
  }

  /* Step 2 Video Recording Mode on Mobile */
  #paneVideo.active {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 40;
    background: #000000;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  #paneVideo .pane-header {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 20;
  }

  #paneVideo #backFromVideoBtn {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  #paneVideo .recorder-box {
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 2rem;
  }

  #paneVideo .live-video-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    object-fit: cover;
    z-index: 1;
  }

  #paneVideo .record-timer {
    position: relative;
    z-index: 10;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  #paneVideo .record-btn-circle {
    position: relative;
    z-index: 10;
    width: 78px;
    height: 78px;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }

  #paneVideo #videoInstruction {
    position: relative;
    z-index: 10;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
  }

  #paneVideo #videoForm {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem;
    z-index: 25;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
  }

  /* Step 3 (Calendly) on Mobile */
  #step3Card {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    background: #ffffff;
    pointer-events: auto;
    padding: 1rem;
    overflow-y: auto;
  }

  #step3Card.active {
    display: flex;
    flex-direction: column;
  }

  #step3Card .calendly-wrapper {
    height: calc(100% - 40px);
  }

  .two-col-inputs {
    grid-template-columns: 1fr;
  }
}
