/* Premium Analytics Cards - Glassmorphism Animations */

/* Training Patterns Orbit Animation */
.training-orbit-container {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 12px;
}

.training-orbit-rings {
    position: absolute;
    inset: 0;
    animation: orbit-spin 20s linear infinite;
}

.training-orbit-ring {
    fill: none;
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

.training-orbit-ring-outer {
    stroke: rgba(99, 102, 241, 0.3);
}

.training-orbit-ring-inner {
    stroke: rgba(6, 182, 212, 0.25);
}

.training-orbit-balls {
    position: absolute;
    inset: 0;
}

.training-orbit-ball {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--ball-size, 8px);
    height: var(--ball-size, 8px);
    margin: calc(var(--ball-size, 8px) / -2);
    background: var(--ball-color, #06b6d4);
    border-radius: 50%;
    box-shadow: 
        0 0 12px var(--ball-glow, rgba(6, 182, 212, 0.6)),
        0 0 24px var(--ball-glow, rgba(6, 182, 212, 0.3));
    animation: var(--orbit-anim, orbit-outer) var(--orbit-duration, 8s) linear infinite;
    animation-delay: var(--ball-delay, 0s);
    transform-origin: center center;
}

.training-orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    z-index: 2;
    animation: center-pulse 2.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes orbit-outer {
    0% { transform: rotate(0deg) translateX(36px) scale(1); }
    50% { transform: rotate(180deg) translateX(36px) scale(1.15); }
    100% { transform: rotate(360deg) translateX(36px) scale(1); }
}

@keyframes orbit-inner {
    0% { transform: rotate(0deg) translateX(26px) scale(1); }
    50% { transform: rotate(-180deg) translateX(26px) scale(1.1); }
    100% { transform: rotate(-360deg) translateX(26px) scale(1); }
}

@keyframes center-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3)); }
    50% { transform: translate(-50%, -50%) scale(1.08); filter: drop-shadow(0 6px 18px rgba(99, 102, 241, 0.4)); }
}

.training-patterns-card:hover .training-orbit-ball {
    box-shadow: 
        0 0 18px var(--ball-glow, rgba(6, 182, 212, 0.8)),
        0 0 36px var(--ball-glow, rgba(6, 182, 212, 0.4));
}

/* Allostatic Load Curve Animation */
.allostatic-curve-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 16px 0;
}

.allostatic-curve-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.allostatic-curve-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 24;
    stroke-linecap: round;
}

.allostatic-curve-track {
    fill: none;
    stroke: url(#allostaticGradient);
    stroke-width: 6;
    stroke-linecap: round;
    filter: drop-shadow(0 4px 16px rgba(15, 23, 42, 0.4));
}

.allostatic-zone-fill {
    opacity: 0.15;
}

.allostatic-indicator {
    fill: #fff;
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 3;
    filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.5));
    animation: indicator-pulse 2s ease-in-out infinite;
}

.allostatic-indicator-glow {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 8;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes indicator-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.5)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 6px 20px rgba(239, 68, 68, 0.7)); }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.3; stroke-width: 8; }
    50% { opacity: 0.6; stroke-width: 12; }
}

.allostatic-zone-labels {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px 0;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.allostatic-zone-label {
    text-align: center;
    flex: 1;
}

.allostatic-zone-label.active {
    color: #ef4444;
    font-weight: 600;
}

/* Stress Response Animation */
.stress-response-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px;
    margin-top: 12px;
}

.stress-response-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: stress-dot-pulse 2s ease-in-out infinite;
}

.stress-response-dot.sympathetic {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

.stress-response-dot.parasympathetic {
    background: linear-gradient(135deg, #22c55e, #10b981);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.5);
    animation-delay: 1s;
}

@keyframes stress-dot-pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.2); opacity: 1; }
}

.stress-response-bar {
    flex: 1;
    max-width: 180px;
    height: 8px;
    background: linear-gradient(90deg, 
        rgba(239, 68, 68, 0.3) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(34, 197, 94, 0.3) 100%
    );
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.stress-response-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: left 0.5s ease-out;
}

/* Premium Card Glass Effect Enhancement */
.metric-card.training-patterns-card,
.metric-card.allostatic-card {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.12) 0%, 
        rgba(255, 255, 255, 0.04) 100%
    );
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 32px rgba(15, 23, 42, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}



/* ============================================
   FERTILITY CARD - MIRACLE OF LIFE ANIMATION v2
   FIXED: Content visibility preserved
   ============================================ */

