/* invites_v2 page-specific styles */

/* Hero coverflow - dynamic */
.hero-rail-wrapper {
  overflow: hidden;
  max-width: 1060px;
  margin: 14px auto 18px auto;
  position: relative;
}
.hero-rail {
  display: flex;
  justify-content: center;
  gap: 22px;
  overflow-x: auto;
  padding: 10px 8px 6px 8px;
  perspective: 1200px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.hero-rail::-webkit-scrollbar { display: none; }
.hero-card {
  min-width: 180px;
  height: 240px;
  border-radius: 16px;
  background: #f3f4f6;
  box-shadow: 0 10px 20px rgba(0,0,0,0.18);
  transform-origin: center center;
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
  scroll-snap-align: center;
  will-change: transform;
  cursor: pointer;
}
.hero-card:hover {
  box-shadow: 0 14px 28px rgba(0,0,0,0.24);
}
/* Arrows */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: #111827;
  cursor: pointer;
  opacity: 0.0;
  transition: opacity .2s ease, transform .2s ease;
}
.hero-rail-wrapper:hover .hero-arrow { opacity: 0.95; }
.hero-arrow:hover { transform: translateY(-50%) scale(1.05); }
.hero-arrow-left  { left: -6px; }
.hero-arrow-right { right: -6px; }
@media (max-width: 768px) {
  .hero-arrow { display:none; }
  .hero-card { min-width: 150px; height: 210px; }
}

/* CTA row */
.cta-row {
  display: flex;
  justify-content: center;
  margin: 10px 0 8px 0;
}

/* CTA button (top hero) - force black to match design */
.cta-button {
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}
.cta-button:hover { filter: brightness(0.95); }
.cta-button:focus { outline: none; box-shadow: 0 0 0 3px rgba(17,24,39,0.25); }

/* Header/search strip */
.templates-header { padding-top: 8px; }
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1060px;
  margin: 0 auto 16px auto;
}
.search-input-wrap { flex: 1; position: relative; }
.search-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  outline: none;
}
.search-row { display: none; } /* temporarily hide search and filter on invites_v2 */
.search-kbd-hint {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
}
.filter-button {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
}
.templates-title { margin-top: 4px; }
.templates-subtitle { margin-top: 6px; display: flex; align-items: center; justify-content: center; }
.subtitle-avatars { height: 36px; width: auto; display: inline-block; margin-right: 8px; }
.subtitle-text { text-align: center; }
.templates-subtitle .fw-600 { font-weight: 700; }
.fw-600 { font-weight: 600; }

/* Tagline */
.section-tagline {
  text-align: center;
  margin: 22px 0 24px 0;
  color: #374151;
  font-weight: 600;
  font-size: 20px;
}

/* Pricing cards */
.pricing-card {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  overflow: visible; /* ensure discount badge is not clipped */
}
.pricing-card .discount-badge {
  position: absolute;
  right: 10px;
  top: -12px;
  background: linear-gradient(180deg, #7F3675 33%, #0B4383 68%, #062E66 94%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.1px;
  padding: 0 10px;
  height: 25px;
  min-width: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25), 0 2px 6px rgba(109,40,217,0.35);
  text-shadow: 0 1px 0 rgba(0,0,0,0.15);
  z-index: 2;
}
.pricing-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  text-align: center;
  margin: 4px 0 10px 0;
}
.pricing-card .media {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.pricing-card .views-badge {
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 11px;
  color: #fff;
  background: rgba(0,0,0,0.55);
  padding: 4px 8px;
  border-radius: 999px;
}
.pricing-card .feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: #374151;
  font-size: 12px;
}
.pricing-card .feature {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  white-space: nowrap;
}
.pricing-card .price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
}
.pricing-card .old-price {
  color: #9ca3af;
  text-decoration: line-through;
}
.pricing-card .new-price {
  color: #111827;
  font-weight: 700;
}
.pricing-card .actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.pricing-card .full-width {
  display: block;
  width: 100%;
  margin-top: 12px;
}

/* Media tweaks */
.pricing-card .media { cursor: pointer; }
.pricing-card .media { touch-action: manipulation; }
.media-fallback { width: 100%; height: 260px; background: #f9fafb; }

/* Fullscreen Video Modal */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2147483647; /* ensure above header/account/credits */
  /* Prevent scroll chaining on mobile so background doesn't scroll */
  overscroll-behavior: contain;
}
.modal-carousel {
  position: relative;
  width: 90vw;
  max-width: 540px;
  height: 90vh;
  border-radius: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  /* Allow vertical pan inside modal, block horizontal gestures */
  touch-action: pan-y;
  background: transparent;
}
.modal-slides {
  position: relative;
}
.modal-close-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  padding: 8px 8px 0 0;
  pointer-events: none; /* only button should capture clicks */
}
.modal-close-bar .close-button {
  position: static !important;
  pointer-events: auto;
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: #111827;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.modal-carousel::-webkit-scrollbar { display: none; }
.carousel-slide {
  position: relative;
  scroll-snap-align: start;
  /* Ensure snap always lands on a slide on iOS Safari */
  scroll-snap-stop: always;
  min-height: 84vh; /* shorter than container to hint next */
  margin: 3vh 0;    /* adds the peek effect for next/prev */
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-slide video,
.carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  display: block;
}
.modal-dots {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.modal-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
}
.modal-dots .dot.active {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
}
.video-modal .use-button {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
}
/* Place close over the carousel content (not corner of screen) */
.modal-carousel .close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  z-index: 2;
}
/* Fixed close button over the overlay so it doesn't scroll out */
.video-modal .modal-close-fixed {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  z-index: 2147483647; /* above everything in modal */
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.video-modal .close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}
.btn-primary {
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost {
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}
@media (max-width: 768px) {
  .info-banner {
    padding: 12px !important;
    margin: 15px 0 !important;
  }
  .expand-button {
    display: flex !important;
  }
}

/* Mobile adjustments for subtitle layout */
@media (max-width: 640px) {
  .templates-subtitle {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .subtitle-avatars {
    margin-right: 0;
    height: 32px;
  }
  .subtitle-text {
    display: block;
    max-width: 280px;
    line-height: 1.4;
    text-align: center;
  }
}

/* Header/search bar and misc layout */
.templates-header.invites-v2 { padding-top: 8px; }
.header-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1060px;
  margin: 0 auto 16px auto;
}
.search-wrapper { flex: 1; position: relative; }
.search-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  outline: none;
}
.search-hint {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
}
.filter-button {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
}
.title-tight { margin-top: 4px; }
.subtitle-tight { margin-top: 6px; }
.hero-rail-container {
  max-width: 1060px;
  margin: 14px auto 18px auto;
  position: relative;
}
.section-tagline {
  text-align: center;
  margin: 22px 0 24px 0;
  color: #374151;
  font-weight: 600;
  font-size: 20px;
}
.clickable { cursor: pointer; }
.media-fallback { width: 100%; height: 260px; background: #f9fafb; }

/* Video modal */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2147483647;
}
.close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}
.modalVideo {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}


