/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0; /* Initially hidden */
}

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
}

.animate-blob {
    animation: blob 7s infinite;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Horizontal Scroll Hide */
/* Horizontal Scroll Hide */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
/* Scroll To Top Button */
#scrollToTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background-color: #3182f6; /* toss-blue */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#scrollToTopBtn:hover {
    background-color: #1b64da;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(49, 130, 246, 0.3);
}

/* Mobile Adjustment */
@media (max-width: 640px) {
    #scrollToTopBtn {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Mobile Menu Transition */
#mobile-menu {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

#mobile-menu.open {
    max-height: 300px;
    opacity: 1;
}

/* Visitor Stats Footer - Age App Style Match */
.stats-footer-container {
    max-width: 600px; /* Limit width like the app container */
    margin: 10px auto 20px; /* Reduced top margin */
    padding: 12px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* No border as per Age app */
}

.stats-grid {
    display: grid;
    /* Mobile First: 6 column grid for perfect 3/2 split */
    grid-template-columns: repeat(6, 1fr); 
    gap: 8px 4px; /* Row gap 8px, Col gap 4px */
    text-align: center;
}

/* Desktop: 5 Flat Columns */
@media (min-width: 640px) {
    .stats-footer-container {
        margin: 20px auto;
    }
    .stats-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }
    /* Reset spans for desktop */
    .stats-item { grid-column: auto !important; }
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 4px; /* Vertical padding, tight horizontal */
    background-color: #f9fafb; /* toss-grey-50 */
    border-radius: 16px;
    min-width: 0; /* Flexbox trunc fix */
}

/* Mobile Layout Logic (3 Top, 2 Bottom) */
/* Items 1,2,3 take 2 columns each (3 x 2 = 6) */
.stats-item:nth-child(1), 
.stats-item:nth-child(2), 
.stats-item:nth-child(3) {
    grid-column: span 2;
}

/* Items 4,5 take 3 columns each (2 x 3 = 6) -> Wider for Cumulative numbers */
.stats-item:nth-child(4), 
.stats-item:nth-child(5) {
    grid-column: span 3;
}

.stats-item .label {
    font-size: 11px;
    color: #8b95a1; /* toss-grey-400 */
    font-weight: 600;
    white-space: nowrap; /* Prevent wrapping */
}

.stats-item .value {
    font-size: 14px;
    font-weight: 700;
    color: #333d4b; /* toss-grey-700 */
    letter-spacing: -0.5px;
}

.stats-item.active-users .value {
    color: #3182f6; /* toss-blue */
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .stats-footer-container {
        margin: 20px 16px; /* Side margins on mobile */
    }
}
