/**
 * Coffee Shop V2 - Sticky Stats Bar
 * Floating stats bar with fog shadow effect
 */

/* ============================================
   STICKY STATS BAR
   ============================================ */

.stats-bar-sticky {
    position: sticky;
    top: 70px; /* Below navbar */
    background: linear-gradient(135deg,
        rgba(27, 77, 62, 0.98) 0%,
        rgba(15, 41, 34, 0.98) 50%,
        rgba(45, 111, 95, 0.98) 100%
    );
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    z-index: 900;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

/* Fog shadow effect (sương mú) */
.stats-bar-sticky::before {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(
        to bottom,
        rgba(27, 77, 62, 0.4) 0%,
        rgba(27, 77, 62, 0.25) 25%,
        rgba(27, 77, 62, 0.1) 50%,
        rgba(27, 77, 62, 0.05) 75%,
        transparent 100%
    );
    filter: blur(8px);
    pointer-events: none;
    z-index: -1;
}

/* Top glow effect */
.stats-bar-sticky::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.5) 25%,
        rgba(212, 175, 55, 0.8) 50%,
        rgba(212, 175, 55, 0.5) 75%,
        transparent 100%
    );
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Stats bar hover effect */
.stats-bar-sticky:hover {
    background: linear-gradient(135deg,
        rgba(27, 77, 62, 1) 0%,
        rgba(15, 41, 34, 1) 50%,
        rgba(45, 111, 95, 1) 100%
    );
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(212, 175, 55, 0.2);
}

/* Stats bar when scrolled */
.stats-bar-sticky.scrolled {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(212, 175, 55, 0.15);
}

/* Counter numbers */
.stats-bar-sticky .counter {
    font-size: 3rem;
    font-weight: 700;
    color: #d4a574;
    font-family: 'Playfair Display', serif;
    text-shadow:
        0 0 20px rgba(212, 175, 55, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    line-height: 1;
    opacity: 1 !important;
    transition: all 0.3s ease;
}

/* Counter hover effect */
.stats-bar-sticky .col-md-3:hover .counter {
    transform: scale(1.1);
    text-shadow:
        0 0 30px rgba(212, 175, 55, 0.6),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Stats labels */
.stats-bar-sticky .stats-label {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    font-weight: 400;
    margin: 0;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    opacity: 1 !important;
    transition: all 0.3s ease;
}

.stats-bar-sticky .col-md-3:hover .stats-label {
    color: #d4a574;
    transform: translateY(-2px);
}

/* Separator between stats */
.stats-bar-sticky .col-md-3 {
    position: relative;
    padding: 0.5rem 1rem;
}

.stats-bar-sticky .col-md-3:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(212, 175, 55, 0.3) 50%,
        transparent 100%
    );
}

/* Animated particles background */
.stats-bar-sticky .container {
    position: relative;
    overflow: hidden;
}

.stats-bar-sticky .container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
    animation: particleFloat 20s linear infinite;
    pointer-events: none;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(50px, 50px) rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
    .stats-bar-sticky {
        top: 60px;
        padding: 1.5rem 0;
    }

    .stats-bar-sticky .counter {
        font-size: 2.5rem;
    }

    .stats-bar-sticky .stats-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 767px) {
    .stats-bar-sticky {
        top: 56px;
        padding: 1rem 0;
    }

    .stats-bar-sticky .counter {
        font-size: 2rem;
    }

    .stats-bar-sticky .stats-label {
        font-size: 0.75rem;
    }

    /* Remove vertical separator on mobile */
    .stats-bar-sticky .col-md-3::after {
        display: none;
    }

    /* Add horizontal separator */
    .stats-bar-sticky .col-6:nth-child(1)::after,
    .stats-bar-sticky .col-6:nth-child(2)::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 10%;
        right: 10%;
        height: 1px;
        background: linear-gradient(
            to right,
            transparent 0%,
            rgba(212, 175, 55, 0.3) 50%,
            transparent 100%
        );
    }

    /* Reduce fog effect on mobile */
    .stats-bar-sticky::before {
        bottom: -20px;
        height: 20px;
        filter: blur(4px);
    }
}

/* ============================================
   SCROLLED STATE ANIMATION
   ============================================ */

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.stats-bar-sticky.animate-in {
    animation: slideInFromTop 0.5s ease-out;
}

/* ============================================
   LOADING STATE
   ============================================ */

.stats-bar-sticky .counter.loading {
    animation: counterPulse 1.5s ease-in-out infinite;
}

@keyframes counterPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .stats-bar-sticky {
        position: static;
        background: #1e3a5f;
        box-shadow: none;
    }

    .stats-bar-sticky::before,
    .stats-bar-sticky::after {
        display: none;
    }
}
