@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Lao:wght@300;400;500;600;700;800&display=swap');

body {
    font-family: 'Noto Sans Lao', 'Inter', sans-serif;
}

/* Page transitions */
main {
    animation: pageIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal animations */
.modal-enter {
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-exit {
    animation: modalOut 0.18s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes modalOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.95) translateY(6px); }
}

.modal-backdrop-enter {
    animation: fadeIn 0.2s ease-out;
}

.modal-backdrop-exit {
    animation: fadeOut 0.18s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.75rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Marquee */
@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.animate-marquee {
    animation: marquee 25s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

/* Nav transitions */
.nav-link {
    transition: color 0.2s ease;
}

.nav-desktop-btn {
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-desktop-btn:hover {
    transform: translateY(-1px);
}

.nav-desktop-btn:active {
    transform: translateY(0) scale(0.96);
}

.nav-desktop-btn.nav-active {
    animation: navPillIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes navPillIn {
    from { opacity: 0.6; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

/* Mobile bottom nav */
.mobile-nav-btn {
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-btn:active {
    transform: scale(0.88) !important;
}

.mobile-nav-btn.mob-active {
    animation: mobNavPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-nav-btn.mob-active .mob-indicator {
    animation: indicatorGrow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mobNavPop {
    0% { transform: scale(0.85); }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes indicatorGrow {
    from { transform: scaleX(0); opacity: 0; }
    to { transform: scaleX(1); opacity: 1; }
}

/* Mobile topup center button pulse */
.mobile-topup-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: topupGlow 3s ease-in-out infinite;
}

@keyframes topupGlow {
    0%, 100% { box-shadow: 0 4px 15px -3px rgba(37, 99, 235, 0.3); }
    50% { box-shadow: 0 4px 25px -3px rgba(37, 99, 235, 0.5); }
}

.mobile-topup-btn:active {
    transform: scale(0.9) !important;
    animation: none;
}

/* Header scroll shadow */
header.scrolled {
    box-shadow: 0 1px 20px -4px rgba(0, 0, 0, 0.1);
}

/* Profile dropdown refined */
.profile-dropdown-open {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    pointer-events: auto !important;
}

/* Logo spin on hover */
.logo-icon {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-group:hover .logo-icon {
    transform: scale(1.1) rotate(6deg);
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -6px rgba(0, 0, 0, 0.04);
}

.card-hover:active {
    transform: translateY(0) scale(0.98);
}

/* Dropdown animation */
.dropdown-enter {
    animation: dropdownIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownIn {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Stagger children animation */
.stagger-in > * {
    opacity: 0;
    animation: staggerItem 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.4s; }

@keyframes staggerItem {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Pulse for balance updates */
@keyframes balancePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.balance-updated {
    animation: balancePulse 0.4s ease;
}

/* Spinner */
.spinner {
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth button press */
button {
    font-family: inherit;
    transition: transform 0.1s ease;
}

button:active:not(:disabled) {
    transform: scale(0.97);
}

input, select {
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

html {
    scroll-behavior: smooth;
}

/* Page loader dots */
.loader-dots span {
    animation: loaderBounce 1.2s ease-in-out infinite;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes loaderBounce {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

/* Navigation progress bar */
.nav-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #3b82f6);
    background-size: 200% 100%;
    z-index: 99999;
    animation: navProgressGrow 2s cubic-bezier(0.4, 0, 0.2, 1) forwards, navProgressShimmer 1s linear infinite;
    border-radius: 0 2px 2px 0;
}

@keyframes navProgressGrow {
    0% { width: 0; }
    20% { width: 40%; }
    50% { width: 70%; }
    80% { width: 88%; }
    100% { width: 95%; }
}

@keyframes navProgressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Navigation overlay */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(248, 250, 252, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    animation: navOverlayIn 0.15s ease-out;
}

@keyframes navOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nav-overlay .nav-spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.nav-overlay .nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

/* Toast notification */
.toast-enter {
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-exit {
    animation: toastOut 0.2s ease-in forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}
