@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");
body {
  font-family: "Inter", sans-serif;
}

/* XÓA: .gradient-bg */
/* XÓA: .glass-effect */
/* XÓA: .hover-lift, .hover-lift:hover */
/* XÓA: .pulse-glow, @keyframes pulse-glow */
/* XÓA: .function-card, .function-card::before, .function-card:hover, .function-card:nth-child(n), .dark .function-card, .dark .function-card:hover, .function-card:hover::before */

:root {
  --primary: #2563eb; /* Blue 600 - màu chủ đạo chuyên nghiệp */
  --primary-dark: #1d4ed8; /* Blue 700 - cho hover states */
  --accent: #0ea5e9; /* Sky 500 - màu nhấn nhẹ nhàng */
  --bg-light: #f8fafc; /* Slate 50 - nền sáng */
  --bg-dark: #0f172a; /* Slate 900 - nền tối */
  --text-primary: #1e293b; /* Slate 800 - text chính */
  --text-secondary: #64748b; /* Slate 500 - text phụ */
}

/* Base styles cho tất cả các section */
section {
  background: var(--bg-light);
  transition: background 0.3s ease;
}

.dark section {
  background: var(--bg-dark);
}

/* Introduction section */
#introduction {
  background: var(--bg-light);
}

.dark #introduction {
  background: var(--bg-dark);
}

/* Solution section */
#solution {
  background: var(--bg-light);
}

.dark #solution {
  background: var(--bg-dark);
}

/* Features section */
#features {
  background: var(--bg-light);
}

.dark #features {
  background: var(--bg-dark);
}

/* Document Processing Tabs Section */
#document-processing {
  background: var(--bg-light);
}

.dark #document-processing {
  background: var(--bg-dark);
}

/* Functions section */
#functions {
  background: var(--bg-light);
}

.dark #functions {
  background: var(--bg-dark);
}

/* Technical section */
#technical {
  background: var(--bg-light);
}

.dark #technical {
  background: var(--bg-dark);
}
/* Accent màu cam (giống text trong hình) */
.text-accent {
  color: #f97316; /* Tailwind orange-500 */
}

/* Hiệu ứng nổi/bounce */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.animate-bounce-slow {
  animation: bounce-slow 4s ease-in-out infinite;
}

/* Nút social có hiệu ứng hover */
.magnetic-button {
  transition: transform 0.3s ease, background 0.3s ease;
}
.magnetic-button:hover {
  transform: scale(1.1);
  background: rgba(255,255,255,0.15);
}

/* Counter số chạy animation */
.counter {
  transition: all 0.5s ease;
}