/* Reset any problematic styles */
.fertility-card {
    position: relative !important;
    overflow: visible !important;
    background: linear-gradient(135deg, 
        rgba(236, 72, 153, 0.12) 0%,
        rgba(168, 85, 247, 0.08) 50%,
        rgba(99, 102, 241, 0.05) 100%) !important;
    border: 1px solid rgba(236, 72, 153, 0.25) !important;
}

/* Remove problematic pseudo-elements */
.fertility-card::before,
.fertility-card::after {
    display: none !important;
}

/* Particles container - absolutely positioned, non-blocking */
.fertility-particles {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    z-index: 0 !important;
    border-radius: inherit !important;
}

/* Floating particles */
.fertility-particle {
    position: absolute !important;
    border-radius: 50% !important;
    opacity: 0 !important;
    animation: cellFloat 10s ease-in-out infinite !important;
    pointer-events: none !important;
}

.fertility-particle:nth-child(1) {
    width: 5px; height: 5px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.7), transparent);
    left: 8%; animation-delay: 0s;
}
.fertility-particle:nth-child(2) {
    width: 4px; height: 4px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.6), transparent);
    left: 22%; animation-delay: 2s;
}
.fertility-particle:nth-child(3) {
    width: 6px; height: 6px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.5), transparent);
    left: 42%; animation-delay: 4s;
}
.fertility-particle:nth-child(4) {
    width: 3px; height: 3px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6), transparent);
    left: 62%; animation-delay: 1s;
}
.fertility-particle:nth-child(5) {
    width: 5px; height: 5px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.5), transparent);
    left: 78%; animation-delay: 3s;
}
.fertility-particle:nth-child(6) {
    width: 4px; height: 4px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.5), transparent);
    left: 92%; animation-delay: 5s;
}

/* DNA helix - subtle accent */
.fertility-dna {
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 8px !important;
    height: 50px !important;
    opacity: 0.12 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(236, 72, 153, 0.5) 3px,
        rgba(236, 72, 153, 0.5) 5px,
        transparent 5px,
        transparent 8px
    ) !important;
    animation: dnaHelix 5s ease-in-out infinite !important;
}

/* Icon glow effect */
.fertility-card .metric-icon {
    animation: eggGlow 4s ease-in-out infinite !important;
    filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.4)) !important;
}

/* CRITICAL: All content above animations */
.fertility-card > .metric-icon,
.fertility-card > .metric-value,
.fertility-card > .metric-label,
.fertility-card > div:not(.fertility-particles):not(.fertility-dna) {
    position: relative !important;
    z-index: 5 !important;
}

/* Keyframe animations */
@keyframes cellFloat {
    0% { bottom: -5%; opacity: 0; transform: translateX(0) scale(0.6); }
    15% { opacity: 0.8; }
    50% { opacity: 0.5; transform: translateX(12px) scale(1); }
    85% { opacity: 0.3; }
    100% { bottom: 105%; opacity: 0; transform: translateX(-8px) scale(0.8); }
}

@keyframes dnaHelix {
    0%, 100% { transform: translateY(-50%) translateX(-1px); opacity: 0.1; }
    50% { transform: translateY(-50%) translateX(1px); opacity: 0.15; }
}

@keyframes eggGlow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.3)); }
    50% { filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.6)); }
}

/* ============================================
   FERTILITY CARD - PULSING GLOW ANIMATION
   Subtle, visible pulsing effect
   ============================================ */

/* Pulsing border glow */
.fertility-card {
    animation: fertilityPulse 3s ease-in-out infinite !important;
    box-shadow: 
        0 0 15px rgba(236, 72, 153, 0.2),
        inset 0 0 20px rgba(236, 72, 153, 0.05) !important;
}

@keyframes fertilityPulse {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(236, 72, 153, 0.15),
            0 0 20px rgba(168, 85, 247, 0.1),
            inset 0 0 15px rgba(236, 72, 153, 0.03);
        border-color: rgba(236, 72, 153, 0.25);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(236, 72, 153, 0.35),
            0 0 40px rgba(168, 85, 247, 0.2),
            inset 0 0 25px rgba(236, 72, 153, 0.08);
        border-color: rgba(236, 72, 153, 0.45);
    }
}

/* Pulsing background gradient */
.fertility-card::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    border-radius: inherit !important;
    background: radial-gradient(
        ellipse at center,
        rgba(236, 72, 153, 0.08) 0%,
        transparent 70%
    ) !important;
    animation: fertilityBreath 4s ease-in-out infinite !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

