/* ==========================================================================
   UI/UX IMPROVEMENTS - Tâm Anh Tax Agency
   ========================================================================== */

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Card hover effects */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -12px rgba(0, 51, 141, 0.15);
  border-color: #00338D;
}

/* Icon container */
.icon-box {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover .icon-box {
  transform: scale(1.1);
  box-shadow: 0 8px 20px -4px rgba(0, 51, 141, 0.3);
}

/* Form improvements */
.form-input {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  background-color: #fafafa;
}

.form-input:hover {
  border-color: #cbd5e1;
  background-color: #fff;
}

.form-input:focus {
  outline: none;
  border-color: #00338D;
  box-shadow: 0 0 0 4px rgba(0, 51, 141, 0.1);
  background-color: #fff;
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

/* Button improvements */
.btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
  background: transparent;
  color: #00338D;
  padding: 14px 24px;
  border-radius: 10px;
  font-weight: 600;
  border: 2px solid #00338D;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #00338D;
  color: white;
  transform: translateY(-2px);
}

/* Mobile hamburger menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  z-index: 60;
  background: transparent;
  border: none;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #00338D;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex;
  }
}

/* Mobile navigation */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  z-index: 55;
  padding: 80px 24px 24px;
  transition: right 0.3s ease;
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav a {
  display: block;
  padding: 16px 0;
  font-size: 1.125rem;
  color: #00338D;
  border-bottom: 1px solid #e5e7eb;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.mobile-nav a:hover {
  color: #f97316;
  padding-left: 8px;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: #00338D;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 40;
  box-shadow: 0 4px 15px rgba(0, 51, 141, 0.3);
  border: none;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #001f5c;
  transform: translateY(-4px);
}

/* Scroll animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* Testimonial card */
.testimonial-card {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 80px;
  font-family: Georgia, serif;
  color: #00338D;
  opacity: 0.1;
  line-height: 1;
}

/* Blog card */
.blog-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: #00338D;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.08);
}

.blog-card-image {
  position: relative;
  overflow: hidden;
}

.blog-card-image img {
  transition: transform 0.5s ease;
}

/* Timeline pulse */
.timeline-node {
  position: relative;
}

.timeline-node::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(0, 51, 141, 0.1);
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Map placeholder */
.map-placeholder {
  position: relative;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 16px;
  overflow: hidden;
}

.map-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Social icons */
.social-icons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.social-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

/* Read more link */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #00338D;
  font-weight: 600;
  font-size: 14px;
  transition: gap 0.2s ease, color 0.2s ease;
}

.read-more:hover {
  gap: 12px;
  color: #f97316;
}

/* Service icons */
.service-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: transform 0.3s ease;
}

.service-icon.blue { background: linear-gradient(135deg, #00338D 0%, #0052cc 100%); color: white; }
.service-icon.green { background: linear-gradient(135deg, #059669 0%, #10b981 100%); color: white; }
.service-icon.purple { background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%); color: white; }
.service-icon.orange { background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); color: white; }

.card-hover:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Hero decorations */
.hero-decoration {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-decoration-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 51, 141, 0.08) 0%, transparent 70%);
  top: -150px;
  right: -150px;
}

.hero-decoration-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.06) 0%, transparent 70%);
  bottom: -100px;
  left: 5%;
}

/* Header scroll effect */
header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* SVG Icon styling */
.svg-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.svg-icon-sm {
  width: 20px;
  height: 20px;
}

.svg-icon-lg {
  width: 48px;
  height: 48px;
}

/* Contact info card in footer */
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-info-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Category badges */
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-blue {
  background: #dbeafe;
  color: #00338D;
}

.badge-green {
  background: #d1fae5;
  color: #065f46;
}

.badge-orange {
  background: #fed7aa;
  color: #9a3412;
}

/* Active nav link indicator */
.nav-primary a.active {
  position: relative;
}

.nav-primary a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background: #00338D;
  border-radius: 2px;
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #00338D;
  outline-offset: 2px;
}

/* Loading state for buttons */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Success message */
.success-message {
  background: #d1fae5;
  color: #065f46;
  padding: 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Error message */
.error-message {
  background: #fee2e2;
  color: #991b1b;
  padding: 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

