@property --result-color {
    syntax: "<color>";
    inherits: true;
    initial-value: var(--accent-color);
}


/* IP Blacklist hero & results */
.blacklist-hero {
    position: relative;
    overflow: hidden;
    height: 560px;
    /* fixed hero height for all steps */
    padding: 0;
    background-image: url('../assets/images/ip-blacklist.jpg');
    background-color: rgb(0, 3, 35);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    transition: --result-color 2s;
}

.blacklist-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 3, 35, .8);
}

.blacklist-hero .hero-layout {
    position: relative;
    z-index: 2;
    display: block;
    height: 100%;
}

.blacklist-hero .hero-title {
    color: #fff;
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin: 0;
    text-align: center;
}

.blacklist-hero .hero-subtitle {
    color: #fff;
    opacity: .9;
    text-align: center;
    margin: .25rem 0 1rem;
    font-size: 1.5rem;
}

.blacklist-hero .hero-note {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: #fff;
    opacity: .8;
    text-align: center;
    max-width: 840px;
    margin: 2rem auto 2rem;
}

.blacklist-hero .hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.75rem;
    padding-right: 1.25rem;
    min-width: 240px;
    border-radius: 999px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: .2s;
}

.blacklist-hero .hero-btn:hover {
    transform: translateY(-2px);
    background: #b91c1c;
}

.blacklist-hero .hero-btn.outline {
    background: #fff;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.blacklist-hero .hero-initial {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    text-align: center;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .4s ease, opacity .4s ease, filter .4s ease;
}

.blacklist-hero.running .hero-initial {
    transform: translateY(-150px);
}

.blacklist-hero .hero-initial * {
    transition: .4s ease;
}

.blacklist-hero.running .hero-initial *:not(h1) {
    opacity: 0;
    filter: blur(10px);
    visibility: hidden;
    pointer-events: none;
}


.blacklist-hero.running .hero-initial h1 {
    font-size: 2rem;
}

.blacklist-hero .hero-progress {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0;
    opacity: 0;
    transform: scale(0.5);
    transition: .35s ease;
    pointer-events: none;
    visibility: hidden;
    margin-top: 2rem;
    z-index: 3;
}

.blacklist-hero.running .hero-progress {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    visibility: visible;
}

/* progress ring */
.progress-ring {
    position: relative;
    width: 240px;
    height: 240px;
    left: 50%;
    transform: translateX(-50%);
    transition: .35s ease;
}

.ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-track {
    stroke: rgba(255, 255, 255, .15);
}

/* two separate strokes */
.ring-spinner {
    stroke: var(--accent-color);
    opacity: 1;
}

.ring-result {
    stroke: var(--result-color);
    opacity: 0;
    /* hidden during loading */
    transition: opacity .2s ease, stroke-dashoffset .45s ease, stroke .45s ease;
    /* default to 0% (no fill) before any JS runs */
    stroke-dasharray: 653 653;
    stroke-dashoffset: 653;
}

.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    transform: scale(0.8);
    opacity: 0;
    transition: .4s ease;
}

.ring-percent {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
}

.ring-caption {
    opacity: .9;
    margin-top: .25rem;
    font-weight: 600;
}

/* result layout */
.blacklist-hero .hero-result {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    justify-items: flex-start;
    left: 40%;
    gap: 1.25rem;
    color: #fff;
    opacity: 0;
    transform: translateX(50px);
    transition: transform .4s ease, opacity .4s ease;
    visibility: hidden;
    pointer-events: none;
    z-index: 4;
    margin-top: 2rem;
}

