/* Custom styles for Web14All website */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Base Styles */
:root {
  --primary-color: #f97316;
  --primary-dark: #c2410c;
  --primary-light: #fdba74;
  --scrollbar-thumb: rgba(249, 115, 22, 0.5);
  --scrollbar-track: transparent;
  /* Add hardware acceleration for smoother animations */
  --hardware-acceleration: translate3d(0, 0, 0);
}

html {
  scroll-behavior: smooth;
  /* Improved scrolling */
  scroll-padding-top: 80px; /* Adjust based on header height */
  overscroll-behavior: none; /* Prevent overscroll bouncing */
}

/* Improved scrollbar for desktop */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

/* Better touch experience on mobile */
@media (hover: none) and (pointer: coarse) {
  :root {
    --tap-highlight-color: transparent;
  }
  
  * {
    -webkit-tap-highlight-color: var(--tap-highlight-color);
  }
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  will-change: auto;
}

body.dark {
  --bg-color: #0f172a;
  --text-color: #f8fafc;
}

/* Performance optimization for animations */
.reveal-element {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: var(--delay, 0s);
  will-change: opacity, transform;
  backface-visibility: hidden;
  /* Add these properties for better GPU acceleration */
  transform: translate3d(0, 20px, 0);
  perspective: 1000;
}

/* Smoother animations on mobile */
.is-mobile .reveal-element {
  transform: translate3d(0, 10px, 0); /* Use translate3d for hardware acceleration */
  transition: opacity 0.3s ease, transform 0.3s ease; /* Even faster transitions on mobile */
}

/* Reduce the delay for all elements to make animations appear faster */
.reveal-element[data-delay] {
  transition-delay: calc(var(--delay) * 0.3s); /* Further reduced delay */
}

.reveal-element.active {
  opacity: 1;
  transform: translate3d(0, 0, 0); /* Use translate3d for hardware acceleration */
}

/* More efficient animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button Hover Effects - optimized for touch */
.transition {
  transition: all 0.3s ease;
}

/* Mobile-friendly card hover states */
@media (hover: hover) {
  /* Only apply hover effects on devices that support hover */
  .service-card:hover {
    transform: translateY(-5px);
  }
  
  .example-card:hover {
    transform: translateY(-5px);
  }
}

/* Custom Effects */
.gradient-text {
  background: linear-gradient(to right, var(--primary-color), #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Loader */
#loader {
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Theme Toggle */
.dark #moon-icon {
  display: none;
}

.dark #sun-icon {
  display: block;
}

#moon-icon {
  display: block;
}

#sun-icon {
  display: none;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  html {
    font-size: 15px; /* Slightly smaller base font size on mobile */
  }
  
  .section-heading {
    margin-bottom: 1.5rem;
  }
  
  .card {
    padding: 1.25rem;
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Better tap targets for mobile */
  button, .btn, a.btn {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
    min-width: 44px;
  }
  
  /* Better spacing for mobile form elements */
  input, textarea, select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }
  
  /* Improve section spacing on mobile */
  section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
  
  /* Improve heading size on mobile */
  h1 {
    font-size: 2.5rem !important;
  }
  
  h2 {
    font-size: 2rem !important;
  }
  
  /* Table improvements for mobile */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Aspect ratio utilities */
.aspect-w-16 {
  position: relative;
  padding-bottom: calc(9 / 16 * 100%);
}

.aspect-w-16 > * {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/* Hide scrollbar but maintain scrollability */
.hide-scrollbar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
}

.hide-scrollbar::-webkit-scrollbar { 
  width: 0;
  height: 0;
  display: none; /* Safari and Chrome */
}

/* Apple-style mobile scroll snap for pricing cards */
.pricing-scroll-container {
  position: relative;
  width: 100%;
}

.pricing-scroll-wrapper {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* Enable snap scrolling */
  scroll-snap-type: x mandatory;
  /* Hide scrollbar on all browsers but maintain functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Edge */
}