/* Footer gradient backup (phòng trường hợp không dùng Tailwind) */
footer#contact {
  background: linear-gradient(135deg, #0f172a, #1e3a8a, #312e81);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.footer-logo {
  padding: 8px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Xóa các background gradient cũ */
body {
  background: var(--bg-light);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  transition: background 0.3s ease, color 0.3s ease;
}

.dark body {
  background: var(--bg-dark);
  color: #e2e8f0;
}
a:focus, a:active, img:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Dark mode */
.dark body {
  background: var(--bg-dark);
  color: #e2e8f0;
}

/* Navbar chuyên nghiệp hơn */
.navbar-glass {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.dark .navbar-glass {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Navigation Link Styles */
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ea580c, #f97316);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  background: linear-gradient(90deg, #ea580c, #f97316);
}

/* Button styles */
.btn-primary {
  background: var(--primary);
  color: white;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Card styles */
.card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.dark .card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
  background: var(--bg-light);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.dark footer {
  background: var(--bg-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Background giống hệt functions section cho toàn bộ website */
body {
  background: linear-gradient(
    135deg,
    #f8fafc 0%,
    #dbeafe 30%,
    #e0e7ff 60%,
    #fce7f3 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
}
body {
  margin: 0;
  padding: 0;
}

/* Dark mode */
.dark body {
  background: linear-gradient(
    135deg,
    #111827 0%,
    #1e293b 30%,
    #111827 60%,
    #1f2937 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* Animation cho background */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Đảm bảo các pattern background cũ không hiển thị */
#functions::before {
  display: none;
}

/* Enhanced Navbar with Better Contrast */
.navbar-glass {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Dark mode navbar with better visibility */
.dark .navbar-glass {
  background: rgba(31, 41, 55, 0.95); /* gray-800 with transparency */
  border-bottom: 1px solid rgba(75, 85, 99, 0.5); /* gray-600 */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Navigation Link Styles */
.nav-link {
  position: relative;
  padding: 0.75rem 0;
  font-weight: 600;
  transition: all 0.3s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ea580c, #f97316);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  background: linear-gradient(90deg, #ea580c, #f97316);
}

/* Dark Mode Toggle Enhanced */
#theme-toggle {
  transition: all 0.3s ease;
  position: relative;
}

#theme-toggle:hover {
  transform: scale(1.05);
}

#theme-toggle:active {
  transform: scale(0.95);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .navbar-glass {
    padding: 1.25rem 1rem;
    background: rgba(255, 255, 255, 0.98);
  }

  .dark .navbar-glass {
    background: rgba(31, 41, 55, 0.98);
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 0.5rem 0;
  }

  nav ul {
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  #theme-toggle {
    top: 1rem;
    right: 1rem;
    padding: 0.75rem;
  }
}

@media (max-width: 640px) {
  nav ul {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.75rem;
  }
}

/* Active Navigation State */
.nav-link.active {
  color: #ea580c !important;
}

.dark .nav-link.active {
  color: #f97316 !important;
}

.nav-link.active::after {
  width: 100%;
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-light);
  transition: background-color 0.3s, color 0.3s;
}

body.dark {
  background: var(--bg-dark);
  color: #e5e7eb;
}

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: var(--accent);
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background: #ea580c;
  transform: scale(1.05);
}

.typing::after {
  content: "|";
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Fix for Swiper container */
.swiper-container {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.swiper-slide {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Make sure navigation buttons stay within bounds */
.swiper-button-prev,
.swiper-button-next {
  color: white;
  background-color: rgba(0, 0, 0, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swiper-button-prev:after,
.swiper-button-next:after {
  font-size: 18px;
}

/* Make sure pagination stays within bounds */
.swiper-pagination {
  position: absolute;
  bottom: 20px;
}

/*Funcition CacChucNangChinh
/* Functions Section Enhanced Styles */
#functions {
  position: relative;
  overflow: hidden;
}

#functions::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 80%,
      rgba(120, 119, 198, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 119, 198, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 40%,
      rgba(120, 219, 255, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* Function Cards Enhanced */
.function-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.function-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0)
  );
  border-radius: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.function-card:hover::before {
  opacity: 1;
}

/* Staggered Animation */
.function-card:nth-child(1) {
  animation-delay: 0.1s;
}
.function-card:nth-child(2) {
  animation-delay: 0.2s;
}
.function-card:nth-child(3) {
  animation-delay: 0.3s;
}
.function-card:nth-child(4) {
  animation-delay: 0.4s;
}
.function-card:nth-child(5) {
  animation-delay: 0.5s;
}

/* Responsive Design */
@media (max-width: 768px) {
  #functions .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  #functions .rounded-2xl {
    padding: 1.5rem;
  }

  #functions h2 {
    font-size: 2.5rem;
  }

  #functions .w-16 {
    width: 3.5rem;
    height: 3.5rem;
  }
}

@media (max-width: 640px) {
  #functions h2 {
    font-size: 2rem;
  }

  #functions .text-xl {
    font-size: 1.125rem;
  }
}

/* Dark mode enhancements */
.dark #functions {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

/* Hover effects for better interactivity */
.function-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.dark .function-card:hover {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

/* Ensure the button has proper styling */
.btn-primary {
  background-color: #2563eb;
  transition: background-color 0.3s;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}
.dark .card {
  background: #374151;
  border-color: #4b5563;
}

.dark .text-gray-700 {
  color: #d1d5db;
}

.dark .bg-gray-100 {
  background: #2d3748;
}

/*...........*/

header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

@media (max-width: 768px) {
  header .flex-col {
    align-items: center;
  }
}
/* Features carousel styles */
.features-carousel-container {
  overflow: hidden;
  margin: 0 -1rem; /* Compensate for the padding in feature cards */
}

.features-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.feature-card {
  height: 100%;
}

.features-dot {
  cursor: pointer;
  transition: all 0.3s ease;
}

.features-dot.active {
  transform: scale(1.2);
}

/* Tab Navigation Styles */
.tab-nav {
  position: relative;
  border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
  position: relative;
  color: #4b5563;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  color: #2563eb;
}

.tab-btn.active {
  color: #2563eb;
}

.tab-btn.active .tab-indicator {
  transform: scaleX(1);
}

.tab-indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #2563eb;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

/* Tab Content Styles */
.tab-content {
  position: relative;
  min-height: 500px; /* Set a minimum height to prevent layout shifts */
}

.tab-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.tab-panel.active {
  opacity: 1;
  visibility: visible;
  position: relative;
}

/* Force footer to break out completely */
footer {
  margin: 0;
  padding-bottom: 0; /* hoặc giảm nếu cần */
}

footer {
  width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Back to Top Button */
#backToTop {
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#backToTop:hover {
  transform: translateY(-2px) scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
  #backToTop {
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem;
  }

  #backToTop svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* Animation cho nút */
@keyframes bounceUp {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

#backToTop:hover {
  animation: bounceUp 0.6s ease;
}

/* Responsive */
@media (max-width: 768px) {
  #backToTop {
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem;
  }

  #backToTop svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* Prevent horizontal scroll only for footer */
html {
  overflow-x: hidden;
}

/* Ensure footer background extends fully */
footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100px;
  right: -100px;
  bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #312e81 100%);
  z-index: -1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tab-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
}

/* ===== SỬA LẠI NAVBAR STICKY ===== */

/* Đảm bảo header luôn sticky */
header {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
}

/* Enhanced Navbar with Better Contrast - GIỮ NGUYÊN */
.navbar-glass {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

/* Dark mode navbar - GIỮ NGUYÊN */
.dark .navbar-glass {
  background: rgba(31, 41, 55, 0.95) !important;
  border-bottom: 1px solid rgba(75, 85, 99, 0.5) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* ===== RESPONSIVE DESIGN - BẢO VỆ NAVBAR STICKY ===== */

/* Mobile First - Extra Small Devices (320px - 480px) */
@media (max-width: 480px) {
  /* Navigation responsive - GIỮ STICKY */
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
  }

  .navbar-glass {
    padding: 0.75rem 0.5rem !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }

  .dark .navbar-glass {
    background: rgba(31, 41, 55, 0.98) !important;
  }

  nav ul {
    gap: 0.25rem;
    padding: 0 0.25rem;
  }

  .nav-link {
    font-size: 0.65rem;
    padding: 0.25rem 0.125rem;
  }

  #theme-toggle {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    z-index: 60 !important;
  }

  /* Sections - KHÔNG ĐỘNG VÀO HEADER */
  #introduction,
  #support,
  #features,
  #overview,
  #functions,
  #technical {
    padding: 1.5rem 0.75rem !important;
  }

  #introduction .max-w-6xl,
  #support .max-w-6xl,
  #features .max-w-6xl,
  #overview .max-w-6xl,
  #functions .max-w-6xl,
  #technical .max-w-6xl {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Headings */
  #introduction h2,
  #support h2,
  #features h2,
  #overview h2,
  #functions h2,
  #technical h2 {
    font-size: 1.25rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.3;
  }

  #introduction h3,
  #support h3,
  #features h3,
  #overview h3,
  #functions h3,
  #technical h3 {
    font-size: 1rem !important;
  }

  /* Text */
  #introduction p,
  #support p,
  #features p,
  #overview p,
  #functions p,
  #technical p {
    font-size: 0.875rem;
    line-height: 1.5;
  }
}

