:root {
  --primary-color: #16a34a;
  --primary-dark: #15803d;
  --secondary-color: #f59e0b;
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --modal-duration: 300ms;
  --modal-radius: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-in-out forwards;
}

/* Modal (Project-wide) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1200;
  transition: opacity var(--modal-duration) cubic-bezier(.22,1,.36,1);
  will-change: opacity;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-panel {
  border-radius: var(--modal-radius);
  transition: transform var(--modal-duration) cubic-bezier(.22,1,.36,1), opacity var(--modal-duration) cubic-bezier(.22,1,.36,1);
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.modal-panel.hidden-state {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.modal-panel.visible-state {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body {
    font-family: 'Chakra Petch', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    z-index: 20;
    height: 100%;
}

.navbar-brand img {
    height: 100%;
    max-height: 100%;
    width: auto;
    object-fit: contain;
}
.nav-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(22, 163, 74, 0.05);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 20;
}

.btn-auth {
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-login {
    color: var(--text-secondary);
    background: transparent;
}

.btn-login:hover { 
    color: var(--primary-color); 
}

.btn-register {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.btn-register:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-center { display: none; }
    
    .navbar-container {
        padding: 0 0.75rem;
    }
    
    .navbar-brand img {
        height: 100%;
    }
    
    .navbar-brand span {
        font-size: 1rem;
    }
    
    .nav-right {
        gap: 0.25rem;
    }
    
    .btn-auth {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .navbar-brand img {
        height: 100%;
    }
    
    .btn-auth {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .btn-login {
        display: none; /* Ẩn nút Đăng nhập trên màn hình rất nhỏ */
    }
}

/* Mobile Menu */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: white;
    padding: 2rem;
    z-index: 999;
    overflow-y: auto;
}

.mobile-menu-overlay.active { 
    display: block; 
}

/* Dark Mode */
body.theme-dark {
    --bg-color: #0b1220;
    --surface-color: #0f172a;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border-color: #1f2937;
}

.theme-dark .navbar { 
    background: rgba(15, 23, 42, 0.95); 
}

.theme-dark .bg-white { 
    background-color: var(--surface-color) !important; 
}

.theme-dark .border-gray-100, 
.theme-dark .border-gray-200 { 
    border-color: var(--border-color) !important; 
}

.theme-dark .text-gray-800, 
.theme-dark .text-gray-700 { 
    color: var(--text-primary) !important; 
}

.theme-dark .text-gray-600, 
.theme-dark .text-gray-500, 
.theme-dark .text-gray-400 { 
    color: var(--text-secondary) !important; 
}

.theme-dark .bg-gray-50 { 
    background-color: #162032 !important; 
}

.theme-dark .bg-gray-100 { 
    background-color: #1e293b !important; 
}

/* Modern Buttons */
.btn { 
    display:inline-flex; 
    align-items:center; 
    justify-content:center; 
    padding:0.5rem 1rem; 
    border-radius:0.375rem; 
    font-weight:500; 
    cursor:pointer; 
    gap:0.5rem; 
    border:none; 
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary { 
    background:var(--primary-color); 
    color:#fff; 
}

.btn-primary:hover { 
    background:var(--primary-dark); 
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.card { 
    background:var(--surface-color); 
    border-radius:12px; 
    box-shadow:0 1px 3px rgba(0,0,0,0.1); 
    border:1px solid var(--border-color); 
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.font-bold { font-weight: bold; }
.italic { font-style: italic; }
.underline { text-decoration: underline; }

/* Responsive Ranking Tabs */
@media (max-width: 640px) {
    .flex.bg-gray-100.p-1.rounded-lg {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .flex.bg-gray-100.p-1.rounded-lg::-webkit-scrollbar {
        display: none;
    }
}

/* ===== Hero Banner Effects ===== */
.hero-banner-wrap {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
    animation: hero-pulse 3s ease-in-out infinite;
    cursor: pointer;
}

.hero-banner-wrap:hover .hero-banner-img {
    transform: scale(1.02);
    transition: transform 0.6s ease;
}

.hero-banner-img {
    transition: transform 0.6s ease;
    display: block;
}

/* Glow border */
.hero-banner-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 40px rgba(22, 163, 74, 0.15);
    animation: hero-glow 3s ease-in-out infinite alternate;
}

/* Shimmer sweep */
.hero-banner-shimmer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 60%
    );
    background-size: 200% 100%;
    animation: hero-shimmer 4s ease-in-out infinite;
}

@keyframes hero-pulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(22, 163, 74, 0.15), 0 2px 8px rgba(0,0,0,0.08); }
    50%       { box-shadow: 0 8px 48px rgba(22, 163, 74, 0.35), 0 2px 8px rgba(0,0,0,0.08); }
}

@keyframes hero-glow {
    from { box-shadow: inset 0 0 30px rgba(22, 163, 74, 0.10); }
    to   { box-shadow: inset 0 0 60px rgba(245, 158, 11, 0.18); }
}

@keyframes hero-shimmer {
    0%   { background-position: -100% 0; }
    60%  { background-position: 200% 0; }
    100% { background-position: 200% 0; }
}