.pricing-scroll-wrapper > .pricing-card {
  /* Snap align center to ensure each card snaps to the center */
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* Keep proper spacing between items */
  margin-right: 0.75rem;
}

.pricing-scroll-wrapper > .pricing-card:last-child {
  margin-right: 0;
  /* Add extra padding to ensure the last card can be fully centered */
  padding-right: env(safe-area-inset-right, 1rem);
}

/* Scroll progress indicator styling - Apple style */
.scroll-indicator-container {
  padding: 0.5rem 0;
  width: 80%;
  max-width: 20rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards 1s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scroll-indicator-track {
  position: relative;
  height: 0.25rem;
  border-radius: 0.125rem;
  width: 100%;
  overflow: hidden;
}

.scroll-indicator-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  transition: transform 0.15s ease-out;
  transform-origin: left center;
  width: 33.33%; /* Default size for 3 cards */
  border-radius: 0.125rem;
  background-color: #ff6b00;
  will-change: transform;
}

/* Swipe hint animation */
.swipe-hint-text {
  animation: fadeInOut 2.5s ease-in-out;
  animation-fill-mode: forwards;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  20%, 80% { opacity: 1; }
}

/* Mobile pricing table improvements */
@media (max-width: 640px) {
  .pricing-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
    position: relative;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }
  
  .pricing-table-scroll {
    min-width: 640px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #ff6b00 rgba(0, 0, 0, 0.1);
  }
  
  .pricing-table-scroll::-webkit-scrollbar {
    height: 6px;
  }
  
  .pricing-table-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
  }
  
  .pricing-table-scroll::-webkit-scrollbar-thumb {
    background-color: #ff6b00;
    border-radius: 3px;
  }
  
  /* Swipe hint styling */
  .swipe-hint {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #ff6b00;
    color: white;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
}

/* Form styling enhancements */
.input-focused {
  position: relative;
}

.input-focused::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ff6b00;
  animation: focusLine 0.3s ease forwards;
}

@keyframes focusLine {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Error styling */
input.error, textarea.error {
  border-color: #ff4b4b !important;
  background-color: rgba(255, 75, 75, 0.05);
}

.error-message {
  color: #ff4b4b;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Toast notification styling */
.fixed.bottom-4 {
  animation: slideUp 0.3s ease-out forwards;
}

.fixed.bottom-4.opacity-0 {
  animation: slideDown 0.3s ease-in forwards;
}

@keyframes slideUp {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translate(-50%, 0); opacity: 1; }
  to { transform: translate(-50%, 100%); opacity: 0; }
}

/* Pricing Details Page specific styles */
.pricing-comparison-container {
  position: relative;
  border-radius: 1rem;
  max-width: 100%;
  overflow: hidden;
}

.pricing-table-scroll-wrapper {
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.pricing-table-scroll-wrapper::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.pricing-table-inner {
  position: relative;
}

/* Apply the exact Apple-style scroll snap behavior */
@media (max-width: 768px) {
  .pricing-table-scroll-wrapper {
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    display: block;
    width: 100%;
    overflow-x: auto;
    /* Disable user-select to improve scroll performance */
    user-select: none;
  }
  
  /* Disable main body scroll when scrolling horizontally */
  body.disable-vertical-scroll {
    overflow: hidden;
  }
  
  /* Mobile table optimization */
  .pricing-table-inner table {
    width: 100%;
    border-spacing: 0;
  }
  
  /* Minimize padding on mobile for better fit */
  .pricing-table-inner table th,
  .pricing-table-inner table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
  
  /* First column as sticky for better navigation */
  .pricing-table-inner table tr > :first-child {
    position: sticky;
    left: 0;
    background-color: inherit;
    z-index: 2;
    box-shadow: 2px 0 5px -2px rgba(0,0,0,0.1);
  }
  
  /* Clean up borders for modern look */
  .pricing-table-inner table {
    border-collapse: separate;
    border-spacing: 0;
  }
}

/* Additional optimizations for mobile scroll performance */
@media (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: transparent; /* Removes the tap highlight on iOS */
  }
  
  .smooth-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Optimize images for mobile */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Simplified shadows for better performance */
  .shadow-lg {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
  }
}

/* Pricing Animation Styles */
.pricing-animation-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  overflow: visible;
}