/* Small Devices (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
  }

  .navbar-glass {
    padding: 1rem 0.75rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
  }

  .dark .navbar-glass {
    background: rgba(31, 41, 55, 0.95) !important;
  }

  nav ul {
    gap: 0.5rem;
  }

  .nav-link {
    font-size: 0.7rem;
    padding: 0.5rem 0.25rem;
  }

  #theme-toggle {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 60 !important;
  }

  #introduction,
  #support,
  #features,
  #overview,
  #functions,
  #technical {
    padding: 2rem 1rem !important;
  }

  #introduction h2,
  #support h2,
  #features h2,
  #overview h2,
  #functions h2,
  #technical h2 {
    font-size: 1.5rem !important;
  }
}

/* Medium Devices (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
  }

  .navbar-glass {
    padding: 1.25rem 1rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
  }

  .dark .navbar-glass {
    background: rgba(31, 41, 55, 0.95) !important;
  }

  nav ul {
    gap: 0.75rem;
  }

  .nav-link {
    font-size: 0.75rem;
  }

  #theme-toggle {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 60 !important;
  }

  #introduction,
  #support,
  #features,
  #overview,
  #functions,
  #technical {
    padding: 2.5rem 1.25rem !important;
  }

  #introduction h2,
  #support h2,
  #features h2,
  #overview h2,
  #functions h2,
  #technical h2 {
    font-size: 1.75rem !important;
  }
}

/* Large Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
  }

  .navbar-glass {
    padding: 1.5rem 1.25rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px) !important;
  }

  .dark .navbar-glass {
    background: rgba(31, 41, 55, 0.95) !important;
  }

  nav ul {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.8rem;
  }

  #theme-toggle {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    z-index: 60 !important;
  }

  #introduction,
  #support,
  #features,
  #overview,
  #functions,
  #technical {
    padding: 3rem 1.5rem !important;
  }

  #introduction h2,
  #support h2,
  #features h2,
  #overview h2,
  #functions h2,
  #technical h2 {
    font-size: 2rem !important;
  }
}

/* ===== ĐẢM BẢO NAVBAR LUÔN HIỂN THỊ ===== */
header.sticky {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
}

/* Navigation Link Styles - GIỮ NGUYÊN */
.nav-link {
  position: relative;
  padding: 0.75rem 0;
  font-weight: 600;
  transition: all 0.3s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ea580c, #f97316);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  background: linear-gradient(90deg, #ea580c, #f97316);
}

/* Active Navigation State */
.nav-link.active {
  color: #ea580c !important;
}

.dark .nav-link.active {
  color: #f97316 !important;
}

.nav-link.active::after {
  width: 100%;
}

