/* ===================================
   Custom Styles for wpiot - WhatsApp IoT
   MOBILE OPTIMIZED
   =================================== */

/* Global Styles */
* {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-padding-top: 80px;
}

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* WhatsApp Gradient */
.whatsapp-gradient {
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
}

/* Header Scroll Effect */
#header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Navigation Links */
.nav-link {
  position: relative;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Mobile Menu Styles */
#mobile-menu.open {
  transform: translateX(0);
}

#mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-link {
  transition: all 0.2s ease;
}

.mobile-nav-link:active {
  background-color: rgba(18, 140, 126, 0.1);
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blob {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(20px, -30px) scale(1.05);
  }
  66% {
    transform: translate(-15px, 15px) scale(0.95);
  }
  100% {
    transform: translate(0px, 0px) scale(1);
  }
}

/* Fade In Classes */
.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-delay {
  opacity: 0;
  animation: fadeIn 0.6s ease-out 0.2s forwards;
}

.fade-in-delay-2 {
  opacity: 0;
  animation: fadeIn 0.6s ease-out 0.4s forwards;
}

/* Blob Animation */
.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

/* Feature Cards */
.feature-card {
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

@media (hover: hover) {
  .feature-card:hover {
    border-color: #128c7e;
    transform: translateY(-8px);
  }
}

/* Pricing Grid - FULLY RESPONSIVE */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
}

@media (max-width: 1280px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 700px;
  }
}

@media (max-width: 640px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 400px;
    padding: 0;
  }
}

/* Pricing Cards */
.pricing-card {
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pricing-card-featured {
  border: 2px solid #128c7e;
}

@media (hover: hover) {
  .pricing-card:hover {
    border-color: #128c7e;
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(18, 140, 126, 0.15);
  }
}

/* Pricing Animation */
@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pricing-card-animate {
  animation: cardSlideUp 0.5s ease-out forwards;
}

.pricing-card-animate:nth-child(1) {
  animation-delay: 0.05s;
}
.pricing-card-animate:nth-child(2) {
  animation-delay: 0.1s;
}
.pricing-card-animate:nth-child(3) {
  animation-delay: 0.15s;
}
.pricing-card-animate:nth-child(4) {
  animation-delay: 0.2s;
}

/* Badge Popular */
.badge-popular {
  position: relative;
  overflow: hidden;
}

.badge-popular::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

/* Pricing Buttons */
.pricing-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

@media (hover: hover) {
  .pricing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(18, 140, 126, 0.25);
  }
}

/* Pricing Features */
.pricing-feature {
  transition: all 0.2s ease;
}

/* Code Blocks - Mobile Scrollable */
.code-block {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #4a5568 #1a202c;
}

.code-block::-webkit-scrollbar {
  height: 6px;
}

.code-block::-webkit-scrollbar-track {
  background: #1a202c;
  border-radius: 3px;
}

.code-block::-webkit-scrollbar-thumb {
  background: #4a5568;
  border-radius: 3px;
}

/* Example Cards */
.example-card {
  transition: all 0.3s ease;
}

@media (hover: hover) {
  .example-card:hover {
    transform: translateY(-4px);
  }
}

/* Contact Info Cards */
.contact-info-card {
  transition: all 0.2s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
  border-radius: 4px;
}

/* Form Inputs Focus */
input:focus,
textarea:focus {
  border-color: #128c7e !important;
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.1);
}

/* Success/Error Messages */
.success-message {
  background: #dcfce7;
  border: 1px solid #22c55e;
  color: #166534;
  padding: 1rem;
  border-radius: 0.75rem;
  margin-top: 1rem;
  animation: fadeIn 0.3s ease-out;
}

.error-message {
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
  padding: 1rem;
  border-radius: 0.75rem;
  margin-top: 1rem;
  animation: fadeIn 0.3s ease-out;
}

/* Scroll Top Button */
#scroll-top {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#scroll-top.show {
  opacity: 1;
  visibility: visible;
}

/* WhatsApp Float Button */
#whatsapp-float {
  animation: whatsapp-bounce 2s ease-in-out infinite;
  background: linear-gradient(135deg, #075e54 0%, #128c7e 100%) !important;
}

.whatsapp-pulse {
  box-shadow: 0 0 0 0 rgba(18, 140, 126, 0.7);
  animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(18, 140, 126, 0.7);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(18, 140, 126, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(18, 140, 126, 0);
  }
}

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

#whatsapp-float:hover {
  animation: none;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  /* Disable complex animations on mobile for performance */
  .fade-in,
  .fade-in-delay,
  .fade-in-delay-2 {
    animation: none;
    opacity: 1;
  }

  .animate-blob {
    animation: none;
  }

  /* Safe area insets for notched devices */
  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  }

  /* Larger touch targets */
  a,
  button {
    min-height: 44px;
  }
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

*:focus-visible {
  outline: 2px solid #128c7e;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  header,
  footer,
  #scroll-top,
  #whatsapp-float,
  #mobile-menu,
  #mobile-menu-overlay {
    display: none !important;
  }
}
