/* ═══════════════════════════════════════
   Hero Showcase — AI Metric Cards
   Glassmorphic cards around DNA helix
   Primary card: larger, brighter glow
   Secondary cards: subtler, smaller
   ═══════════════════════════════════════ */

/* ── Base card — glassmorphism ── */
.hh-card {
    position: absolute;
    background: rgba(15, 18, 36, 0.82);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 16px 20px;
    min-width: 150px;
    z-index: 6;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: hhCardFadeIn 0.8s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1)) backwards;
    /* GPU acceleration */
    will-change: transform, opacity;
    transform: translateZ(0);
    transition:
        transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1),
        border-color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(30px)) {
    .hh-card {
        background: rgba(15, 18, 36, 0.95);
    }
}

@keyframes hhCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) translateZ(0);
    }

    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

/* ── Primary card — larger, brighter glow ── */
.hh-card--primary {
    padding: 20px 24px;
    min-width: 170px;
    border-radius: 18px;
    background: rgba(15, 18, 36, 0.85);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(124, 58, 237, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* ── Secondary card — subtler neon ── */
.hh-card--secondary {
    opacity: 0.88;
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(124, 58, 237, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── Card label ── */
.hh-card-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

/* ── Card value (gradient text) ── */
.hh-card-value {
    font-size: 1.375rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══ Card 1: Stil Uyğunluğu — Primary, Top-Left ═══ */
.hh-card--match {
    top: 5%;
    left: -30px;
    animation-delay: 0.1s;
}

.hh-card--match .hh-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    position: relative;
}

.hh-card--match svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.hh-card--match .hh-circle-bg {
    fill: none;
    stroke: rgba(139, 92, 246, 0.2);
    stroke-width: 6;
}

.hh-card--match .hh-circle-progress {
    fill: none;
    stroke: url(#grad1);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 251;
    stroke-dashoffset: 20;
    animation: hhCircleDraw 2s ease-out 0.5s backwards;
}

@keyframes hhCircleDraw {
    from {
        stroke-dashoffset: 251;
    }

    to {
        stroke-dashoffset: 20;
    }
}

.hh-card--match .hh-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══ Card 2: Trend Analizi — Secondary, Bottom-Left ═══ */
.hh-card--trend {
    bottom: 8%;
    left: -40px;
    animation-delay: 0.2s;
}

.hh-card--trend .hh-wave {
    margin-top: 10px;
    height: 45px;
}

.hh-card--trend svg {
    width: 100%;
    height: 100%;
}

.hh-card--trend path {
    fill: none;
    stroke: url(#grad2);
    stroke-width: 2.5;
    stroke-linecap: round;
}

/* ═══ Card 3: Rəng Paletin — Secondary, Top-Right ═══ */
.hh-card--colors {
    top: 8%;
    right: -30px;
    animation-delay: 0.3s;
}

.hh-card--colors .hh-palette {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.hh-card--colors .hh-color {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: hhColorPop 0.5s ease-out backwards;
}

@keyframes hhColorPop {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hh-card--colors .hh-color:nth-child(1) {
    animation-delay: 0.5s;
}

.hh-card--colors .hh-color:nth-child(2) {
    animation-delay: 0.6s;
}

.hh-card--colors .hh-color:nth-child(3) {
    animation-delay: 0.7s;
}

.hh-card--colors .hh-color:nth-child(4) {
    animation-delay: 0.8s;
}

.hh-card--colors .hh-color:nth-child(5) {
    animation-delay: 0.9s;
}

/* ═══ Card 4: Stil Skoru — Secondary, Bottom-Right ═══ */
.hh-card--score {
    bottom: 12%;
    right: -20px;
    animation-delay: 0.4s;
}

.hh-score-value {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 8px;
}

.hh-score-bar {
    width: 100%;
    height: 4px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 6px;
}

.hh-score-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #7c3aed, #ec4899);
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══ SVG Connector Lines overlay ═══ */
.hh-connectors {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    overflow: visible;
}

@media (max-width: 767px) {
    .hh-connectors {
        display: none;
    }
}

/* ═══ Hover states ═══ */
.hh-card:hover {
    transform: scale(1.05) translateZ(0);
    border-color: rgba(139, 92, 246, 0.6);
}

.hh-card--primary:hover {
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(124, 58, 237, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hh-card--secondary:hover {
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 35px rgba(236, 72, 153, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ═══ Responsive ═══ */
@media (max-width: 1200px) {
    .hh-card {
        padding: 14px 18px;
        min-width: 130px;
    }

    .hh-card--primary {
        padding: 18px 22px;
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .hh-card {
        padding: 12px 15px;
        min-width: 110px;
    }

    .hh-card--primary {
        padding: 14px 18px;
        min-width: 130px;
    }

    .hh-card-label {
        font-size: 0.5rem;
    }

    .hh-card-value {
        font-size: 0.9375rem;
    }

    .hh-card--match {
        top: 5%;
        left: -10px;
    }

    .hh-card--match .hh-circle {
        width: 65px;
        height: 65px;
    }

    .hh-card--match .hh-percent {
        font-size: 1.25rem;
    }

    .hh-card--trend {
        bottom: 8%;
        left: -10px;
    }

    .hh-card--colors {
        top: 8%;
        right: -5px;
    }

    .hh-card--colors .hh-color {
        width: 22px;
        height: 22px;
    }

    .hh-card--score {
        bottom: 12%;
        right: 0;
    }

    .hh-score-value {
        font-size: 1.375rem;
    }
}

/* ═══════════════════════════════════════
   Float Animation System
   Cards float vertically -10px to +10px
   Staggered delays prevent synchronized movement
   ═══════════════════════════════════════ */

@keyframes hhCardFloat {

    0%,
    100% {
        transform: translateY(0) translateZ(0);
    }

    50% {
        transform: translateY(-10px) translateZ(0);
    }
}

/* Apply float after entrance animation completes (~1.5s) */
.hh-card--match {
    animation: hhCardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards,
        hhCardFloat 4s ease-in-out 1.8s infinite;
}

.hh-card--trend {
    animation: hhCardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s backwards,
        hhCardFloat 5s ease-in-out 2.0s infinite;
}

.hh-card--colors {
    animation: hhCardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s backwards,
        hhCardFloat 4.5s ease-in-out 2.2s infinite;
}

.hh-card--score {
    animation: hhCardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s backwards,
        hhCardFloat 5.5s ease-in-out 2.4s infinite;
}

/* ═══ Reduced Motion ═══ */
@media (prefers-reduced-motion: reduce) {

    .hh-card,
    .hh-card--match,
    .hh-card--trend,
    .hh-card--colors,
    .hh-card--score {
        animation: none !important;
        opacity: 1;
        transform: none;
    }

    .hh-card--match .hh-circle-progress {
        animation: none;
        stroke-dashoffset: 20;
    }

    .hh-card--colors .hh-color {
        animation: none;
        opacity: 1;
        transform: scale(1);
    }

    .hh-connectors {
        display: none;
    }
}

/* ═══ Card hover → connector line highlight ═══ */
.hh-conn-line {
    transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══════════════════════════════════════
   Loading Skeleton
   Shows while Three.js / scene initializes
   ═══════════════════════════════════════ */

.hh-skeleton {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.6s ease-out;
}

.hh-skeleton.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.hh-skeleton-pulse {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg,
            rgba(124, 58, 237, 0.15) 0%,
            rgba(236, 72, 153, 0.10) 50%,
            rgba(124, 58, 237, 0.15) 100%);
    background-size: 200% 200%;
    animation: hhSkeletonPulse 2s ease-in-out infinite;
}

@keyframes hhSkeletonPulse {

    0%,
    100% {
        background-position: 0% 50%;
        opacity: 0.6;
    }

    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
}

/* Skeleton cards (placeholder shapes) */
.hh-skeleton-card {
    position: absolute;
    width: 120px;
    height: 60px;
    border-radius: 14px;
    background: rgba(124, 58, 237, 0.08);
    animation: hhSkeletonPulse 2s ease-in-out infinite;
}

.hh-skeleton-card:nth-child(2) {
    top: 15%;
    left: 5%;
    animation-delay: 0.2s;
}

.hh-skeleton-card:nth-child(3) {
    bottom: 20%;
    left: 8%;
    animation-delay: 0.4s;
}

.hh-skeleton-card:nth-child(4) {
    top: 18%;
    right: 5%;
    animation-delay: 0.6s;
}

.hh-skeleton-card:nth-child(5) {
    bottom: 25%;
    right: 8%;
    animation-delay: 0.8s;
}

@media (prefers-reduced-motion: reduce) {

    .hh-skeleton-pulse,
    .hh-skeleton-card {
        animation: none;
    }
}