/* Responsive Styles */
/* Large Tablets (769px - 1024px) - tiếp tục */
@media (min-width: 769px) and (max-width: 1024px) {
  footer .grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Desktop Small (1025px - 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
  .navbar-glass {
    padding: 1.5rem 1.25rem !important;
  }

  nav ul {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.8rem !important;
  }

  #functions .grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ===== ADDITIONAL RESPONSIVE FIXES ===== */

/* Swiper Navigation Buttons - Mobile */
@media (max-width: 768px) {
  .swiper-button-prev,
  .swiper-button-next {
    width: 30px !important;
    height: 30px !important;
    margin-top: -15px !important;
  }

  .swiper-button-prev:after,
  .swiper-button-next:after {
    font-size: 14px !important;
  }

  .swiper-pagination {
    bottom: 10px !important;
  }

  .swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
    margin: 0 3px !important;
  }
}

/* Features Carousel Responsive */
@media (max-width: 640px) {
  .features-carousel-container {
    overflow: visible;
  }

  .features-track {
    flex-direction: column;
    transform: none !important;
  }

  .feature-card {
    width: 100% !important;
    margin-bottom: 1rem;
  }

  .features-dot {
    display: none;
  }
}

/* Tab Content Images Responsive */
@media (max-width: 768px) {
  .tab-content {
    min-height: 150px !important;
  }

  .tab-panel img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 0.5rem;
  }
}

/* Back to Top Button Responsive */
@media (max-width: 768px) {
  #backToTop {
    bottom: 1rem !important;
    right: 1rem !important;
    width: 45px !important;
    height: 45px !important;
    font-size: 18px !important;
  }
}

@media (max-width: 480px) {
  #backToTop {
    bottom: 0.75rem !important;
    right: 0.75rem !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }
}

/* Text Overflow Protection */
@media (max-width: 640px) {
  * {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .nav-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Ensure no horizontal scroll */
@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  * {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* ===== ORIGINAL STYLES PRESERVED ===== */

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-light);
  transition: background-color 0.3s, color 0.3s;
}

body.dark {
  background: var(--bg-dark);
  color: #e5e7eb;
}

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: var(--accent);
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background: #ea580c;
  transform: scale(1.05);
}

