/*
 * Statistics Effects CSS - PPID SMAN 1 Lubuk Sikaping
 * Efek visual tambahan untuk statistik yang lebih menarik
 */

/* ===== PARTICLE BACKGROUND EFFECT ===== */
.stats-section {
    position: relative !important;
    overflow: hidden !important;
}

.stats-section::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%) !important;
    animation: particleFloat 20s ease-in-out infinite !important;
    z-index: 1 !important;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
        opacity: 0.6;
    }
    66% {
        transform: translateY(-10px) rotate(240deg);
        opacity: 0.4;
    }
}

/* ===== GLOW EFFECTS ===== */
.stat-item {
    position: relative !important;
    overflow: visible !important;
}

.stat-item::after {
    content: '' !important;
    position: absolute !important;
    top: -2px !important;
    left: -2px !important;
    right: -2px !important;
    bottom: -2px !important;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent) !important;
    border-radius: 22px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    z-index: -1 !important;
}

.stat-item:hover::after {
    opacity: 1 !important;
}

/* ===== UNIQUE GLOW FOR EACH STAT ===== */
.stat-item:nth-child(1)::after {
    background: linear-gradient(45deg, 
        rgba(79, 172, 254, 0.3), 
        rgba(0, 242, 254, 0.3), 
        rgba(79, 172, 254, 0.3)) !important;
}

.stat-item:nth-child(2)::after {
    background: linear-gradient(45deg, 
        rgba(67, 233, 123, 0.3), 
        rgba(56, 249, 215, 0.3), 
        rgba(67, 233, 123, 0.3)) !important;
}

.stat-item:nth-child(3)::after {
    background: linear-gradient(45deg, 
        rgba(250, 112, 154, 0.3), 
        rgba(254, 225, 64, 0.3), 
        rgba(250, 112, 154, 0.3)) !important;
}

.stat-item:nth-child(4)::after {
    background: linear-gradient(45deg, 
        rgba(255, 154, 158, 0.3), 
        rgba(254, 207, 239, 0.3), 
        rgba(255, 154, 158, 0.3)) !important;
}

/* ===== PULSING ANIMATION ===== */
@keyframes statPulse {
    0%, 100% {
        box-shadow: 
            0 20px 40px rgba(0, 0, 0, 0.2),
            0 10px 20px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.3),
            0 15px 30px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

.stat-item.animated {
    animation: statPulse 2s ease-in-out !important;
}

/* ===== SHIMMER EFFECT ===== */
.stat-number {
    position: relative !important;
    overflow: hidden !important;
}

.stat-number::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent) !important;
    transition: left 0.5s ease !important;
}

.stat-number.counting::before {
    left: 100% !important;
}

/* ===== ICON ROTATION EFFECT ===== */
.stat-icon {
    transition: all 0.3s ease !important;
}

.stat-item:hover .stat-icon {
    transform: scale(1.1) rotate(5deg) !important;
}

/* ===== BORDER ANIMATION ===== */
@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.2);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.4);
    }
}

.stat-item {
    animation: borderGlow 3s ease-in-out infinite !important;
}

.stat-item:nth-child(1) {
    animation-delay: 0s !important;
}

.stat-item:nth-child(2) {
    animation-delay: 0.75s !important;
}

.stat-item:nth-child(3) {
    animation-delay: 1.5s !important;
}

.stat-item:nth-child(4) {
    animation-delay: 2.25s !important;
}

/* ===== LOADING ANIMATION ===== */
@keyframes loadingBar {
    0% {
        width: 0%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 0;
    }
}

.stat-item::before {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.6), 
        rgba(255, 255, 255, 0.8), 
        rgba(255, 255, 255, 0.6)) !important;
    border-radius: 0 0 20px 20px !important;
    animation: loadingBar 2s ease-in-out !important;
    z-index: 2 !important;
}

.stat-item:nth-child(1)::before {
    background: linear-gradient(90deg, 
        rgba(79, 172, 254, 0.6), 
        rgba(0, 242, 254, 0.8), 
        rgba(79, 172, 254, 0.6)) !important;
    animation-delay: 0.2s !important;
}

.stat-item:nth-child(2)::before {
    background: linear-gradient(90deg, 
        rgba(67, 233, 123, 0.6), 
        rgba(56, 249, 215, 0.8), 
        rgba(67, 233, 123, 0.6)) !important;
    animation-delay: 0.4s !important;
}

.stat-item:nth-child(3)::before {
    background: linear-gradient(90deg, 
        rgba(250, 112, 154, 0.6), 
        rgba(254, 225, 64, 0.8), 
        rgba(250, 112, 154, 0.6)) !important;
    animation-delay: 0.6s !important;
}

.stat-item:nth-child(4)::before {
    background: linear-gradient(90deg, 
        rgba(255, 154, 158, 0.6), 
        rgba(254, 207, 239, 0.8), 
        rgba(255, 154, 158, 0.6)) !important;
    animation-delay: 0.8s !important;
}

/* ===== HOVER SCALE EFFECT ===== */
.stat-item:hover {
    transform: translateY(-10px) scale(1.05) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ===== TEXT SHADOW EFFECTS ===== */
.stat-number {
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.stat-label {
    text-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 0 5px rgba(255, 255, 255, 0.2) !important;
}

/* ===== RESPONSIVE EFFECTS ===== */
@media (max-width: 768px) {
    .stat-item:hover {
        transform: translateY(-5px) scale(1.02) !important;
    }
    
    .stat-item::before {
        height: 2px !important;
    }
}

@media (max-width: 576px) {
    .stat-item:hover {
        transform: translateY(-3px) scale(1.01) !important;
    }
    
    .stat-number {
        text-shadow: 
            0 0 5px rgba(255, 255, 255, 0.2),
            0 1px 2px rgba(0, 0, 0, 0.3) !important;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .stat-item,
    .stat-item::before,
    .stat-item::after,
    .stats-section::before {
        animation: none !important;
        transition: none !important;
    }
    
    .stat-item:hover {
        transform: none !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .stat-item::before,
    .stat-item::after,
    .stats-section::before {
        display: none !important;
    }
    
    .stat-item {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}
