/**
 * IPje.nl Domain Health Checker
 * Version: 1.0.1
 * Developed by Team XITENS
 */

.ipje-container {
    --dh-accent: #FF7F00;
    --dh-accent-hover: #E36B00;
    --dh-text: #333333;
    --dh-muted: #555555;
    --dh-surface: #FFFFFF;
    --dh-subtle: #F5F5F5;
    --dh-border: #E2E2E2;
    --dh-pass: #166534;
    --dh-pass-bg: #DCFCE7;
    --dh-warning: #92400E;
    --dh-warning-bg: #FEF3C7;
    --dh-fail: #991B1B;
    --dh-fail-bg: #FEE2E2;
    --dh-unknown: #4B5563;
    --dh-unknown-bg: #F3F4F6;
    --dh-info: #1E40AF;
    --dh-info-bg: #DBEAFE;
}

html[data-theme="dark"] .ipje-container {
    --dh-text: #F5F5F5;
    --dh-muted: #D1D5DB;
    --dh-surface: #1E1E1E;
    --dh-subtle: #292929;
    --dh-border: #383838;
    --dh-pass: #86EFAC;
    --dh-pass-bg: #163822;
    --dh-warning: #FCD34D;
    --dh-warning-bg: #422D12;
    --dh-fail: #FCA5A5;
    --dh-fail-bg: #451F24;
    --dh-unknown: #D1D5DB;
    --dh-unknown-bg: #303030;
    --dh-info: #93C5FD;
    --dh-info-bg: #172D48;
}

.dh-heading {
    margin: 0 0 24px;
}

.dh-heading h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px;
    color: var(--dh-text);
    font-size: clamp(24px, 4vw, 32px);
    line-height: 1.3;
}

.dh-heading h1 svg {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    color: var(--dh-accent);
}

.dh-heading p {
    color: var(--dh-muted);
    margin: 0;
    line-height: 1.65;
}

.dh-search label {
    display: block;
    font-weight: 600;
    color: var(--dh-text);
    margin-bottom: 8px;
}

.dh-input-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.dh-search input[type="text"] {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--dh-border);
    border-radius: 8px;
    background: var(--dh-surface);
    color: var(--dh-text);
    font: inherit;
}

.dh-search input:focus {
    outline: 2px solid var(--dh-accent);
    outline-offset: 2px;
}

#dh-submit {
    border: 0;
    border-radius: 8px;
    padding: 13px 24px;
    background: var(--dh-accent);
    color: #202020;
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

#dh-submit:hover:not(:disabled) {
    background: var(--dh-accent-hover);
}

#dh-submit:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.dh-options {
    margin-top: 18px;
}

.dh-options summary {
    color: var(--dh-muted);
    cursor: pointer;
    font-size: 14px;
}

.dh-options[open] summary {
    margin-bottom: 16px;
}

.dh-options input {
    max-width: 320px;
}

.dh-options p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--dh-muted);
}

#dh-turnstile:not(:empty) {
    margin-top: 16px;
}

#dh-security-status {
    font-size: 13px;
    color: var(--dh-muted);
}

#dh-loading[hidden],
#dh-results[hidden],
#dh-error[hidden],
#dh-security-status[hidden] {
    display: none !important;
}

.dh-overview {
    margin-top: 24px;
}

.dh-score-layout {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 8px 0 24px;
}

.dh-score-ring {
    position: relative;
    width: 160px;
    height: 160px;
    flex: 0 0 160px;
}

.dh-score-ring svg {
    display: block;
    width: 100%;
    height: 100%;
}

.dh-ring-track,
.dh-ring-value {
    fill: none;
    stroke-width: 10;
}

.dh-ring-track {
    stroke: var(--dh-border);
}

.dh-ring-value {
    stroke: var(--dh-accent);
    stroke-linecap: round;
    transition: stroke-dasharray .7s ease;
}

.dh-score-number {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dh-score-number strong {
    color: var(--dh-text);
    font-size: 44px;
    font-weight: 750;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.dh-score-number span {
    color: var(--dh-muted);
    font-size: 14px;
}

.dh-score-info {
    min-width: 0;
}

.dh-score-info h2 {
    color: var(--dh-text);
    font-size: 24px;
    overflow-wrap: anywhere;
    margin: 0 0 8px;
}

.dh-score-info h3 {
    font-size: 16px;
    margin: 0 0 12px;
    color: var(--dh-text);
}

.dh-score-info p {
    margin: 5px 0;
    color: var(--dh-muted);
    font-size: 14px;
}

#dh-rating {
    font-weight: 700;
}

.dh-statistics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    border-top: 1px solid var(--dh-border);
    padding-top: 24px;
}

.dh-stat {
    border-radius: 9px;
    padding: 16px 8px;
    text-align: center;
}

.dh-stat strong {
    display: block;
    font-size: 28px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.dh-stat span {
    display: block;
    font-size: 12px;
    margin-top: 6px;
    overflow-wrap: anywhere;
}

.dh-pass {
    color: var(--dh-pass);
    background: var(--dh-pass-bg);
}

.dh-warning {
    color: var(--dh-warning);
    background: var(--dh-warning-bg);
}

.dh-fail {
    color: var(--dh-fail);
    background: var(--dh-fail-bg);
}

.dh-unknown {
    color: var(--dh-unknown);
    background: var(--dh-unknown-bg);
}

.dh-info {
    color: var(--dh-info);
    background: var(--dh-info-bg);
}

#dh-modules {
    display: grid;
    gap: 14px;
    margin: 24px 0;
}