.typing::after {
  content: "|";
  animation: blink 1s infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Fix for Swiper container */
.swiper-container {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.swiper-slide {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Make sure navigation buttons stay within bounds */
.swiper-button-prev,
.swiper-button-next {
  color: white;
  background-color: rgba(0, 0, 0, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swiper-button-prev:after,
.swiper-button-next:after {
  font-size: 18px;
}

/* Make sure pagination stays within bounds */
.swiper-pagination {
  position: absolute;
  bottom: 20px;
}

/* Functions Section Enhanced Styles */
#functions {
  position: relative;
  overflow: hidden;
}

#functions::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 80%,
      rgba(120, 119, 198, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 119, 198, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 40%,
      rgba(120, 219, 255, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* Function Cards Enhanced */
.function-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.function-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0)
  );
  border-radius: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.function-card:hover::before {
  opacity: 1;
}

/* Staggered Animation */
.function-card:nth-child(1) {
  animation-delay: 0.1s;
}
.function-card:nth-child(2) {
  animation-delay: 0.2s;
}
.function-card:nth-child(3) {
  animation-delay: 0.3s;
}
.function-card:nth-child(4) {
  animation-delay: 0.4s;
}
.function-card:nth-child(5) {
  animation-delay: 0.5s;
}

/* Dark mode enhancements */
.dark #functions {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

/* Hover effects for better interactivity */
.function-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.dark .function-card:hover {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

/* Ensure the button has proper styling */
.btn-primary {
  background-color: #2563eb;
  transition: background-color 0.3s;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.dark .card {
  background: #374151;
  border-color: #4b5563;
}

.dark .text-gray-700 {
  color: #d1d5db;
}

.dark .bg-gray-100 {
  background: #2d3748;
}

header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Features carousel styles */
.features-carousel-container {
  overflow: hidden;
  margin: 0 -1rem;
}

.features-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.feature-card {
  height: 100%;
}

.features-dot {
  cursor: pointer;
  transition: all 0.3s ease;
}

.features-dot.active {
  transform: scale(1.2);
}

/* Tab Navigation Styles */
.tab-nav {
  position: relative;
  border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
  position: relative;
  color: #4b5563;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  color: #2563eb;
}

.tab-btn.active {
  color: #2563eb;
}

.tab-btn.active .tab-indicator {
  transform: scaleX(1);
}

.tab-indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #2563eb;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

/* Tab Content Styles */
.tab-content {
  position: relative;
  min-height: 500px;
}

.tab-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.tab-panel.active {
  opacity: 1;
  visibility: visible;
  position: relative;
}

/* Tab System Styles */
.tab-button {
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tab-button.active {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.tab-button:not(.active):hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.tab-content {
  display: none;
  animation: fadeInUp 0.5s ease-out;
}

.tab-content.active {
  display: block;
}

/* Tab Content Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Process Flow Specific Animations */
@keyframes progressFlow {
  0% {
    width: 0%;
  }
  25% {
    width: 25%;
  }
  50% {
    width: 50%;
  }
  75% {
    width: 75%;
  }
  100% {
    width: 100%;
  }
}

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
}

/* Process Step Hover Effects */
.process-step:hover .bg-white\/80 {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.process-step.active .w-24.h-24 {
  transform: scale(1.1);
  animation: stepPulse 2s infinite;
}

@keyframes stepPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
  }
}

/* Counter Animation */
.counter {
  transition: all 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tab-button {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
  }

  .grid-cols-5,
  .grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 2rem;
  }

  .absolute.top-20 {
    display: none;
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .tab-button:not(.active):hover {
    background: rgba(59, 130, 246, 0.2);
  }
}

/* Animation Delays for Sequential Loading */
.incoming-step:nth-child(1) {
  animation-delay: 0.1s;
}
.incoming-step:nth-child(2) {
  animation-delay: 0.2s;
}
.incoming-step:nth-child(3) {
  animation-delay: 0.3s;
}
.incoming-step:nth-child(4) {
  animation-delay: 0.4s;
}
.incoming-step:nth-child(5) {
  animation-delay: 0.5s;
}

.outgoing-step:nth-child(1) {
  animation-delay: 0.1s;
}
.outgoing-step:nth-child(2) {
  animation-delay: 0.2s;
}
.outgoing-step:nth-child(3) {
  animation-delay: 0.3s;
}
.outgoing-step:nth-child(4) {
  animation-delay: 0.4s;
}

/* Tab Indicator Animation */
.tab-button::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.tab-button.active::before {
  width: 80%;
}

/* Force footer to break out completely */
footer {
  width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Back to Top Button */
#backToTop {
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#backToTop:hover {
  transform: translateY(-2px) scale(1.1);
}

/* Animation cho nút */
@keyframes bounceUp {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

#backToTop:hover {
  animation: bounceUp 0.6s ease;
}

/* Prevent horizontal scroll only for footer */
html {
  overflow-x: hidden;
}

/* Ensure footer background extends fully */
footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100px;
  right: -100px;
  bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #312e81 100%);
  z-index: -1;
}

/* ===== SỬA LẠI NAVBAR STICKY ===== */

/* Đảm bảo header luôn sticky */
header {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
}

/* Active Navigation State */
.nav-link.active {
  color: #ea580c !important;
}

.dark .nav-link.active {
  color: #f97316 !important;
}

.nav-link.active::after {
  width: 100%;
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

/* Base styles for mockup containers */
.mockup-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}

/* iPhone mockup responsive styles */
.iphone-mockup {
  position: relative;
  width: 16rem; /* 256px */
  margin: 0 auto;
}

.iphone-mockup .mockup-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #2563eb, #9333ea);
  border-radius: 3rem;
  filter: blur(2rem);
  opacity: 0.3;
  transform: scale(1.05);
  transition: opacity 0.5s ease;
}

.iphone-mockup:hover .mockup-glow {
  opacity: 0.5;
}

.iphone-mockup .device-frame {
  position: relative;
  background: #000;
  border-radius: 3rem;
  padding: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.5s ease;
}

.iphone-mockup:hover .device-frame {
  box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.4);
}

.iphone-mockup .device-screen {
  background: white;
  border-radius: 2.5rem;
  overflow: hidden;
  width: 16rem;
  height: 32.5rem;
}

/* Android mockup responsive styles */
.android-mockup {
  position: relative;
  width: 18rem; /* 288px */
  margin: 0 auto;
}

.android-mockup .mockup-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #059669, #10b981);
  border-radius: 2.5rem;
  filter: blur(2rem);
  opacity: 0.3;
  transform: scale(1.05);
  transition: opacity 0.5s ease;
}

.android-mockup:hover .mockup-glow {
  opacity: 0.5;
}

.android-mockup .device-frame {
  position: relative;
  background: #374151;
  border-radius: 2.5rem;
  padding: 0.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.5s ease;
}

.android-mockup:hover .device-frame {
  box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.4);
}

.android-mockup .device-screen {
  background: white;
  border-radius: 2rem;
  overflow: hidden;
  width: 18rem;
  height: 36.25rem;
}

/* Badge styles */
.device-badge {
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.iphone-badge {
  background: linear-gradient(to right, #2563eb, #9333ea);
}

.android-badge {
  background: linear-gradient(to right, #059669, #10b981);
}

/* Tablet styles */
@media (max-width: 1024px) {
  .mockup-container {
    gap: 3rem;
    padding: 3rem 1rem;
  }

  .iphone-mockup {
    width: 14rem;
  }

  .iphone-mockup .device-screen {
    width: 14rem;
    height: 28rem;
  }

  .android-mockup {
    width: 16rem;
  }

  .android-mockup .device-screen {
    width: 16rem;
    height: 32rem;
  }
}

/* Mobile landscape styles */
@media (max-width: 768px) {
  .mockup-container {
    flex-direction: column;
    gap: 4rem;
    padding: 2rem 1rem;
  }

  .iphone-mockup {
    width: 12rem;
  }

  .iphone-mockup .device-screen {
    width: 12rem;
    height: 24rem;
  }

  .android-mockup {
    width: 14rem;
  }

  .android-mockup .device-screen {
    width: 14rem;
    height: 28rem;
  }

  .device-badge {
    font-size: 0.75rem;
    padding: 0.375rem 1rem;
    bottom: -1.25rem;
  }
}

/* Mobile portrait styles */
@media (max-width: 480px) {
  .mockup-container {
    gap: 3rem;
    padding: 1.5rem 0.5rem;
  }

  .iphone-mockup {
    width: 10rem;
  }

  .iphone-mockup .device-screen {
    width: 10rem;
    height: 20rem;
  }

  .android-mockup {
    width: 11rem;
  }

  .android-mockup .device-screen {
    width: 11rem;
    height: 22rem;
  }

  /* Scale down internal content */
  .iphone-mockup .device-screen .p-4 {
    padding: 0.75rem;
  }

  .android-mockup .device-screen .p-4 {
    padding: 0.75rem;
  }

  /* Adjust app icon sizes */
  .iphone-mockup .w-12.h-12 {
    width: 2.5rem;
    height: 2.5rem;
  }

  .android-mockup .w-16.h-16 {
    width: 3rem;
    height: 3rem;
  }

  /* Adjust list item spacing */
  .space-y-3 > * + * {
    margin-top: 0.5rem;
  }

  .space-y-4 > * + * {
    margin-top: 0.75rem;
  }
}

/* Extra small devices */
@media (max-width: 320px) {
  .iphone-mockup {
    width: 9rem;
  }

  .iphone-mockup .device-screen {
    width: 9rem;
    height: 18rem;
  }

  .android-mockup {
    width: 10rem;
  }

  .android-mockup .device-screen {
    width: 10rem;
    height: 20rem;
  }

  .device-badge {
    font-size: 0.625rem;
    padding: 0.25rem 0.75rem;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .device-screen {
    background: #111827 !important;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .mockup-glow,
  .device-frame {
    transition: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .mockup-glow {
    opacity: 0.1;
  }

  .device-frame {
    border: 2px solid #000;
  }
}

/* ===== LANDSCAPE ORIENTATION FIXES ===== */
@media (max-height: 500px) and (orientation: landscape) {
  #hero-slider .swiper-slide {
    padding: 1rem 0;
  }

  #hero-slider .swiper-slide h1 {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  #hero-slider .swiper-slide p {
    font-size: 0.875rem !important;
    margin-bottom: 1rem !important;
  }

  .navbar-glass {
    padding: 0.5rem 1rem !important;
  }

  .nav-link {
    padding: 0.25rem 0 !important;
  }
}

/* ===== HIGH DPI SCREENS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .tab-panel img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  header,
  footer,
  #backToTop,
  .swiper-button-prev,
  .swiper-button-next,
  .swiper-pagination {
    display: none !important;
  }

  section {
    page-break-inside: avoid;
    margin: 1rem 0;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* Thêm vào cuối file styles.css hiện tại */

/* Dời hamburger menu về góc phải */
#mobile-menu-toggle {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 70 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(10px) !important;
  border-radius: 8px !important;
  padding: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

/* Đảm bảo hamburger luôn ở góc phải */
@media (max-width: 768px) {
  #mobile-menu-toggle {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
  }
}

/* ===== HAMBURGER MENU STYLES ===== */

/* Hamburger Button Animation */
#mobile-menu-toggle {
  transition: all 0.3s ease;
}

#mobile-menu-toggle:hover {
  transform: scale(1.05);
}

/* Hamburger Lines Animation */
.hamburger-line {
  transform-origin: center;
  transition: all 0.3s ease;
}

/* Active state - Transform to X */
#mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

#mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

#mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu Panel */
#mobile-menu {
  box-shadow: -10px 0 25px rgba(0, 0, 0, 0.15);
}

#mobile-menu.active {
  transform: translateX(0);
}

