/* ============================================
   Funnel Template — Shared Stylesheet
   קוד משותף לכל הלקוחות. אין לשכפל קובץ זה!
   צבעים ותוכן מגיעים מ-config.js של כל לקוח
   דרך CSS Variables שמוזרקות ב-app.js
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ערכי ברירת מחדל - יידרסו ע"י config של הלקוח */
  --primary:     #FDB42B;
  --secondary:   #111111;
  --text-color:  #ffffff;

  --gold:        #C9A96E;
  --gold-deep:   #B8935A;
  --gold-pale:   #E8D5B0;
  --cream:       #FAF8F5;
  --card:        #FFFFFF;
  --text-dark:   #3A2E26;
  --text-mid:    #7A6B5E;
  --text-light:  #B0A499;
  --border:      #EDE8E1;
  --radius-card: 22px;
  --shadow-card: 0 2px 28px rgba(0,0,0,0.08);
  --cta-bright:  #FFD56A;
  --cta-deep:    #C9942E;
  --cta-glow:    rgba(255, 213, 106, 0.75);
}

html, body {
  height: 100%;
  background: var(--cream);
  font-family: 'Heebo', sans-serif;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 48px;
}

header {
  width: 100%;
  max-width: 680px;
  padding: 20px 20px 10px;
  text-align: center;
}

.header-eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 4px;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.header-logo {
  max-width: 160px;
  max-height: 56px;
  margin: 0 auto 6px;
  display: block;
}

main {
  width: 100%;
  max-width: 680px;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.gold-stripe {
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-pale), var(--gold));
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 78svh;
  background: #111;
  overflow: hidden;
}

#mainVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px 32px;
  gap: 12px;
  background: linear-gradient(to top, rgba(20,12,5,0.78) 0%, transparent 52%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 5;
}

.overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px 40px;
  background: linear-gradient(to top, rgba(20,12,5,0.82) 0%, rgba(20,12,5,0.12) 55%, transparent 100%);
}

.start-title {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

.start-subtitle {
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.5;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.start-overlay.hidden {
  display: none;
}

.overlay-label {
  color: rgba(255,255,255,0.96);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.55);
}

.btn {
  width: 100%;
  max-width: 340px;
  padding: 18px 28px;
  border-radius: 999px;
  font-family: 'Heebo', sans-serif;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

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

.btn-gold {
  background: linear-gradient(135deg, #FFE08A 0%, var(--cta-bright) 35%, var(--cta-deep) 100%);
  color: #2F2114;
  border: 2px solid rgba(255,255,255,0.75);
  box-shadow:
    0 0 0 4px rgba(255, 213, 106, 0.18),
    0 0 24px var(--cta-glow),
    0 10px 32px rgba(201, 148, 46, 0.58);
  animation: ctaPulse 1.65s ease-in-out infinite;
}

.btn-gold::before {
  content: "";
  position: absolute;
  top: 0;
  right: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  transform: skewX(-18deg);
  animation: ctaShine 2.4s ease-in-out infinite;
}

.btn-gold:hover {
  filter: brightness(1.08);
  box-shadow:
    0 0 0 5px rgba(255, 213, 106, 0.25),
    0 0 34px rgba(255, 213, 106, 0.95),
    0 14px 38px rgba(201, 148, 46, 0.7);
  transform: translateY(-2px) scale(1.015);
}

.btn-ghost {
  background: rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.82);
  border: 1.5px solid rgba(255,255,255,0.34);
  font-weight: 500;
  font-size: 15px;
  max-width: 300px;
  padding: 13px 22px;
  animation: none;
}

.btn-ghost:hover { background: rgba(255,255,255,0.10); }

.thankyou-block {
  text-align: center;
  padding-bottom: 8px;
}

.thankyou-icon {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
}

.thankyou-title {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
  margin-bottom: 4px;
}

.thankyou-sub {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

#calendarSection {
  display: none;
}

#calendarSection.visible {
  display: block;
}

.calendar-header {
  padding: 18px 20px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.calendar-header h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
}

.calendar-header p {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 3px;
}

#calendlyFrame {
  width: 100%;
  height: min(600px, 64svh);
  border: none;
  display: block;
}

.calendar-fallback {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  margin: -2px 14px 16px;
  padding: 18px 16px 20px;
  border: 1px solid rgba(201, 169, 110, 0.36);
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 213, 106, 0.35), transparent 58%),
    rgba(255, 255, 255, 0.97);
  box-shadow:
    0 -8px 30px rgba(250, 248, 245, 0.86),
    0 10px 34px rgba(201, 148, 46, 0.22);
}

.calendar-fallback p {
  font-size: 18px;
  line-height: 1.35;
  color: var(--text-dark);
  font-weight: 800;
  margin-bottom: 14px;
}

.btn-fallback {
  display: inline-block;
  width: 100%;
  max-width: 460px;
  padding: 20px 34px;
  border-radius: 999px;
  font-family: 'Heebo', sans-serif;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.75);
  background: linear-gradient(135deg, #FFE08A 0%, var(--cta-bright) 35%, var(--cta-deep) 100%);
  color: #2F2114;
  box-shadow:
    0 0 0 4px rgba(255, 213, 106, 0.18),
    0 0 24px var(--cta-glow),
    0 10px 32px rgba(201, 148, 46, 0.5);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  animation: ctaPulse 1.65s ease-in-out infinite;
}

.btn-fallback:hover {
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.015);
  box-shadow:
    0 0 0 5px rgba(255, 213, 106, 0.25),
    0 0 34px rgba(255, 213, 106, 0.95),
    0 14px 38px rgba(201, 148, 46, 0.7);
}

