/* Application layout styles */

body {
  font-family: 'Inter', sans-serif;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

.hero-background {
  background-image:
    linear-gradient(to right, rgba(128, 128, 128, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(128, 128, 128, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 60%, transparent 100%);
}

.mobile-menu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out, opacity 0.2s ease-out;
}

.mobile-menu.active {
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.3s ease-in, opacity 0.2s ease-in;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  padding: 0;
}

.faq-answer.active {
  max-height: 200px;
  opacity: 1;
  visibility: visible;
  padding: 1rem;
}

.cv-float {
  animation: float 3s ease-in-out infinite;
}

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

.faq-question {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drag-active {
  /* Used by `upload_controller.js` to highlight dropzones during drag-over */
  --drag-accent: #a855f7; /* purple-500 */
  --drag-bg: rgba(168, 85, 247, 0.08);
  border-color: var(--drag-accent) !important;
  background-color: var(--drag-bg) !important;
}

.drag-active .dropzone-label,
.drag-active .dropzone-cta,
.drag-active .dropzone-name {
  border-color: var(--drag-accent) !important;
  background-color: var(--drag-bg) !important;
}

.drag-active .dropzone-label {
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
  transition: box-shadow 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.carousel-track {
  animation: scroll 60s linear infinite;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-7 * (8rem + 1rem))); }
}

.loader {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #ff9f1c;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive hero padding using Bulma breakpoints */
.hero-padding {
  padding-top: 1.25rem; /* Small padding for mobile */
}

@media screen and (min-width: 769px) {
  .hero-padding {
    padding-top: 3.5rem; /* Larger padding for tablet and up */
  }
}

/* Responsive button sizing for Join Waitlist button */
.responsive-button {
  /* Small size for mobile */
  font-size: 0.875rem !important;
  padding: 0.5rem 0.75rem !important;
}

@media screen and (min-width: 769px) {
  .responsive-button {
    /* Normal size for tablet and desktop */
    font-size: 1rem !important;
    padding: 0.75rem 1.5rem !important;
  }
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.5rem;
  text-decoration: none;
  background: linear-gradient(60deg, #6366f1, #8b5cf6, #a855f7, #6366f1, #3b82f6, #6366f1);
  background-size: 300% 300%;
  animation: cta-gradient 6s ease infinite;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.25), 0 4px 6px -4px rgba(99, 102, 241, 0.2);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

@keyframes cta-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.button.cta-primary,
.button.cta-primary:hover,
.button.cta-primary:active,
.button.cta-primary:focus {
  color: #ffffff !important;
}

.cta-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 14px 20px -8px rgba(99, 102, 241, 0.45), 0 6px 10px -6px rgba(99, 102, 241, 0.3);
}

.cta-primary:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.6);
  outline-offset: 2px;
}

.signup-value {
  text-align: center;
  margin-bottom: 1rem;
  color: #4a4a4a;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(139, 92, 246, 0.2);
}

progress.upload-progress {
  height: 0.5rem;
  border-radius: 9999px;
  overflow: hidden;
  background-color: #e2e8f0;
  color: #cbd5f5;
}

progress.upload-progress::-webkit-progress-bar {
  border-radius: 9999px;
  background-color: #e2e8f0;
}

progress.upload-progress::-webkit-progress-value {
  border-radius: 9999px;
  background-color: #c7d2fe;
}

progress.upload-progress::-moz-progress-bar {
  border-radius: 9999px;
  background-color: #c7d2fe;
}

.template-carousel-viewport {
  overflow-x: hidden;
  overflow-y: visible;
  padding: 0.5rem 0;
}

.template-carousel-frame {
  overflow: visible;
}

.template-carousel-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  overflow: visible;
  animation: template-scroll 80s linear infinite;
}

.template-card {
  position: relative;
  flex: 0 0 auto;
  overflow: visible;
  text-align: center;
}

#templates {
  overflow-x: hidden;
}

.template-preview-image {
  height: 12rem;
  width: 8.5rem;
  border-radius: 0.75rem;
  object-fit: cover;
  object-position: top;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  transition: transform 220ms ease, box-shadow 220ms ease;
  transform-origin: center center;
}