/* Mobile Navigation Links */
.mobile-nav-link {
  position: relative;
  overflow: hidden;
}

.mobile-nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.mobile-nav-link:hover::before {
  left: 100%;
}

.mobile-nav-link.active {
  background-color: rgba(249, 115, 22, 0.1);
  border-left-color: #f97316;
  color: #f97316;
}

.dark .mobile-nav-link.active {
  background-color: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}

/* Mobile Menu Animations */
.mobile-nav-link {
  transform: translateX(20px);
  opacity: 0;
  animation: slideInFromRight 0.3s ease forwards;
}

.mobile-nav-link:nth-child(1) {
  animation-delay: 0.1s;
}
.mobile-nav-link:nth-child(2) {
  animation-delay: 0.15s;
}
.mobile-nav-link:nth-child(3) {
  animation-delay: 0.2s;
}
.mobile-nav-link:nth-child(4) {
  animation-delay: 0.25s;
}
.mobile-nav-link:nth-child(5) {
  animation-delay: 0.3s;
}
.mobile-nav-link:nth-child(6) {
  animation-delay: 0.35s;
}

@keyframes slideInFromRight {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile Menu Close Animation */
#mobile-menu.closing .mobile-nav-link {
  animation: slideOutToRight 0.2s ease forwards;
}

@keyframes slideOutToRight {
  to {
    transform: translateX(20px);
    opacity: 0;
  }
}

