/* =========================================================
   DNS Name Resolution Visualiser
   ========================================================= */

.dns-widget {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.dns-domain-breakdown {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.dns-domain-part {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 0.75rem 0.9rem;
    border-radius: 18px;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid #e2e8f0;
}

.dns-domain-part small {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.8;
}

.subdomain-part {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.domain-part {
    background: #faf5ff;
    border-color: #e9d5ff;
    color: #7e22ce;
}

.tld-part {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.dns-dot {
    margin-top: 0.8rem;
    color: #64748b;
    font-size: 1.4rem;
    font-weight: 800;
}

.dns-control-group {
    margin: 1.1rem 0;
}

.dns-control-group .control-label {
    display: block;
    margin-bottom: 0.65rem;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 700;
}

.dns-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.dns-scenario-btn {
    appearance: none;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    padding: 0.58rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dns-scenario-btn:hover {
    border-color: #0f172a;
    color: #0f172a;
}

.dns-scenario-btn.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.dns-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem 0 1.2rem;
}

.dns-secondary-btn {
    background: transparent;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.dns-secondary-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

.dns-visual-card {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    overflow: hidden;
}

.dns-svg {
    display: block;
    width: 100%;
    height: auto;
}

.dns-link {
    stroke: #cbd5e1;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke 0.25s ease, opacity 0.25s ease;
}

.dns-link.active {
    stroke: #2563eb;
}

.dns-node circle {
    fill: #ffffff;
    stroke: #94a3b8;
    stroke-width: 3;
    transition: fill 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
}

.dns-node text {
    fill: #0f172a;
    font-size: 17px;
    font-weight: 750;
    text-anchor: middle;
}

.dns-node .dns-small-label {
    fill: #475569;
    font-size: 12px;
    font-weight: 650;
}

.dns-node.active circle {
    fill: #eff6ff;
    stroke: #2563eb;
    filter: drop-shadow(0 8px 14px rgba(37, 99, 235, 0.18));
}

.dns-node.cache-hit circle {
    fill: #fff7ed;
    stroke: #f97316;
}

.dns-node.success circle {
    fill: #f0fdf4;
    stroke: #16a34a;
}

.dns-packet {
    fill: #0f172a;
    opacity: 0;
    transition: cx 0.7s ease, cy 0.7s ease, opacity 0.2s ease, fill 0.2s ease;
}

.dns-packet.visible {
    opacity: 1;
}

.dns-explanation-panel {
    margin-top: 1.15rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dns-explanation-panel h3 {
    margin-top: 0;
    margin-bottom: 0.45rem;
}

.dns-step-list {
    margin: 0.8rem 0 0;
    padding-left: 1.3rem;
}

.dns-step-list li {
    margin-bottom: 0.45rem;
    color: #334155;
}

.dns-step-list li.current-step {
    color: #1d4ed8;
    font-weight: 700;
}

.dns-step-list li.completed-step {
    color: #166534;
}

.dns-status {
    margin-top: 0.8rem;
    margin-bottom: 0;
    color: #334155;
    font-weight: 650;
}

@media (max-width: 720px) {
    .dns-widget {
        padding: 1rem;
    }

    .dns-domain-part {
        min-width: 92px;
        padding: 0.65rem 0.75rem;
    }

    .dns-node text {
        font-size: 14px;
    }

    .dns-node .dns-small-label {
        font-size: 10px;
    }
}