@keyframes fertilityBreath {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Ensure content stays above */
.fertility-card > *:not(.fertility-particles):not(.fertility-dna) {
    position: relative !important;
    z-index: 5 !important;
}

/* ============================================
   FERTILITY CARD - GENDER-SPECIFIC STYLES
   ============================================ */

/* Female variant - pink/purple tones */
.fertility-female {
    background: linear-gradient(135deg, 
        rgba(236, 72, 153, 0.12) 0%,
        rgba(168, 85, 247, 0.08) 50%,
        rgba(219, 39, 119, 0.05) 100%) !important;
    border-color: rgba(236, 72, 153, 0.25) !important;
}

.fertility-female::before {
    background: radial-gradient(
        ellipse at center,
        rgba(236, 72, 153, 0.1) 0%,
        transparent 70%
    ) !important;
}

@keyframes fertilityPulseFemale {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(236, 72, 153, 0.15),
            0 0 20px rgba(168, 85, 247, 0.1),
            inset 0 0 15px rgba(236, 72, 153, 0.03);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(236, 72, 153, 0.35),
            0 0 40px rgba(168, 85, 247, 0.2),
            inset 0 0 25px rgba(236, 72, 153, 0.08);
    }
}

.fertility-female {
    animation: fertilityPulseFemale 3s ease-in-out infinite !important;
}

/* Male variant - blue/cyan tones */
.fertility-male {
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.12) 0%,
        rgba(6, 182, 212, 0.08) 50%,
        rgba(59, 130, 246, 0.05) 100%) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
}

.fertility-male::before {
    background: radial-gradient(
        ellipse at center,
        rgba(99, 102, 241, 0.1) 0%,
        transparent 70%
    ) !important;
}

@keyframes fertilityPulseMale {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(99, 102, 241, 0.15),
            0 0 20px rgba(6, 182, 212, 0.1),
            inset 0 0 15px rgba(99, 102, 241, 0.03);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(99, 102, 241, 0.35),
            0 0 40px rgba(6, 182, 212, 0.2),
            inset 0 0 25px rgba(99, 102, 241, 0.08);
    }
}

.fertility-male {
    animation: fertilityPulseMale 3s ease-in-out infinite !important;
}

/* Male particles - blue tones */
.fertility-male .fertility-particle:nth-child(1) {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.7), transparent) !important;
}
.fertility-male .fertility-particle:nth-child(2) {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.6), transparent) !important;
}
.fertility-male .fertility-particle:nth-child(3) {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.5), transparent) !important;
}
.fertility-male .fertility-particle:nth-child(4) {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6), transparent) !important;
}
.fertility-male .fertility-particle:nth-child(5) {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.5), transparent) !important;
}
.fertility-male .fertility-particle:nth-child(6) {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.5), transparent) !important;
}

/* Male DNA helix - blue */
.fertility-male .fertility-dna {
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(99, 102, 241, 0.5) 3px,
        rgba(99, 102, 241, 0.5) 5px,
        transparent 5px,
        transparent 8px
    ) !important;
}

/* Male icon glow */
.fertility-male .metric-icon {
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.4)) !important;
    animation: eggGlowMale 4s ease-in-out infinite !important;
}

@keyframes eggGlowMale {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.3)); }
    50% { filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.6)); }
}

/* ===== Hormone Rhythm Card Gender Themes ===== */
/* Female variant - pink/purple tones */
.hormone-female {
    background: linear-gradient(135deg, 
        rgba(236, 72, 153, 0.12) 0%,
        rgba(168, 85, 247, 0.08) 50%,
        rgba(219, 39, 119, 0.05) 100%) !important;
    border-color: rgba(236, 72, 153, 0.25) !important;
}

.hormone-female::before {
    background: radial-gradient(
        ellipse at center,
        rgba(236, 72, 153, 0.08) 0%,
        transparent 70%
    ) !important;
}

.hormone-female .metric-icon {
    text-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

/* Male variant - blue/cyan tones (default styling) */
.hormone-male {
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.12) 0%,
        rgba(6, 182, 212, 0.08) 50%,
        rgba(59, 130, 246, 0.05) 100%) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
}

.hormone-male::before {
    background: radial-gradient(
        ellipse at center,
        rgba(99, 102, 241, 0.08) 0%,
        transparent 70%
    ) !important;
}

.hormone-male .metric-icon {
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}
