/* =============================================
   DIAGNOSTIC WIDGET 3D - ESTILOS
   =============================================
   Single-widget state machine. Same layout for
   all 3 states; only text, values, and colors
   change via JS.
   ============================================= */

/* --------------------------------------------- */
/* CONTENEDOR DEL HERO GRÁFICO */
/* --------------------------------------------- */
.hero-graphic-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent !important;
    overflow: visible !important;
    transform-style: preserve-3d;
}

/* --------------------------------------------- */
/* TARJETA 3D PRINCIPAL */
/* --------------------------------------------- */
.lex-card-3d {
    width: 360px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 24px;
    transform: rotateY(-15deg) rotateX(5deg);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: levitate 6s ease-in-out infinite;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 10;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Reflejo superior */
.lex-card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.05) 30%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
}

@keyframes levitate {

    0%,
    100% {
        transform: rotateY(-15deg) rotateX(5deg) translateY(0);
    }

    50% {
        transform: rotateY(-15deg) rotateX(5deg) translateY(-20px);
    }
}

/* --------------------------------------------- */
/* CABECERA: STATUS */
/* --------------------------------------------- */
.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Blue pulsing indicator (states 1 & 2) */
.widget-indicator-pulse {
    background: #3b82f6;
    box-shadow: 0 0 8px #3b82f6;
    animation: indicatorPulse 1.2s ease-in-out infinite;
}

/* Green static indicator (state 3) */
.widget-indicator-done {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: none;
}

@keyframes indicatorPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

.status-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

/* --------------------------------------------- */
/* RESULT METRICS */
/* --------------------------------------------- */
.result-metric {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 14px;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.result-metric.visible {
    opacity: 1;
}

.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.metric-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2px;
}

.metric-value {
    font-family: 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    transition: opacity 0.3s ease;
}

.metric-muted {
    color: rgba(255, 255, 255, 0.45);
}

.metric-highlight {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.metric-arrow {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    margin-top: 12px;
}

/* Comparison Bar */
.comparison-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 10px;
}

.comparison-bar-current {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    transition: width 0.8s ease-out;
}

.comparison-bar-projected {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #00f0ff);
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
    transition: width 0.8s ease-out;
}

/* Savings */
.metric-savings {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #10b981;
    margin-top: 8px;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
    transition: opacity 0.3s ease;
}

/* Focus */
.result-focus {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 14px;
}

.metric-focus-value {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.result-focus .metric-label {
    text-align: center;
}

/* Disclaimer / Bottom text */
.result-disclaimer {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 2px;
    z-index: 2;
    transition: opacity 0.3s ease;
}

/* --------------------------------------------- */
/* PROGRESS BAR (bottom of widget) */
/* --------------------------------------------- */
.widget-progress-wrapper {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    z-index: 2;
}

.widget-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #00f0ff);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    transition: width 1.5s ease-out;
}

.widget-progress-bar.bar-done {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* --------------------------------------------- */
/* RESPONSIVE */
/* --------------------------------------------- */
@media (max-width: 1024px) {
    .lex-card-3d {
        transform: rotateY(0) rotateX(0);
        width: 320px;
    }
}

@media (max-width: 768px) {
    .hero-graphic-container {
        display: flex !important;
        justify-content: center;
        align-items: center;
        margin-top: 40px;
        margin-bottom: 20px;
        transform: scale(0.9);
        height: auto !important;
        min-height: auto;
    }

    .lex-card-3d {
        width: 300px;
        padding: 20px;
    }

    .metric-value {
        font-size: 1.15rem;
    }
}