/* Dark Mode Toggle Position Adjustment for Mobile */
@media (max-width: 768px) {
  #theme-toggle {
    top: 1rem !important;
    right: 4rem !important; /* Để chỗ cho hamburger button */
    padding: 0.5rem !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
  }

  #theme-toggle svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
  }
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Mobile Menu Responsive Adjustments */
@media (max-width: 480px) {
  #mobile-menu {
    width: 100vw;
    max-width: 100vw;
  }

  .mobile-nav-link {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
  }

  #mobile-menu-toggle {
    width: 2rem;
    height: 2rem;
  }

  .hamburger-line {
    width: 1.25rem;
    height: 2px;
  }
}

@media (max-width: 360px) {
  .mobile-nav-link {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
  }

  .mobile-nav-link svg {
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 0.5rem;
  }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Hide mobile menu on tablets and larger */
  #mobile-menu-toggle,
  #mobile-menu,
  #mobile-menu-overlay {
    display: none !important;
  }
}

/* Enhanced Desktop Navigation - Keep existing styles */
@media (min-width: 769px) {
  .navbar-glass {
    padding: 1.5rem 1.25rem !important;
  }

  nav ul {
    gap: 1.5rem;
  }

  .nav-link {
    font-size: 0.875rem;
    padding: 0.75rem 0;
  }
}

/* Smooth transitions for all interactive elements */
#mobile-menu * {
  transition: all 0.3s ease;
}

/* Focus states for accessibility
#mobile-menu-toggle:focus,
.mobile-nav-link:focus,
#mobile-menu-close:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
} */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .mobile-nav-link {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .dark .mobile-nav-link {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #mobile-menu,
  #mobile-menu-overlay,
  .hamburger-line,
  .mobile-nav-link {
    transition: none !important;
    animation: none !important;
  }
}

/* Print styles - Hide mobile menu */
@media print {
  #mobile-menu-toggle,
  #mobile-menu,
  #mobile-menu-overlay {
    display: none !important;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  #mobile-menu {
    padding-top: 0.5rem;
  }

  .mobile-nav-link {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
  }

  #mobile-menu .py-6 {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  #mobile-menu {
    -webkit-overflow-scrolling: touch;
  }

  body.menu-open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  #mobile-menu {
    transform: translate3d(100%, 0, 0);
  }

  #mobile-menu.active {
    transform: translate3d(0, 0, 0);
  }
}
/* Chỉ áp dụng cho mobile (màn hình nhỏ hơn 640px) */
@media (max-width: 640px) {
  /* Tăng kích thước icon container trên mobile */
  #functions .w-16.h-16 {
    width: 5rem !important;
    height: 5rem !important;
  }

  /* Tăng kích thước icon bên trong trên mobile */
  #functions .w-16.h-16 svg,
  #functions .w-16.h-16 img {
    width: 2.5rem !important;
    height: 2.5rem !important;
  }
}
/* Sửa lỗi lệch Features trên mobile - Force center */
@media (max-width: 639px) {
  /* Reset toàn bộ container */
  #features {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #features .max-w-6xl {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Container carousel */
  #features .features-carousel-container {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  /* Track hiển thị dạng cột */
  #features .features-track {
    flex-direction: column !important;
    transform: none !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
  }

  /* Feature cards */
  #features .feature-card {
    width: 100% !important;
    max-width: 300px !important;
    padding: 0 !important;
    margin: 0 auto 1.5rem auto !important;
    flex-shrink: 1 !important;
  }

  /* Card content */
  #features .feature-card > div {
    margin: 0 auto !important;
    width: 100% !important;
  }

  /* Ẩn dots */
  #features .features-dot {
    display: none !important;
  }

  /* Ẩn container dots */
  #features .flex.justify-center.mt-8 {
    display: none !important;
  }
}

/* Hamburger Menu Animation Mượt */
#mobile-menu-toggle {
  position: relative;
  z-index: 60;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#mobile-menu-toggle .hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: currentColor;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center;
  border-radius: 1px;
}

#mobile-menu-toggle .hamburger-line:nth-child(1) {
  margin-bottom: 5px;
}

#mobile-menu-toggle .hamburger-line:nth-child(2) {
  margin-bottom: 5px;
}

/* Animation khi menu mở */
#mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

#mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Hover effect */
#mobile-menu-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

#mobile-menu-toggle:hover .hamburger-line {
  background-color: #f97316;
}

/*Active state styling */
#mobile-menu-toggle.active {
  background-color: rgba(249, 115, 22, 0.1);
  border-radius: 8px;
}

#mobile-menu-toggle.active .hamburger-line {
  background-color: #f97316;
}

/* Navbar cố định đơn giản */
@media (max-width: 768px) {
  header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
  }

  body {
    padding-top: 80px !important;
  }

  .dark header {
    background: rgba(31, 41, 55, 0.95) !important;
  }
}

