/* Đồng bộ font như trang chính */
html, body, h1, h2, h3, h4, h5, h6, p, a, input, button, textarea {
  font-family: 'Baloo 2', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
}

/* Nav trong suốt + blur giống style của bạn */
.a4g-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.25);
}
.a4g-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: .75rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.a4g-logo {
  font-weight: 700; color: #0f172a; text-decoration: none;
  font-size: clamp(1rem, 3vw, 1.2rem);
}
.a4g-nav-links { display: flex; gap: 1rem; }
.a4g-link {
  position: relative; font-weight: 600; color: #0f172a; text-decoration: none;
  padding: .35rem .25rem;
}
.a4g-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, #22c55e, #3b82f6);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
  border-radius: 2px;
}
.a4g-link:hover::after, .a4g-active::after { transform: scaleX(1); }

/* Hero header đồng bộ gradient */
.a4g-hero {
  position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 5rem) 0;
  background: linear-gradient(45deg, #22c55e, #60a5fa, #34d399, #1e40af);
  background-size: 400%;
  animation: a4g-gradient 8s ease infinite;
}
@keyframes a4g-gradient {
  0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; }
}
.a4g-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 60% at 50% 40%, rgba(255,255,255,0.15), rgba(255,255,255,0) 60%);
}
.a4g-hero-title {
  color: #fff; text-shadow: 0 2px 5px rgba(0,0,0,.15);
  font-size: clamp(1.8rem, 7vw, 3.2rem); font-weight: 700; line-height: 1.2; margin-bottom: .5rem;
}
.a4g-hero-sub {
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.1);
  font-size: clamp(.95rem, 3vw, 1.1rem);
}

/* Card khớp style */
.a4g-card {
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(34,197,94,.08);
  border-radius: 16px;
  box-shadow: 0 8px 35px rgba(0,0,0,.07);
  padding: clamp(1rem, 3vw, 1.5rem);
}

/* Avatar - Enhanced Design */
.a4g-avatar {
  width: clamp(84px, 12vw, 112px);
  height: clamp(84px, 12vw, 112px);
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #f7fafc, #e6fffa);
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow: 
    0 8px 25px rgba(0,0,0,.12),
    0 4px 12px rgba(34,197,94,.15),
    inset 0 1px 0 rgba(255,255,255,.8);
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

/* Avatar gradient border */
.a4g-avatar::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #60a5fa, #34d399, #1e40af);
  background-size: 300%;
  animation: avatar-border-rotate 6s linear infinite;
  z-index: -1;
}

/* Avatar hover effects */
.a4g-avatar:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 
    0 12px 35px rgba(0,0,0,.15),
    0 6px 20px rgba(34,197,94,.25),
    inset 0 1px 0 rgba(255,255,255,.9);
}

.a4g-avatar:hover::before {
  animation-duration: 2s;
}

/* Avatar click animation */
.a4g-avatar:active {
  transform: scale(0.98);
  transition-duration: 0.1s;
}

/* Avatar status indicator */
.a4g-avatar::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  animation: avatar-pulse 2s ease-in-out infinite;
}

/* Avatar container for better positioning */
.a4g-avatar-container {
  position: relative;
  display: inline-block;
}

/* Avatar loading state */
.a4g-avatar.loading {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: avatar-shimmer 1.5s infinite;
}

.a4g-avatar.loading::after {
  display: none;
}

/* Avatar empty state */
.a4g-avatar.empty {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 2rem;
  font-weight: 700;
}

.a4g-avatar.empty::after {
  display: none;
}

/* Animations */
@keyframes avatar-border-rotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes avatar-pulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
  }
  50% { 
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(34,197,94,.3);
  }
}

@keyframes avatar-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Avatar buttons in form */
#changeAvatarBtn {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  color: #16a34a;
  border: 1px solid #bbf7d0;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(34,197,94,.1);
}

#changeAvatarBtn:hover {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34,197,94,.2);
}

#removeAvatarBtn {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #dc2626;
  border: 1px solid #fecaca;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(220,38,38,.1);
}

#removeAvatarBtn:hover {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220,38,38,.2);
}

/* Titles / inputs */
.a4g-title { font-size: clamp(1.2rem, 3.5vw, 1.5rem); font-weight: 700; }
.a4g-label { display: block; font-weight: 600; color: #0f172a; margin-bottom: .35rem; }
.a4g-input {
  width: 100%; border-radius: .75rem; border: 1px solid rgba(0,0,0,.08);
  padding: .65rem .9rem; outline: none; background: #fff;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.a4g-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}
.a4g-hint { font-size: .85rem; color: #6b7280; margin-top: .25rem; }

/* Stats enhancement */
.a4g-stat {
  background: linear-gradient(135deg, #fff, #f8fafc);
  border: 1px solid rgba(34,197,94,.1);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.a4g-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #22c55e, #60a5fa, #34d399);
  background-size: 200%;
  animation: stat-gradient 3s ease infinite;
}

.a4g-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34,197,94,.15);
  border-color: rgba(34,197,94,.2);
}

.a4g-stat-num {
  color: #16a34a;
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: stat-pulse 2s ease-in-out infinite;
}

.a4g-stat-label {
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes stat-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes stat-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Buttons */
.a4g-btn, .a4g-btn-secondary, .a4g-btn-danger, .a4g-btn-subtle {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px; padding: .65rem 1.1rem; font-weight: 700;
  transition: transform .15s ease, filter .2s ease, box-shadow .2s ease;
}
.a4g-btn { background: linear-gradient(90deg, #22c55e, #16a34a); color: #fff; box-shadow: 0 5px 14px rgba(34,197,94,.3); }
.a4g-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.a4g-btn-secondary { background: #fff; color: #065f46; border: 1px solid rgba(6,95,70,.2); }
.a4g-btn-secondary:hover { transform: translateY(-1px); }
.a4g-btn-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.a4g-btn-danger:hover { transform: translateY(-1px); }
.a4g-btn-subtle { background: #fff; color: #374151; border: 1px solid rgba(0,0,0,.08); padding: .4rem .65rem; font-weight: 600; }

/* Footer */
.a4g-footer { background: #1f2937; padding: clamp(1.5rem, 5vw, 2rem) 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .a4g-hero { animation: none !important; }
}