.dh-module {
    background: var(--dh-surface);
    border: 1px solid var(--dh-border);
    border-radius: 10px;
    overflow: hidden;
}

.dh-module > summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    cursor: pointer;
    list-style: none;
    color: var(--dh-text);
}

.dh-module > summary::-webkit-details-marker {
    display: none;
}

.dh-module > summary:hover {
    background: var(--dh-subtle);
}

.dh-module > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-right: 2px solid var(--dh-muted);
    border-bottom: 2px solid var(--dh-muted);
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.dh-module[open] > summary::after {
    transform: rotate(225deg);
}

.dh-module-title {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 650;
}

.dh-module-icon {
    width: 23px;
    height: 23px;
    flex-shrink: 0;
    color: var(--dh-accent);
}

.dh-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.dh-module-body {
    border-top: 1px solid var(--dh-border);
    padding: 0 20px;
}

.dh-check {
    padding: 16px 0;
    border-bottom: 1px solid var(--dh-border);
}

.dh-check:last-child {
    border-bottom: 0;
}

.dh-check-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dh-check-title {
    font-weight: 600;
    color: var(--dh-text);
    overflow-wrap: anywhere;
}

.dh-check-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--dh-muted);
    margin: 8px 0 0;
}

.dh-check-data {
    margin-top: 10px;
    padding: 12px;
    border-radius: 7px;
    background: var(--dh-subtle);
    color: var(--dh-text);
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.dh-error {
    margin: 20px 0;
    padding: 16px;
    border-radius: 8px;
    background: var(--dh-fail-bg);
    color: var(--dh-fail);
    line-height: 1.6;
}

.dh-explanation {
    margin-top: 24px;
}

.dh-explanation h2 {
    font-size: 20px;
    color: var(--dh-text);
}

.dh-explanation p {
    color: var(--dh-muted);
    line-height: 1.75;
}

.dh-loading {
    text-align: center;
    padding: 32px 20px;
    margin-top: 24px;
}

.dh-loading h2 {
    font-size: 20px;
    color: var(--dh-text);
}

.dh-loading p {
    color: var(--dh-muted);
    line-height: 1.6;
}

.dh-spinner {
    width: 38px;
    height: 38px;
    margin: 0 auto 20px;
    border: 4px solid var(--dh-border);
    border-top-color: var(--dh-accent);
    border-radius: 50%;
    animation: dh-spin .85s linear infinite;
}

.dh-progress {
    max-width: 420px;
    height: 6px;
    margin: 24px auto 0;
    border-radius: 6px;
    background: var(--dh-subtle);
    overflow: hidden;
}

.dh-progress span {
    display: block;
    width: 35%;
    height: 100%;
    border-radius: 6px;
    background: var(--dh-accent);
    animation: dh-progress 1.8s ease-in-out infinite;
}

@keyframes dh-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes dh-progress {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(300%);
    }
}

@media (max-width: 640px) {
    .dh-input-row {
        flex-direction: column;
    }

    #dh-submit {
        width: 100%;
    }

    .dh-score-layout {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .dh-statistics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .dh-stat:last-child {
        grid-column: 1 / -1;
    }

    .dh-module > summary {
        padding: 16px 12px;
        gap: 9px;
        flex-wrap: wrap;
    }

    .dh-module-title {
        font-size: 14px;
    }

    .dh-module-body {
        padding: 0 12px;
    }

    .dh-check-heading {
        flex-wrap: wrap;
    }

    .dh-badge {
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dh-spinner,
    .dh-progress span {
        animation: none;
    }

    .dh-ring-value,
    .dh-module > summary::after {
        transition: none;
    }
}

/* Structured technical report */

.dh-check-data {
    white-space: normal;
    min-width: 0;
}

.dh-data-table {
    margin: 0;
    min-width: 0;
}

.dh-data-row {
    display: grid;
    grid-template-columns: minmax(110px, 30%) minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--dh-border);
}

.dh-data-row:last-child {
    border-bottom: 0;
}

.dh-data-row dt {
    color: var(--dh-muted);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.dh-data-row dd {
    margin: 0;
    min-width: 0;
    color: var(--dh-text);
    overflow-wrap: anywhere;
}

.dh-data-value {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.dh-data-list {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.dh-data-item {
    min-width: 0;
    padding: 8px 10px;
    background: var(--dh-surface);
    border-radius: 6px;
}

.dh-recommendation {
    margin-top: 12px;
    padding: 12px 15px;
    background: var(--dh-subtle);
    border-left: 3px solid var(--dh-accent);
    border-radius: 0 7px 7px 0;
    color: var(--dh-text);
    font-size: 13px;
    line-height: 1.65;
}

.dh-recommendation strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 650;
}

.dh-recommendation p {
    margin: 0;
}

@media (max-width: 640px) {
    .dh-data-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .dh-data-item {
        padding: 6px 8px;
    }
}
