/* ═══════════════════════════════════════════════════════════
   #simulation — Interactive Crisis Simulation Audit Section
   Command Center aesthetic featuring a vulnerability checklist
   ═══════════════════════════════════════════════════════════ */

#simulation {
    background-color: var(--wp--preset--color--footer-background);
    color: #ffffff;
    position: relative;
    overflow: hidden;

    /* Background glow */
    &::before {
        content: '';
        position: absolute;
        width: 700px;
        height: 700px;
        top: 50%;
        left: 20%;
        transform: translate(-50%, -50%);
        border-radius: 50%;
        background: radial-gradient(circle, color-mix(in srgb, var(--wp--preset--color--primary) 12%, transparent) 0%, transparent 70%);
        z-index: 0;
        pointer-events: none;
    }

    &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image:
            linear-gradient(rgba(30, 144, 255, 0.25) 1px, transparent 1px),
            linear-gradient(90deg, rgba(30, 144, 255, 0.25) 1px, transparent 1px);
        background-size: 100px 100px;
        background-position: center center;
        mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
        z-index: 0;
        opacity: 0.25;
        pointer-events: none;
    }

    & .simulation-bg-decor {
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;

        &::before {
            content: '';
            position: absolute;
            width: 800px;
            height: 800px;
            bottom: -200px;
            right: -100px;
            border-radius: 50%;
            background: radial-gradient(circle,
                    color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent) 0%, transparent 70%);
            z-index: 0;
            pointer-events: none;
        }
    }

    & .content {
        position: relative;
        z-index: 1;
        display: grid;
        gap: 4rem;

        @media (width>=1024px) {
            grid-template-columns: 1.15fr 1fr;
            align-items: center;
        }
    }

    /* Left Side — Info and Call to Action */
    & .simulation-left {
        text-align: center;

        @media (width >=1024px) {
            text-align: left;
        }

        & .pretext {
            background: color-mix(in srgb, #cf2e2e 20%, transparent);
            color: var(--wp--preset--color--base);
            border-color: color-mix(in srgb, #cf2e2e 50%, transparent);
        }

        & h2 {
            font-size: clamp(2rem, 4vw, 2.8rem);
            line-height: 1.15;
            font-weight: 600;
            color: #ffffff;
            margin: 1rem 0;

            & span {
                color: color-mix(in srgb, #ffffff, transparent 20%);
                font-weight: 500;
            }
        }

        & .simulation-intro-desc {
            font-size: 1.05rem;
            line-height: 1.65;
            color: color-mix(in srgb, #ffffff, transparent 35%);
            margin: 0;
            max-width: 580px;
        }

        & .cta-wrapper {
            margin-top: 1rem;

            & .btn-simulator-link {
                background-color: var(--wp--preset--color--focus);
            }
        }
    }

    /* Right Side — Interactive Dashboard Panel */
    & .simulation-right {
        & .vulnerabilities-panel {
            background-color: var(--wp--preset--color--footer-background);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 1.25rem;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
            overflow: hidden;

            & .panel-header {
                display: flex;
                align-items: center;
                gap: 0.5rem;
                padding: 1rem 1.5rem;
                background: rgba(255, 255, 255, 0.02);
                border-bottom: 1px solid rgba(255, 255, 255, 0.06);

                & .panel-dot {
                    width: 10px;
                    height: 10px;
                    border-radius: 50%;

                    &.dot-red {
                        background-color: #ef4444;
                    }

                    &.dot-yellow {
                        background-color: #eab308;
                    }

                    &.dot-green {
                        background-color: #22c55e;
                    }
                }

                & .panel-title {
                    font-family: monospace;
                    font-size: 0.75rem;
                    font-weight: 700;
                    color: rgba(255, 255, 255, 0.35);
                    letter-spacing: 0.08em;
                    margin-left: auto;
                }
            }

            & .vulnerabilities-list {
                display: flex;
                flex-direction: column;
                padding: 1rem;
                gap: 0.75rem;
            }

            & .vuln-card {
                display: flex;
                gap: 1.25rem;
                padding: 1.25rem;
                border-radius: 0.75rem;
                background: transparent;
                border: 1px solid transparent;
                transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
                cursor: default;
                position: relative;

                & .vuln-status {
                    flex-shrink: 0;

                    & .vuln-box {
                        width: 24px;
                        height: 24px;
                        border-radius: 6px;
                        border: 1.5px solid rgba(239, 68, 68, 0.3);
                        background: rgba(239, 68, 68, 0.08);
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        color: #ef4444;
                        transition: all 0.3s ease;

                        & svg {
                            width: 12px;
                            height: 12px;
                            opacity: 0.85;
                            transition: transform 0.3s ease;
                        }
                    }
                }

                & .vuln-text {
                    display: flex;
                    flex-direction: column;
                    gap: 0.25rem;
                    text-align: left;

                    & h4 {
                        margin: 0;
                        font-size: 1.05rem;
                        font-weight: 600;
                        color: #ffffff;
                        line-height: 1.35;
                        transition: color 0.3s ease;
                    }

                    & p {
                        margin: 0;
                        font-size: 0.85rem;
                        line-height: 1.45;
                        color: rgba(255, 255, 255, 0.45);
                        transition: color 0.3s ease;
                    }
                }

                /* Resplandor interno dinámico */
                &::before {
                    content: "";
                    position: absolute;
                    inset: 0;
                    background: radial-gradient(600px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(0, 162, 255, 0.12), transparent 50%);
                    opacity: 0;
                    transition: opacity 0.4s ease;
                    pointer-events: none;
                    z-index: -1;
                    border-radius: inherit;
                    corner-shape: inherit;
                }

                /* Borde dinámico que sigue al ratón */
                &::after {
                    content: "";
                    position: absolute;
                    inset: -1px;
                    background: radial-gradient(350px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(0, 162, 255, 0.8), transparent 50%);
                    opacity: 0;
                    transition: opacity 0.4s ease;
                    pointer-events: none;
                    z-index: 1;
                    border-radius: inherit;
                    corner-shape: inherit;
                    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
                    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
                    -webkit-mask-composite: xor;
                    mask-composite: exclude;
                    padding: 1px;
                }

                &:hover::before,
                &:hover::after {
                    opacity: 1;
                }

                &:hover {
                    & .vuln-box {
                        border-color: var(--wp--preset--color--focus);
                        background: rgba(242, 106, 35, 0.12);
                        color: var(--wp--preset--color--focus);

                        & svg {
                            transform: rotate(90deg);
                        }
                    }

                    & .vuln-text {
                        & h4 {
                            color: var(--wp--preset--color--focus);
                        }

                        & p {
                            color: var(--wp--preset--color--base);
                        }
                    }
                }
            }
        }
    }
}

/* Chromium specific squircles */
.is-chromium {

    & #simulation .vulnerabilities-panel,
    & #simulation .vuln-card {
        border-radius: 1.5rem !important;
        corner-shape: squircle;
    }

    & #simulation .btn-simulator-link,
    & #simulation .vuln-box {
        border-radius: 0.8rem !important;
        corner-shape: squircle;
    }
}