/**
 * SML Stats Counter Widget CSS
 * Clinical Precision Design - 연구소/바이오텍 스타일
 */

/* ============================================
   SML Stats Counter - Precision Bio-Elegance
   Premium Dark Theme v2.0
   ============================================ */

.sml-stats-section {
    --sml-primary-dark: #0B1426;
    --sml-primary: #0A2540;
    --sml-primary-light: #243B5C;
    --sml-secondary: #00C9A7;
    --sml-accent: #00D4FF;
    --sml-text-light: #FFFFFF;
    --sml-text-muted: rgba(255, 255, 255, 0.6);
    --sml-border: rgba(0, 201, 167, 0.2);
    --sml-glass-bg: rgba(26, 43, 74, 0.6);
    --sml-glass-border: rgba(0, 201, 167, 0.15);
    --sml-glow-primary: rgba(0, 201, 167, 0.4);
    --sml-glow-accent: rgba(0, 212, 255, 0.3);
    
    /* Dynamic CSS Variable Support */
    background: var(--stats-bg, linear-gradient(180deg, var(--sml-primary-dark) 0%, var(--sml-primary) 50%, var(--sml-primary-dark) 100%));
    padding: 100px 40px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

/* DNA Pattern Background */
.sml-stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0, 201, 167, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(0, 212, 255, 0.06) 0%, transparent 50%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(0, 201, 167, 0.02) 100px,
            rgba(0, 201, 167, 0.02) 101px
        );
    pointer-events: none;
}

/* Floating particles effect */
.sml-stats-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 10% 20%, rgba(0, 201, 167, 0.3), transparent),
        radial-gradient(2px 2px at 30% 70%, rgba(0, 212, 255, 0.2), transparent),
        radial-gradient(1px 1px at 50% 30%, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 70% 80%, rgba(0, 201, 167, 0.25), transparent),
        radial-gradient(1px 1px at 90% 40%, rgba(0, 212, 255, 0.15), transparent);
    animation: sml-particles-float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sml-particles-float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
    50% { transform: translateY(-20px) rotate(1deg); opacity: 1; }
}

.sml-stats-title {
    text-align: center;
    font-family: var(--sml-font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 42px;
    font-weight: 700;
    color: var(--sml-text-light);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.sml-stats-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--sml-secondary), var(--sml-accent));
    margin: 20px auto 48px;
    border-radius: 2px;
    box-shadow: 0 0 20px var(--sml-glow-primary);
}

.sml-stats-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.sml-stats-container.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.sml-stats-item {
    text-align: center;
    flex: 1;
    min-width: 220px;
    padding: 40px 28px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sml-stats-item.with-divider:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 80px;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--sml-secondary), transparent);
    opacity: 0.3;
}

/* Glassmorphism Cards for Grid Layout */
.layout-grid .sml-stats-item {
    background: var(--sml-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--sml-glass-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Top accent line */
.layout-grid .sml-stats-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--sml-secondary), var(--sml-accent));
    border-radius: 0 0 4px 4px;
    transition: width 0.4s ease;
}

.layout-grid .sml-stats-item:hover::before {
    width: 100px;
}

.layout-grid .sml-stats-item:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 60px rgba(0, 201, 167, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: var(--sml-secondary);
}

.sml-stats-icon {
    font-size: 40px;
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 201, 167, 0.15), rgba(0, 212, 255, 0.1));
    border: 1px solid rgba(0, 201, 167, 0.2);
    color: var(--sml-secondary);
    transition: all 0.3s ease;
}

.sml-stats-item:hover .sml-stats-icon {
    box-shadow: 0 0 30px var(--sml-glow-primary);
    transform: scale(1.05);
}

.sml-stats-icon svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px var(--sml-glow-primary));
}

.sml-stats-number {
    font-family: var(--sml-font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 64px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--sml-secondary) 0%, var(--sml-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    filter: drop-shadow(0 0 20px var(--sml-glow-primary));
}

.sml-stats-prefix,
.sml-stats-suffix {
    font-family: var(--sml-font-mono, 'JetBrains Mono', monospace);
    font-size: 0.5em;
    font-weight: 500;
    vertical-align: top;
    margin-top: 10px;
    display: inline-block;
    opacity: 0.8;
}

.sml-stats-label {
    font-family: var(--sml-font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--sml-text-light);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.sml-stats-description {
    font-family: var(--sml-font-body, 'DM Sans', sans-serif);
    font-size: 14px;
    color: var(--sml-text-muted);
    line-height: 1.6;
    max-width: 200px;
    margin: 0 auto;
}

/* Staggered Animation */
.sml-stats-item {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: sml-stats-premium-fade-up 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sml-stats-item:nth-child(1) { animation-delay: 0.1s; }
.sml-stats-item:nth-child(2) { animation-delay: 0.2s; }
.sml-stats-item:nth-child(3) { animation-delay: 0.3s; }
.sml-stats-item:nth-child(4) { animation-delay: 0.4s; }
.sml-stats-item:nth-child(5) { animation-delay: 0.5s; }
.sml-stats-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes sml-stats-premium-fade-up {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Number counter glow animation */
@keyframes sml-number-pulse {
    0%, 100% { filter: drop-shadow(0 0 20px var(--sml-glow-primary)); }
    50% { filter: drop-shadow(0 0 30px var(--sml-glow-accent)); }
}

.sml-stats-item:hover .sml-stats-number {
    animation: sml-number-pulse 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .sml-stats-section {
        padding: 70px 20px;
    }

    .sml-stats-title {
        font-size: 32px;
    }

    .sml-stats-container {
        flex-direction: column;
        gap: 0;
    }

    .sml-stats-item {
        padding: 32px 20px;
    }

    .sml-stats-item.with-divider:not(:last-child)::after {
        display: none;
    }

    .sml-stats-item.with-divider:not(:last-child) {
        border-bottom: 1px solid var(--sml-glass-border);
    }

    .sml-stats-number {
        font-size: 48px;
    }

    .layout-grid .sml-stats-item {
        margin-bottom: 20px;
    }

    .sml-stats-container.layout-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
