:root {
    --ai-blue-bg: #0a1c36;
    --ai-gold: #b4935a;
    --text-white: #ffffff;
    --text-gray: rgba(255, 255, 255, 0.7);
    --card-surface: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
}

.ai-ranking-panel {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%232d4f95' fill-opacity='0.4' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    padding: 50px 80px;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.ai-panel-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 60px 80px;
    background: linear-gradient(145deg, #1a3266 0%, #2d5389 100%);
    border: 1px solid rgba(180, 147, 90, 0.2);
    border-bottom: 2px solid rgba(180, 147, 90, 0.4);
    border-radius: 8px;
    position: relative;
    overflow: hidden;

    /* estado inicial para animación */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.5s ease, box-shadow 0.5s ease;
}


.ai-panel-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.07;
    /* muy discreto — sube a 0.12 si quieres más presencia */
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: luminosity;
    /* se mezcla con el azul oscuro del fondo */
}

/* asegura que todo el contenido quede encima del video */
.ai-panel-header,
.ai-cards-row,
.ai-panel-footer {
    position: relative;
    z-index: 1;
}

.ai-panel-inner.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* línea decorativa superior */
.ai-panel-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(180, 147, 90, 0.6) 30%,
            rgba(180, 147, 90, 0.9) 50%,
            rgba(180, 147, 90, 0.6) 70%,
            transparent);
}

.ai-panel-inner:hover {
    border-color: rgba(180, 147, 90, 0.45);
}

/* ENCABEZADO */
.ai-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 60px;
    gap: 40px;

    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease 0.3s, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.ai-panel-inner.is-visible .ai-panel-header {
    opacity: 1;
    transform: translateY(0);
}

.ai-panel-left {
    flex-grow: 1;
}

.ai-meta-overline {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--ai-gold);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
}

/* línea dorada antes del overline */
.ai-meta-overline::before {
    content: '';
    width: 24px;
    height: 1.5px;
    background: var(--ai-gold);
    flex-shrink: 0;
}

.ai-main-title {
    font-size: 26px;
    font-weight: 300;
    line-height: 1.45;
    color: var(--text-white);
    margin: 0;
    letter-spacing: -0.015em;
}

.ai-doctor-highlight {
    font-weight: 500;
    background: linear-gradient(120deg, var(--ai-gold) 0%, #e5c07b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-panel-right {
    width: 140px;
    flex-shrink: 0;
}

/* Medallón */
.ai-consensus-medallion {
    border: 1px solid rgba(209, 23, 60, 0.6);
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.7) 0%,
            rgba(255, 255, 255, 0.3) 100%);
    border-radius: 50%;
    width: 110px;
    height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-white);
    margin-left: auto;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* anillo pulsante */
.ai-consensus-medallion::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(209, 23, 60, 0.2);
    animation: medalPulse 2.5s ease-in-out infinite;
}

@keyframes medalPulse {

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

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

.ai-panel-inner:hover .ai-consensus-medallion {
    transform: scale(1.05) rotate(5deg);
}

.medallion-num {
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    color: #f7f1e6;
}

.medallion-text {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-top: 4px;
    opacity: 0.9;
}

/* CARDS */
.ai-cards-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 60px;
    perspective: 1000px;
}

.ai-card {
    flex-grow: 1;
    flex-basis: 0;
    background: hsla(39, 52%, 94%, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 2px solid rgba(180, 147, 90, 0.2);
    border-radius: 6px;
    padding: 28px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
    transform-style: preserve-3d;

    /* estado inicial */
    opacity: 0;
    transform: translateY(30px) translateZ(-20px);
    transition:
        opacity 0.5s ease,
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.ai-card.is-visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

/* shimmer al entrar */
.ai-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(105deg,
            transparent 40%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 60%);
    transform: skewX(-15deg);
    pointer-events: none;
}

.ai-card.is-visible::before {
    animation: aiShimmer 0.9s ease forwards;
}

@keyframes aiShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 150%;
    }
}

/* separador dorado top */
.ai-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(180, 147, 90, 0.5),
            transparent);
}

.ai-card:hover {
    background: rgba(255, 255, 255, 0.523);
    border-color: rgba(180, 147, 90, 0.35);
    border-bottom-color: var(--ai-gold);
    transform: translateY(-8px) translateZ(15px) rotateX(4deg);

}

.ai-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transform: translateZ(20px);
}

.ai-card-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.4s ease;
}

.ai-card:hover .ai-card-icon {
    transform: scale(1.1) translateY(-2px);
}

.ai-card-name {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    letter-spacing: 0.02em;
}

.ai-card-rank {
    font-size: 9px;
    font-weight: 800;
    color: #f7f1e6;
    letter-spacing: 2px;
    background: rgba(180, 147, 90, 0.1);
    padding: 3px 10px;
    border-radius: 2px;
    border: 1px solid rgba(180, 147, 90, 0.2);
}

/* FOOTER */
.ai-panel-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 36px;

    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease 0.6s, transform 0.6s ease 0.6s;
}

.ai-panel-inner.is-visible .ai-panel-footer {
    opacity: 1;
    transform: translateY(0);
}

.ai-verification-text {
    font-size: 13px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    text-align: justify;
}

.ai-verification-text strong {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .ai-ranking-panel {
        padding: 40px 24px;
    }

    .ai-panel-inner {
        padding: 40px 28px;
    }

    .ai-panel-header {
        flex-direction: column;
        gap: 30px;
        text-align: center;
        align-items: center;
    }

    .ai-meta-overline {
        justify-content: center;
    }

    .ai-consensus-medallion {
        margin: 0 auto;
    }

    .ai-cards-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .ai-cards-row {
        grid-template-columns: 1fr;
    }

    .ai-main-title {
        font-size: 20px;
    }
}