.blacklist-hero.show-result .hero-result {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.blacklist-hero.running:not(.loading) .ring-center {
    transform: scale(1);
    opacity: 1;
}


.blacklist-hero.show-result .progress-ring {
    left: 40%;
    transform: translateX(-100%);
}

.blacklist-hero.show-result .hero-progress {
    transform: scale(1.2);
}

.blacklist-hero.running:not(.loading) .ring-center {
    background: radial-gradient(closest-side, color-mix(in srgb, var(--result-color) 60%, transparent), #0000);
}

.blacklist-hero .result-ip {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.blacklist-hero .result-message {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 1.5rem;
    opacity: .9;
}

.blacklist-hero .result-message h2 {
    font-size: 2.75rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    color: inherit;
}

.blacklist-hero .hero-result .hero-btn {
    align-self: flex-start;
}

/* results list */
.blacklist-results .results-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem;
    margin-top: 2rem;
}


.result-group {
    padding: 0 0.5rem;
}

.blacklist-results .group-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #000 !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.blacklist-results .group-title img {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
}

.blacklist-results .group-title span {
    flex-shrink: 0;
}

.blacklist-results .group-title:after {
    content: '';
    position: static;
    width: 100%;
    height: 2px;
    margin-left: 10px;
    background: #0001;
}

.blacklist-results .server-list {
    margin-top: 1rem;
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 0.2rem;
}

.blacklist-results .server-list li {
    font-size: 1.1rem;
    line-height: 1.2;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
    border-radius: .5rem;
}

.blacklist-results .server-list li div {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.blacklist-results .server-list li.listed div {
    color: #f30c0c;
}

.blacklist-results .server-list li.not-listed div {
    color: #039e1f;
}

.blacklist-results .server-list img {
    width: 18px;
    height: 18px;
}

.blacklist-results .results-card {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1.5rem 1rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 2px solid #e5e7eb;
}

.blacklist-results.hidden {
    display: none;
}

/* Spinner animation matching provided SVG */
.blacklist-hero.loading .ring-spinner {
    transform-origin: 50% 50%;
    animation: bl-rotate 1.5s linear infinite both, bl-dasharray 1.5s cubic-bezier(0.42, 0, 0.58, 1) infinite both, bl-dashoffset 1.5s cubic-bezier(0.42, 0, 0.58, 1) infinite both;
}

/* fade spinner when showing result */
.blacklist-hero.show-result .ring-spinner {
    opacity: 0;
}

/* result stroke is visible only when showing value */
.blacklist-hero.loading .ring-result {
    opacity: 0 !important;
}

/* result stroke is visible only when showing value */
.blacklist-hero.running .ring-result {
    opacity: 1;
}


@media (max-width: 768px) {
    .blacklist-hero .hero-title {
        font-size: 2rem;
    }

    .blacklist-hero.show-result .hero-layout {
        grid-template-columns: 1fr;
    }

    .blacklist-hero.show-result .hero-progress {
        justify-content: center;
    }

    .blacklist-hero .hero-result {
        text-align: center;
        justify-items: center;
    }

    .blacklist-hero .hero-result .hero-btn {
        align-self: center;
    }

    .blacklist-hero {
        height: 460px;
    }

    .blacklist-hero {
        height: 650px;
    }

    .blacklist-hero .hero-result {
        left: 0%;
        align-items: center;
        gap: 1.75rem;
        height: fit-content;
        top: 50%;
    }

    .blacklist-hero .result-ip {
        word-wrap: anywhere;
        font-size: 1rem;
    }

    .blacklist-hero .result-message h2 {
        font-size: 2rem;
    }

    .blacklist-hero .result-message {
        font-size: 1.25rem;
        gap: 1rem;
    }

    .blacklist-hero.running .hero-initial {
        transform: translateY(-200px);
    }

    .progress-ring {
        top: 0;
        left: 0% !important;
        transform: none;
    }

    .blacklist-hero .hero-progress {
        justify-content: center;
    }

    .blacklist-hero.show-result .progress-ring {
        top: -140px;
        transform: none;
    }

    .blacklist-hero.show-result .hero-progress {
        transform: scale(0.9);
    }

    .blacklist-hero .hero-result {
        transform: translateY(50px);
    }

    .blacklist-hero.show-result .hero-result {
        transform: translateY(0px);
    }

    .result-group {
        padding: 0;
    }

    .blacklist-results .results-card {
        padding: 1rem;
    }
}


@keyframes bl-rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* values scaled for our circle circumference (~653px) */
@keyframes bl-dasharray {
    0% {
        stroke-dasharray: 0 1000;
    }

    47.5% {
        stroke-dasharray: 459 1000;
    }

    95% {
        stroke-dasharray: 459 1000;
    }

    100% {
        stroke-dasharray: 459 1000;
    }
}

@keyframes bl-dashoffset {
    0% {
        stroke-dashoffset: 0;
    }

    47.5% {
        stroke-dashoffset: -175;
    }

    95% {
        stroke-dashoffset: -646;
    }

    100% {
        stroke-dashoffset: -646;
    }
}

@media (max-width: 768px) {
    .blacklist-results .server-list {
        grid-template-columns: 1fr;
    }
}