footer {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  padding: 0 20px;
}

/* מצב טעינה ומסך שגיאה (לפני שה-config נטען) */
#loadingScreen,
#errorScreen,
#homeScreen {
  width: 100%;
  max-width: 480px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 10px;
}

#loadingScreen[hidden],
#errorScreen[hidden],
#homeScreen[hidden],
#appRoot[hidden] {
  display: none;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}

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

.error-icon {
  font-size: 38px;
  margin-bottom: 4px;
}

.error-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

.error-sub {
  font-size: 14px;
  color: var(--text-mid);
  max-width: 320px;
  line-height: 1.6;
}

/* הודעת שגיאה ידידותית כשאין bookingLink */
.config-error {
  width: 100%;
  max-width: 480px;
  margin: 16px 14px 0;
  padding: 14px 18px;
  background: #fff4e5;
  border: 1px solid #f0c989;
  border-radius: 14px;
  color: #6b4a1a;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ctaPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 4px rgba(255, 213, 106, 0.18),
      0 0 24px rgba(255, 213, 106, 0.68),
      0 10px 32px rgba(201, 148, 46, 0.52);
  }
  50% {
    transform: scale(1.035);
    box-shadow:
      0 0 0 7px rgba(255, 213, 106, 0.25),
      0 0 40px rgba(255, 213, 106, 0.95),
      0 16px 44px rgba(201, 148, 46, 0.68);
  }
}

@keyframes ctaShine {
  0% { right: -120%; }
  45%, 100% { right: 140%; }
}

.slide-down { animation: slideDown 0.4s ease forwards; }


@media (max-width: 640px) {
  header, main {
    max-width: none;
  }

  main {
    padding: 0 8px;
  }

  .card {
    border-radius: 22px;
  }

  .video-wrap {
    max-height: 78svh;
  }

  .calendar-fallback {
    margin: -2px 10px 14px;
    bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .overlay { transition: none; }
  .slide-down { animation: none; }
  .btn-gold, .btn-fallback, .btn-gold::before { animation: none; }
}

/* תיקון v5: מעבר חלק בין סרטונים + כפתור המשך בולט שלא מסתיר את היומן */
#mainVideo {
  transition: opacity 0.18s ease;
  background-color: #111;
}

#mainVideo.is-switching {
  opacity: 0.985;
}

/* הווידאו רחב יותר, כמו במקור */
.card:first-child {
  max-width: 640px;
  width: 100%;
  margin-inline: auto;
  border-radius: 24px;
}

.video-wrap {
  border-radius: 24px;
}

/* היומן נשאר לחיץ לגמרי: הכפתור כבר לא fixed ולא מכסה את ה-iframe */
.calendar-fallback {
  position: relative;
  z-index: 2;
  width: auto;
  margin: 16px 18px 22px;
  padding: 18px 16px 20px;
  border: 2px solid rgba(255,255,255,0.86);
  border-radius: 24px;
  animation: fallbackEntranceInline 0.45s ease-out both, fallbackNudge 1.55s ease-in-out 0.45s infinite;
}

.calendar-fallback::before {
  content: "↓";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFE08A 0%, var(--cta-bright) 35%, var(--cta-deep) 100%);
  color: #2F2114;
  font-size: 26px;
  font-weight: 900;
  line-height: 40px;
  box-shadow: 0 0 24px rgba(255, 213, 106, 0.95);
  animation: arrowBounceInline 1.05s ease-in-out infinite;
}

.calendar-fallback p {
  font-size: clamp(18px, 4.1vw, 22px);
  line-height: 1.32;
  margin-bottom: 12px;
}

.btn-fallback {
  max-width: none;
  padding: 20px 26px;
  font-size: clamp(19px, 4.4vw, 23px);
  animation: ctaPulse 1.25s ease-in-out infinite;
}

/* הורדה קלה של גובה היומן כדי שהכפתור יופיע מהר יותר, בלי להסתיר את כפתורי היומן */
#calendlyFrame {
  height: min(600px, 64svh);
}

body.calendar-open {
  padding-bottom: 48px;
}

#calendarSection.visible {
  overflow: visible;
}

@keyframes fallbackEntranceInline {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fallbackNudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

@keyframes arrowBounceInline {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-7px); }
}

@media (min-width: 641px) {
  .video-wrap {
    max-height: 82svh;
  }
}

@media (max-width: 640px) {
  main {
    padding: 0 6px;
  }

  .card:first-child {
    max-width: none;
    border-radius: 24px;
  }

  .video-wrap {
    width: 100%;
    max-height: 82svh;
    border-radius: 24px;
  }

  #calendlyFrame {
    height: min(560px, 61svh);
  }

  .calendar-fallback {
    margin: 18px 10px 18px;
    padding: 17px 13px 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calendar-fallback,
  .calendar-fallback::before,
  .btn-fallback {
    animation: none;
  }
}


/* דף בית ראשי - ללא תוכן שיווקי, רק לוגו */
.home-logo {
  font-size: clamp(34px, 9vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-dark);
  line-height: 1;
}


/* JustDoMeet homepage */
#homeScreen {
  min-height: 100svh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #FAF8F5;
}

#homeScreen[hidden] {
  display: none !important;
}

.home-logo-img {
  width: min(92vw, 920px);
  max-height: 88svh;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 18px 42px rgba(20, 28, 40, 0.08));
}

@media (max-width: 520px) {
  #homeScreen {
    padding: 12px;
  }

  .home-logo-img {
    width: 98vw;
    max-height: 86svh;
  }
}
