/* Custom CSS untuk animasi dan styling tambahan */

/* Smooth scrolling untuk seluruh halaman */
html {
  scroll-behavior: smooth;
}

/* Enhanced mobile navigation styles with better touch support */
/* Mobile Navigation Styles */
#mobile-menu {
  transition: all 0.3s ease-in-out;
  transform: translateY(-10px);
  opacity: 0;
  z-index: 50;
}

#mobile-menu.show {
  display: block !important;
  transform: translateY(0);
  opacity: 1;
  animation: slideDown 0.3s ease-out;
}

#mobile-menu:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Improved hamburger menu button with better touch support */
#mobile-menu-button {
  transition: all 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 51;
}

#mobile-menu-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

#mobile-menu-button:active {
  transform: scale(0.95);
}

/* Better navbar positioning and mobile menu container */
nav {
  transition: all 0.3s ease;
  position: relative;
  z-index: 40;
}

nav.scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Mobile menu container improvements */
@media (max-width: 767px) {
  #mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 50;
  }

  #mobile-menu button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 0;
  }

  #mobile-menu button:hover {
    background-color: #f3f4f6;
  }
}

/* Animasi untuk value proposition icons */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translateY(0);
  }
  40%,
  43% {
    transform: translateY(-30px);
  }
  70% {
    transform: translateY(-15px);
  }
  90% {
    transform: translateY(-4px);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Custom animations */
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Hover effects untuk cards */
.hover\:shadow-lg:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Transition untuk semua elemen */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow,
    transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Custom focus styles */
input:focus,
textarea:focus,
select:focus,
button:focus {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* FAQ accordion styles */
.faq-item .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-item.active .faq-answer {
  max-height: 200px;
  transition: max-height 0.3s ease-in;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

/* Enhanced responsive design for mobile with better touch targets */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Better mobile typography */
  .text-4xl {
    font-size: 2rem;
    line-height: 2.25rem;
  }

  .text-6xl {
    font-size: 2.5rem;
    line-height: 1.1;
  }

  /* Mobile-specific spacing */
  section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  /* Mobile button improvements with proper touch targets */
  button {
    min-height: 44px; /* Touch target size */
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Mobile form improvements */
  input,
  textarea,
  select {
    font-size: 16px; /* Prevent zoom on iOS */
    min-height: 44px;
  }

  /* Better mobile navigation positioning */
  nav .container {
    position: relative;
  }
}

@media (max-width: 640px) {
  /* Extra small screens */
  .text-3xl {
    font-size: 1.75rem;
    line-height: 2rem;
  }

  .text-5xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }

  /* Mobile grid improvements */
  .grid {
    gap: 1rem;
  }

  /* Mobile padding adjustments */
  .px-8 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Loading animation untuk form submission */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Print styles */
@media print {
  .sticky,
  nav,
  footer {
    display: none !important;
  }

  .bg-gradient-to-br {
    background: #f9fafb !important;
    color: #111827 !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .text-gray-600 {
    color: #374151 !important;
  }

  .text-gray-500 {
    color: #6b7280 !important;
  }

  .border-gray-200 {
    border-color: #9ca3af !important;
  }
}

/* Enhanced focus states for better accessibility */
button:focus-visible,
a:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Improved mobile touch targets and interaction */
@media (max-width: 768px) {
  button,
  a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Prevent text selection on buttons */
  button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }

  /* Better mobile menu item spacing */
  #mobile-menu .flex.flex-col.space-y-3 {
    padding: 1rem;
  }

  #mobile-menu button {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
  }
}