.pricing-content-wrapper {
  display: inline-block;
  position: relative;
  will-change: transform;
}

/* Main content element */
.pricing-main-element {
  display: inline-block;
  position: relative;
  transform: translateX(105vw); /* Start off-screen to the right */
  white-space: nowrap;
  will-change: transform;
}

/* Text label element */
.pricing-text-label {
  display: block;
  position: relative;
  transform: translateX(105vw); /* Start off-screen to the right */
  white-space: nowrap;
  will-change: transform;
}

/* Entry animations */
.pricing-main-element.slide-in {
  transform: translateX(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-text-label.slide-in {
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Horizontal bounce animations */
@keyframes mainElementBounce {
  0% { transform: translateX(0); }
  40% { transform: translateX(-25px); }
  70% { transform: translateX(10px); }
  100% { transform: translateX(0); }
}

.pricing-main-element.bounce-horizontal {
  animation: mainElementBounce 0.4s ease-out forwards;
}

@keyframes textLabelBounce {
  0% { transform: translateX(0); }
  40% { transform: translateX(-25px); }
  70% { transform: translateX(10px); }
  100% { transform: translateX(0); }
}

.pricing-text-label.bounce-horizontal {
  animation: textLabelBounce 0.4s ease-out forwards;
}

/* Combined vertical bounce animation */
@keyframes verticalBounce {
  0% { transform: translateY(0); }
  30% { transform: translateY(-15px); }
  60% { transform: translateY(5px); }
  80% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

.pricing-content-wrapper.bounce-vertical {
  animation: verticalBounce 0.6s ease-out forwards;
}

/* Vertical exit animation */
@keyframes exitUp {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

.pricing-content-wrapper.exit-up {
  animation: exitUp 0.7s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* Text Block Animation Styles */
.text-animation-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  position: relative;
  overflow: hidden; /* Changed to hidden to ensure proper positioning */
}

.text-block {
  display: inline-block;
  position: relative;
  transform: translateX(100vw); /* Start fully off-screen to the right */
  white-space: nowrap;
  will-change: transform; /* Optimize for animation performance */
}

/* Entry animation */
.text-block.slide-in {
  transform: translateX(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); /* Slightly faster entry */
}

/* Bounce animation */
@keyframes blockBounce {
  0% { transform: translateX(0); }
  40% { transform: translateX(-25px); } /* Increased bounce for larger text */
  70% { transform: translateX(10px); }
  100% { transform: translateX(0); }
}

.text-block.bounce {
  animation: blockBounce 0.4s ease-out forwards;
}

/* Exit animation */
@keyframes exitLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100vw); } /* Ensure it's completely off-screen */
}

.text-block.exit {
  animation: exitLeft 0.5s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* Letter Sliding Animation Styles */
.letter-animation-container {
  /* Container for animation */
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.letters-wrapper {
  /* Wrapper for all letters */
  position: relative;
  white-space: nowrap;
  transform-origin: center;
}

.letter {
  /* Base styles for each letter */
  display: inline-block;
  transform: translateX(100vw); /* Start off-screen to the right */
  opacity: 0;
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); /* Custom easing for a nice feel */
}

/* Individual letter animations with staggered delays */
.letter.animate {
  transform: translateX(0); /* Final position */
  opacity: 1;
}

/* Bounce animation for the whole word */
@keyframes wordBounce {
  0% { transform: translateX(0); }
  40% { transform: translateX(-10px); }
  70% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.letters-wrapper.bounce {
  animation: wordBounce 0.5s ease-out forwards;
}

/* Exit animation */
@keyframes exitLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100vw); }
}

.letters-wrapper.exit {
  animation: exitLeft 0.6s ease-in forwards;
}