/* Responsive styles for Introduction section */
@media (max-width: 768px) {
  #introduction {
    padding: 2rem 1rem;
  }

  #introduction .flex-col {
    gap: 2rem;
  }

  #introduction .lg\:w-1\/2 {
    width: 100%;
  }

  #introduction .text-2xl {
    font-size: 1.5rem;
  }

  #introduction .text-lg {
    font-size: 1rem;
  }

  #introduction .grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  #introduction .text-2xl.font-bold {
    font-size: 1.25rem;
  }

  #introduction .text-sm {
    font-size: 0.875rem;
  }

  #introduction img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 640px) {
  #introduction {
    padding: 1.5rem 1rem;
  }

  #introduction h2 {
    font-size: 1.75rem;
  }

  #introduction .grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  #introduction .text-2xl.font-bold {
    font-size: 1.125rem;
  }

  #introduction .text-sm {
    font-size: 0.75rem;
  }
}

/* Responsive styles for Process section */
@media (max-width: 768px) {
  .process-step {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .process-step .w-24.h-24 {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
  }

  .process-step .text-xl {
    font-size: 1.125rem;
  }

  .process-step .text-lg {
    font-size: 1rem;
  }

  .process-step .p-8 {
    padding: 1rem;
  }

  .process-step .mb-12 {
    margin-bottom: 1rem;
  }

  .process-step .gap-8 {
    gap: 1rem;
  }

  .process-step .gap-6 {
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .process-step {
    padding: 0.75rem;
  }

  .process-step .w-24.h-24 {
    width: 3rem;
    height: 3rem;
  }

  .process-step .text-xl {
    font-size: 1rem;
  }

  .process-step .text-lg {
    font-size: 0.875rem;
  }
}

.nav-link,
.nav-link:focus,
.nav-link:active,
.nav-link:visited,
.nav-link:focus-visible,
.mobile-nav-link,
.mobile-nav-link:focus,
.mobile-nav-link:active,
.mobile-nav-link:visited,
.mobile-nav-link:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.contact-link {
  transition: color 0.2s;
  color: #000000;
}
.contact-link:hover {
  color: #1d4ed8 !important;
  text-decoration: none;
}

/* Đảm bảo màu nổi bật ở dark mode */
.dark .contact-link {
  color: #000000 !important;
}
.dark .contact-link:hover {
  color: #1d4ed8 !important;
}

/* Loại bỏ outline và box-shadow khi focus/active vào thẻ <a> trong footer */
footer a:focus,
footer a:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Responsive Footer */
@media (max-width: 1024px) {
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  footer .flex-col.items-end {
    align-items: center !important;
  }
  footer .counter-box {
    width: 100% !important;
    max-width: 350px !important;
    margin: 0 auto !important;
  }
}
@media (max-width: 768px) {
  footer {
    padding-top: 2rem !important;
    padding-bottom: 1rem !important;
  }
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  footer .flex-col.items-start {
    align-items: center !important;
    text-align: center !important;
  }
  footer .flex-col.items-end {
    align-items: center !important;
    text-align: center !important;
  }
  footer img[alt="CUSC Logo"] {
    margin-left: auto;
    margin-right: auto;
  }
  footer .space-y-2 {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
  }
  footer .counter-box {
    width: 100% !important;
    max-width: 350px !important;
    margin: 0 auto !important;
  }
  footer .flex.flex-row.gap-8 {
    gap: 2rem !important;
  }
  footer .w-14.h-14 {
    width: 2.5rem !important;
    height: 2.5rem !important;
  }
  footer h5,
  footer p,
  footer span,
  footer a {
    font-size: 1rem !important;
  }
}
@media (max-width: 480px) {
  footer {
    padding-top: 1rem !important;
    padding-bottom: 0.5rem !important;
  }
  footer .w-14.h-14 {
    width: 2rem !important;
    height: 2rem !important;
  }
  footer .counter-box {
    max-width: 98vw !important;
    padding: 0 !important;
  }
  footer .counter-content {
    padding: 1rem !important;
  }
  footer h5,
  footer p,
  footer span,
  footer a {
    font-size: 0.95rem !important;
  }
}
@media (max-width: 640px) {
  #contactModal .max-w-2xl {
    max-width: 98vw !important;
    width: 98vw !important;
    padding: 0.5rem !important;
  }
  #contactModal .p-6 {
    padding: 0.5rem !important;
  }
  #contactModal .w-20,
  #contactModal .h-20 {
    width: 3.5rem !important;
    height: 3.5rem !important;
  }
  #contactModal .w-24,
  #contactModal .h-24 {
    width: 4.5rem !important;
    height: 4.5rem !important;
  }
  #contactModal .ml-4 {
    margin-left: 0.5rem !important;
  }
  #contactModal .flex-1,
  #contactModal .space-y-6 {
    text-align: center !important;
  }
  #contactModal h2 {
    font-size: 1.2rem !important;
    margin-bottom: 0.5rem !important;
  }
  #contactModal .text-lg {
    font-size: 1rem !important;
  }
  #contactModal .text-sm {
    font-size: 0.9rem !important;
  }
  #closeContactModal {
    top: 0.5rem !important;
    right: 0.5rem !important;
    font-size: 1.5rem !important;
    z-index: 10;
  }
}
