/* css/home/community-stats.css */

/* === Community Stats Section Styles === */

.community-stats {
    padding: var(--space-3xl) 0;
    background: linear-gradient(135deg, 
        var(--primary) 0%,
        var(--secondary) 50%,
        var(--accent) 100%);
    color: var(--text-inverse);
    position: relative;
    overflow: hidden;
}

.community-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, 
            rgba(255, 255, 255, 0.1) 0%, 
            transparent 50%),
        radial-gradient(circle at 80% 20%, 
            rgba(255, 255, 255, 0.1) 0%, 
            transparent 50%);
    pointer-events: none;
}

.community-stats::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2xl);
    text-align: center;
    margin-bottom: var(--space-3xl);
    position: relative;
    z-index: 2;
}

.stat-item {
    padding: var(--space-xl);
    position: relative;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    transform: scale(0.95);
    transition: all var(--transition-normal);
    z-index: -1;
}

.stat-item:hover::before {
    transform: scale(1);
    background: rgba(255, 255, 255, 0.15);
}

.stat-item .stat-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    line-height: 1;
    display: block;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-item .stat-value::after {
    content: '+';
    font-size: 2rem;
    position: absolute;
    top: -0.5rem;
    right: -1.5rem;
    opacity: 0.7;
}

.stat-item:last-child .stat-value::after {
    content: '';
}

.stat-item .stat-label {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Counting animation */
.stat-value {
    opacity: 0;
    transform: translateY(20px);
    animation: count-up 1s ease-out forwards;
}

.stat-value[data-count] {
    counter-reset: count var(--count-end);
}

.stat-value::before {
    content: counter(count);
}

@keyframes count-up {
    from {
        opacity: 0;
        transform: translateY(20px);
        --count-end: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        --count-end: attr(data-count);
    }
}

/* Community CTA */
.community-cta {
    text-align: center;
    position: relative;
    z-index: 2;
}

.community-cta h3 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.community-cta p {
    font-size: 1.25rem;
    margin-bottom: var(--space-2xl);
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.cta-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.cta-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-inverse);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.cta-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left var(--transition-normal);
}

.cta-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cta-actions .btn:hover::before {
    left: 100%;
}

.cta-actions .btn-secondary {
    background: var(--text-inverse);
    color: var(--primary);
    border-color: var(--text-inverse);
}

.cta-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* Floating elements */
.floating-element {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.floating-element:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: -2s;
}

.floating-element:nth-child(3) {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

/* Responsive Community Stats */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }
    
    .community-cta h3 {
        font-size: 2rem;
    }
    
    .community-cta p {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .community-stats {
        padding: var(--space-2xl) 0;
    }
    
    .stat-item .stat-value {
        font-size: 2.5rem;
    }
    
    .stat-item .stat-label {
        font-size: 1rem;
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-actions .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .stat-item {
        padding: var(--space-lg);
    }
    
    .stat-item .stat-value {
        font-size: 2rem;
    }
    
    .community-cta h3 {
        font-size: 1.75rem;
    }
    
    .community-cta p {
        font-size: 1rem;
    }
    
    .floating-element {
        display: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .community-stats::after {
        animation: none;
    }
    
    .stat-value {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .floating-element {
        animation: none;
    }
    
    .cta-actions .btn:hover {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .community-stats {
        background: var(--primary);
        border: 2px solid var(--text-inverse);
    }
    
    .stat-item::before {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid var(--text-inverse);
    }
    
    .cta-actions .btn {
        border: 2px solid var(--text-inverse);
    }
}