/* css/style.css - Custom animations and tweaks on top of Tailwind */

/* Smooth fade-in for pages */
.page-fade {
  animation: pageFadeIn 0.6s ease-out;
}

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

/* Simple spinner */
.spinner {
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}

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

/* Animated ShowData logo loader */
.logo-spinner {
  animation: orbit 1s linear infinite;
}

@keyframes orbit {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.05);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Logo subtle float + glow */
.logo-orbit {
  position: relative;
  animation: logoFloat 3.2s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.35);
}

.logo-orbit img {
  transition: transform 0.45s ease-out;
}

.logo-orbit:hover img {
  transform: scale(1.12);
}

@keyframes logoFloat {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(-6px) rotate(2deg) scale(1.04);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

/* Toast notification */
.toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 300px;
  max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.2);
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 500;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
}

.toast.hiding {
  animation: toastSlideOut 0.3s ease-in forwards;
}

/* Make form controls a bit taller across the app (only inside forms) */
form input,
form select,
form textarea {
  min-height: 48px;
}

form button {
  min-height: 48px;
}

/* Animation variables and reusable motion system */
:root {
  --anim-distance: 32px;
  --anim-duration: 0.85s;
  --anim-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (max-width: 480px) {
  :root {
    --anim-distance: 18px;
    --anim-duration: 0.68s;
  }
}

.fade-up,
.fade-in,
.scale-in,
.slide-in-left,
.slide-in-right,
.scroll-card,
.scroll-title,
.scroll-about-text,
.scroll-about-image,
.scroll-stat-card,
.scroll-about-p {
  opacity: 0;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.fade-up,
.scroll-card,
.scroll-about-text,
.scroll-about-image,
.scroll-about-p {
  transform: translate3d(0, var(--anim-distance), 0);
}

.slide-in-left {
  transform: translate3d(calc(-1 * var(--anim-distance)), 0, 0);
}

.slide-in-right {
  transform: translate3d(var(--anim-distance), 0, 0);
}

.scale-in {
  transform: scale(0.96) translateZ(0);
}

.fade-up.show,
.scroll-card.card-pop-in,
.scroll-about-text.about-text-slide,
.scroll-about-image.about-image-pop,
.scroll-stat-card.stat-card-pop,
.scroll-about-p.para-pop {
  animation: fadeUp var(--anim-duration) var(--anim-ease) forwards;
}

.fade-in.show {
  animation: fadeIn var(--anim-duration) var(--anim-ease) forwards;
}

.scale-in.show {
  animation: scaleIn var(--anim-duration) var(--anim-ease) forwards;
}

.slide-in-left.show {
  animation: slideInLeft var(--anim-duration) var(--anim-ease) forwards;
}

.slide-in-right.show {
  animation: slideInRight var(--anim-duration) var(--anim-ease) forwards;
}

.scroll-title.title-slide-in {
  animation: fadeUp var(--anim-duration) var(--anim-ease) forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

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

@keyframes scaleIn {
  to {
    opacity: 1;
    transform: scale(1) translateZ(0);
  }
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.hover-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.hover-lift:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
}

/* Icon Bounce Animation - transform only */
.icon-bounce {
  animation: iconBounce 3s ease-in-out infinite;
  will-change: transform;
}

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

.icon-bounce:hover {
  transform: translateY(-2px);
  transition: transform 0.2s ease;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

.logo-spin-on-scroll {
  transition: transform 0.3s ease-out;
}

.logo-spin-on-scroll.logo-spin {
  animation: logoSpin 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes logoSpin {
  0% {
    transform: scale(0.5) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Stat Card Animations - Optimized for desktop */
.scroll-stat-card {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: visible !important;
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.scroll-stat-card.stat-card-pop {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  animation: statCardPop 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes statCardPop {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (min-width: 1025px) {
  .scroll-stat-card {
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
}

/* Enhanced Card Pop Animation */
@keyframes cardPopIn {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(60px) rotate(-8deg);
  }
  50% {
    transform: scale(1.08) translateY(-15px) rotate(3deg);
  }
  70% {
    transform: scale(0.98) translateY(5px) rotate(-1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(0deg);
  }
}

/* Mobile and reduced motion optimizations - Disable animations completely */
@media (max-width: 768px) {
  .scroll-card,
  .scroll-title,
  .scroll-about-text,
  .scroll-about-image,
  .scroll-stat-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  
  .icon-bounce {
    animation: none !important;
  }
  
  .animate-float {
    animation: none !important;
  }
  
  .card-pop-in,
  .title-slide-in,
  .about-text-slide,
  .about-image-pop,
  .stat-card-pop {
    animation: none !important;
  }
  
  .animate-fade-in-left,
  .animate-fade-in-right,
  .animate-bounce-in {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* Optimize animations on mobile devices - faster but still smooth */
@media (max-width: 1024px) {
  .scroll-card,
  .scroll-title,
  .scroll-about-text,
  .scroll-about-image,
  .scroll-stat-card {
    transition-duration: 0.3s !important;
    animation-duration: 0.3s !important;
  }
  
  .icon-bounce {
    animation-duration: 2s !important;
  }
  
  .animate-float {
    animation-duration: 3s !important;
  }
}

/* Desktop optimizations for smooth performance */
@media (min-width: 1025px) {
  /* Enable hardware acceleration for smooth animations */
  .scroll-card,
  .scroll-title,
  .scroll-about-text,
  .scroll-about-image,
  .scroll-stat-card,
  .scroll-about-p,
  .animate-fade-in-left,
  .animate-fade-in-right {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: opacity, transform;
  }
  
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }
  
  /* Optimize floating animations */
  .animate-float {
    will-change: transform;
    transform: translateZ(0);
  }
  
  /* Better icon animations */
  .icon-bounce {
    will-change: transform;
    transform: translateZ(0);
  }
}

/* Android-specific: lighten animations instead of disabling them */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  html[data-android="true"] *,
  body[data-android="true"] * {
    animation-duration: calc(var(--anim-duration) * 0.85) !important;
    transition-duration: 0.2s;
  }
}

/* Respect user's reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .scroll-card,
  .scroll-title,
  .scroll-about-text,
  .scroll-about-image,
  .scroll-stat-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  
  .icon-bounce,
  .animate-float,
  .animate-bounce-in {
    animation: none !important;
  }
}

/* Testimonials pagination buttons */
#testimonialsPrevBtn,
#testimonialsNextBtn {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#testimonialsPrevBtn:hover:not(:disabled),
#testimonialsNextBtn:hover:not(:disabled) {
  transform: scale(1.1);
}

#testimonialsPrevBtn:disabled,
#testimonialsNextBtn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Mobile responsive for testimonials navigation */
@media (max-width: 768px) {
  #testimonialsPrevBtn,
  #testimonialsNextBtn {
    width: 36px;
    height: 36px;
  }
  
  #testimonialsPrevBtn svg,
  #testimonialsNextBtn svg {
    width: 18px;
    height: 18px;
  }
}

/* Mobile Menu Styles */
#mobileMenu {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
}

#mobileMenu.hidden {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

#mobileMenu:not(.hidden) {
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.3s ease-in, opacity 0.3s ease-in, padding 0.3s ease-in;
}

#mobileMenuToggle {
  transition: transform 0.2s ease;
}

#mobileMenuToggle:active {
  transform: scale(0.95);
}

/* Smooth icon transitions */
#menuIcon,
#closeIcon {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Success Modal - Lightweight, Android-safe animations */
.success-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.success-modal-overlay:not(.success-modal-hidden) {
  opacity: 1;
  pointer-events: auto;
}

.success-modal-overlay.success-modal-hiding {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.success-modal {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(16, 185, 129, 0.1);
  text-align: center;
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.success-modal:not(.success-modal-hidden) {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.success-modal.success-modal-hiding {
  opacity: 0;
  transform: scale(0.95) translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.success-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(16, 185, 129, 0.3);
  animation: successIconPop 0.4s ease-out 0.1s backwards;
}

.success-modal-icon svg {
  width: 36px;
  height: 36px;
  stroke: #10b981;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.success-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.success-modal-message {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.5;
}

/* Success icon animation - lightweight, Android-safe */
@keyframes successIconPop {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile optimizations */
@media (max-width: 480px) {
  .success-modal {
    padding: 24px 20px;
    max-width: 90%;
    border-radius: 12px;
  }

  .success-modal-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }

  .success-modal-icon svg {
    width: 32px;
    height: 32px;
  }

  .success-modal-title {
    font-size: 18px;
  }

  .success-modal-message {
    font-size: 13px;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .success-modal,
  .success-modal-overlay,
  .success-modal-icon {
    animation: none !important;
    transition: opacity 0.15s ease !important;
  }

  .success-modal {
    transform: none !important;
  }

  .success-modal:not(.success-modal-hidden) {
    transform: none !important;
  }

  .success-modal.success-modal-hiding {
    transform: none !important;
  }
}


