/**
 * style.css — Custom styles cho landing page seo.huninna.com
 * Mobile-first, dùng chung với Tailwind CSS CDN
 */

/* ===== Smooth scroll ===== */
html {
  scroll-behavior: smooth;
}

/* ===== Sticky header shadow on scroll ===== */
#header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ===== Mobile menu transition ===== */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

#mobile-menu.open {
  max-height: 400px;
}

/* ===== Active nav link ===== */
.nav-active {
  color: #2563eb !important;
  font-weight: 600;
}

/* ===== Form focus styles (fallback) ===== */
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ===== Form error state ===== */
input.error, textarea.error, select.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* ===== Button loading state ===== */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== Fade-in animation for sections ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Zalo floating button (mobile) ===== */
.zalo-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 56px;
  height: 56px;
  background: #0068ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 104, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.zalo-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 104, 255, 0.5);
}

.zalo-float img {
  width: 28px;
  height: 28px;
}

/* ===== Pulse animation for Zalo button ===== */
.zalo-float::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #0068ff;
  animation: pulse-zalo 2s infinite;
}

@keyframes pulse-zalo {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ===== Pricing card hover lift ===== */
@media (min-width: 768px) {
  .pricing-card:hover {
    transform: translateY(-8px);
  }
}

/* ===== Service card icon bounce on hover ===== */
.service-card:hover .service-icon {
  transform: scale(1.1);
}

.service-icon {
  transition: transform 0.2s ease;
}

/* ===== Portfolio overlay animation ===== */
.portfolio-overlay {
  transition: opacity 0.3s ease;
}

/* ===== Responsive typography fine-tuning ===== */
@media (max-width: 640px) {
  h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 1.5rem !important;
  }

  .text-4xl {
    font-size: 2rem !important;
  }
}

/* ===== ROI Calculator — Coin rain animation ===== */
.coin {
  position: absolute;
  top: -30px;
  font-size: 24px;
  animation: coin-fall linear forwards;
  pointer-events: none;
  z-index: 5;
  will-change: transform;
}

@keyframes coin-fall {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.5);
    opacity: 1;
  }
  20% {
    transform: translateY(100px) rotate(180deg) scale(1);
    opacity: 1;
  }
  60% {
    transform: translateY(300px) rotate(540deg) scale(0.9);
    opacity: 0.7;
  }
  100% {
    transform: translateY(500px) rotate(720deg) scale(0.6);
    opacity: 0;
  }
}

/* ===== ROI Result highlight pulse ===== */
#roi-result:not(.hidden) #roi-loss-amount {
  animation: roi-pulse 0.6s ease-out;
}

@keyframes roi-pulse {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== ROI card slide between input/result ===== */
#roi-inputs, #roi-result {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#roi-inputs.hidden {
  display: none;
}

#roi-result:not(.hidden) {
  animation: roi-slide-up 0.5s ease-out;
}

@keyframes roi-slide-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== Range slider custom styles ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

/* ===== Print styles ===== */
@media print {
  #header, .zalo-float, footer {
    display: none !important;
  }
}