@keyframes template-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Zoom functionality for template previews */
.template-zoomable {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
  will-change: transform;
}

.template-zoomable:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.template-zoomable.zoomed {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important;
  z-index: 9999;
  max-height: 90vh;
  max-width: 90vw;
  width: auto;
  height: auto;
  cursor: zoom-out;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
  transition: none;
}

.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9998;
  cursor: pointer;
}

.pricing-templates .template-zoomable:hover {
  transform: translateY(-3px) scale(1.04);
}

/* ============================================
   SPEED RACE SECTION
   ============================================ */

.speed-race-section {
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
  position: relative;
}

.speed-race-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: speed-grid-scroll 20s linear infinite;
}

@keyframes speed-grid-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-60px); }
}

.speed-gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Race Container */
.race-container {
  perspective: 1000px;
}

/* Race Lanes */
.race-lane {
  position: relative;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.race-lane-fast {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%);
  border-color: rgba(99, 102, 241, 0.3);
}

.race-lane-fast.race-complete {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.15);
}

.race-lane-slow {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
  opacity: 0.7;
}

/* Lane Headers */
.race-lane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.race-logo-fast {
  font-weight: 700;
  font-size: 1.125rem;
}

.race-logo-slow {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  font-size: 0.95rem;
}

/* Time Display */
.race-time {
  font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  min-width: 5rem;
  text-align: center;
}

.race-time-fast {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.race-time-fast.race-time-complete {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.2));
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

.race-time-slow {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Race Track */
.race-track {
  position: relative;
  height: 3.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
}

.race-track-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(99, 102, 241, 0.15) 0%,
    rgba(139, 92, 246, 0.1) 50%,
    rgba(99, 102, 241, 0.05) 100%);
  border-radius: 0.75rem;
}

.race-track-bg-slow {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.03) 100%);
}

/* Race Runner (the moving element) */
.race-runner {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) translateX(0%);
  display: flex;
  align-items: center;
  z-index: 10;
  transition: transform 0.1s linear;
}

.race-runner-fast {
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.6));
}

.race-runner-glow {
  position: absolute;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: race-pulse 1s ease-in-out infinite;
}

@keyframes race-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

.race-runner-head {
  width: 2.75rem;
  height: 2.75rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow:
    0 4px 20px rgba(99, 102, 241, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 2;
}

.race-runner-head-slow {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.race-runner-slow {
  opacity: 0.6;
}

/* Finish Line */
.race-finish {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

.race-finish-flag {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.2);
  transition: all 0.4s ease;
}

.race-finish-flag.race-flag-active {
  color: #22c55e;
  transform: scale(1.2);
  animation: race-flag-wave 0.5s ease-in-out;
}

@keyframes race-flag-wave {
  0%, 100% { transform: scale(1.2) rotate(0deg); }
  25% { transform: scale(1.3) rotate(-10deg); }
  75% { transform: scale(1.3) rotate(10deg); }
}

.race-finish-flag-slow {
  color: rgba(255, 255, 255, 0.1);
}

/* Victory Badge */
.race-victory {
  position: absolute;
  right: 1.5rem;
  top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
  border-radius: 2rem;
  opacity: 0;
  transform: scale(0.8) translateY(5px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.race-victory.race-victory-show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.race-victory i {
  font-size: 0.7rem;
}

/* Time Saved Counter */
.time-saved-container {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-saved-container.time-saved-show {
  opacity: 1;
  transform: translateY(0);
}

.time-saved-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.1));
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 1.25rem;
  padding: 1.25rem 2.5rem;
  backdrop-filter: blur(10px);
}

.time-saved-label {
  color: rgba(134, 239, 172, 0.8);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.time-saved-value {
  font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
  font-size: 2.5rem;
  font-weight: 800;
  color: #86efac;
  line-height: 1.2;
  text-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
}

.time-saved-sub {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
  .speed-race-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .race-lane {
    padding: 1rem;
  }

  .race-time {
    font-size: 1.125rem;
    min-width: 4rem;
  }

  .race-track {
    height: 3rem;
  }

  .race-runner-head {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
  }

  .time-saved-value {
    font-size: 2rem;
  }

  .race-victory {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    right: 1rem;
    top: 1rem;
  }
}
