/**
 * MasrDoctors - Modern Statistics Showcase
 * Glassmorphism design with advanced animations
 */

/* ============================================
   STATISTICS CARD - Glassmorphism Design
   ============================================ */

.stat-card {
    position: relative;
    height: 100%;
    min-height: 180px;
}

.stat-card-inner {
    position: relative;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(205, 0, 0, 0.1);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(205, 0, 0, 0.08);
}

/* Hover effect - lift and glow */
.stat-card:hover .stat-card-inner {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(205, 0, 0, 0.2);
    border-color: rgba(205, 0, 0, 0.3);
}

/* ============================================
   ICON STYLING
   ============================================ */

.stat-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 2;
}

.stat-icon-wrapper i {
    font-size: 2.5rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Icon animation on hover */
.stat-card:hover .stat-icon-wrapper {
    transform: scale(1.1) rotate(-5deg);
}

.stat-card:hover .stat-icon-wrapper i {
    transform: scale(1.1);
}

/* ============================================
   NUMBER STYLING - Bold & Gradient
   ============================================ */

.stat-number {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-weight: 800;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.stat-number .counter {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, #cd0000 0%, #ff4757 50%, #cd0000 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
    letter-spacing: -0.02em;
}

.stat-number .stat-suffix {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #cd0000;
    opacity: 0.7;
}

/* ============================================
   LABEL STYLING
   ============================================ */

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 2;
}

/* ============================================
   GLOW EFFECT - Background Decoration
   ============================================ */

.stat-glow {
    position: absolute;
    bottom: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 150%;
    height: 150%;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.stat-card:hover .stat-glow {
    opacity: 1;
    animation: pulse-glow-soft 2s ease-in-out infinite;
}

@keyframes pulse-glow-soft {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.5;
    }
}

/* ============================================
   SHIMMER EFFECT ON LOAD
   ============================================ */

.stat-card-inner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    transform: rotate(45deg);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */

.counter {
    display: inline-block;
    min-width: 2ch;
}

/* Number change animation */
@keyframes number-change {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .stat-card-inner {
        min-height: 160px;
        padding: 1.5rem 1rem;
    }

    .stat-icon-wrapper {
        width: 64px;
        height: 64px;
    }

    .stat-icon-wrapper i {
        font-size: 2rem;
    }

    .stat-number .counter {
        font-size: 2.25rem;
    }

    .stat-number .stat-suffix {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.875rem;
    }
}

/* ============================================
   RTL SUPPORT
   ============================================ */

[dir="rtl"] .stat-card:hover .stat-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    .stat-card-inner {
        background: rgba(26, 32, 44, 0.9);
        border-color: rgba(205, 0, 0, 0.2);
    }

    .stat-label {
        color: #e2e8f0;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .stat-card-inner,
    .stat-icon-wrapper,
    .stat-icon-wrapper i,
    .stat-glow {
        transition: none !important;
        animation: none !important;
    }

    .stat-card:hover .stat-card-inner {
        transform: none;
    }

    .stat-card:hover .stat-icon-wrapper {
        transform: none;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */

.stat-card.loading .stat-card-inner {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}
