/* ── Hero ───────────────────────────────────────────── */
.tools-hero {
    padding: 7rem 0 5rem;
    background: radial-gradient(circle at top center, rgba(0, 255, 163, 0.06), transparent 60%);
    text-align: center;
}
.tools-hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    margin-bottom: 1rem;
}
.tools-hero p {
    color: var(--text-muted);
    max-width: 760px;
    margin: 0 auto 1rem;
}
.hero-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 163, 0.35);
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

/* ── Breadcrumb ─────────────────────────────────────── */
.breadcrumb {
    padding: 5.5rem 0 0;
    font-size: 0.85rem;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--brand-primary);
}
.breadcrumb span {
    color: var(--text-muted);
    margin: 0 0.4rem;
}
.breadcrumb .current {
    color: #fff;
}

/* ── Tools Index Grid ───────────────────────────────── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.4rem;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.tool-card:hover {
    border-color: var(--brand-primary);
}
.tool-card strong {
    font-size: 1rem;
    font-weight: 600;
}
.tool-card .card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Tool Panel ─────────────────────────────────────── */
.tool-panel {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}
.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.tool-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    white-space: nowrap;
}
.tool-desc {
    color: var(--text-muted);
    margin: 0.5rem 0 1.5rem;
    line-height: 1.6;
}
.tool-intro {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 800px;
}

/* ── Form Controls ──────────────────────────────────── */
.tool-form {
    display: grid;
    gap: 0.8rem;
}
.tool-form label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.tool-form input[type="text"],
.tool-form input[type="number"],
.tool-form input[type="password"],
.tool-form select,
.tool-form textarea {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}
.tool-form input:focus,
.tool-form select:focus,
.tool-form textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
}
.tool-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2394a3b8'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.tool-form select option {
    background: var(--bg-dark);
    color: #fff;
}
.tool-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.tool-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.8rem;
}
.tool-form .btn {
    justify-self: start;
}
.tool-form .btn-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ── Range Slider ───────────────────────────────────── */
.range-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.range-wrap input[type="range"] {
    flex: 1;
    appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}
.range-wrap input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary);
    cursor: pointer;
}
.range-wrap input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary);
    cursor: pointer;
    border: none;
}
.range-val {
    min-width: 3ch;
    font-weight: 700;
    color: var(--brand-primary);
    font-size: 1.1rem;
}

/* ── Checkboxes ─────────────────────────────────────── */
.check-group {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.check-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: #fff;
}
.check-group input[type="checkbox"] {
    accent-color: var(--brand-primary);
    width: 16px;
    height: 16px;
}

/* ── Strength Meter ─────────────────────────────────── */
.strength-meter {
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    overflow: hidden;
    margin-top: 0.3rem;
}
.strength-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s, background 0.3s;
}
.strength-label {
    font-size: 0.8rem;
    margin-top: 0.3rem;
    font-weight: 600;
}

/* ── Preset Buttons ─────────────────────────────────── */
.preset-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.preset-btn {
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
    font-family: var(--font-main);
}
.preset-btn:hover,
.preset-btn.active {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* ── Results Area ───────────────────────────────────── */
.tool-results {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}
.result-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
}
.result-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}
.result-card .value {
    font-weight: 600;
    font-size: 1rem;
    word-break: break-word;
}

/* ── Results Table ──────────────────────────────────── */
.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.result-table th,
.result-table td {
    text-align: left;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
    word-break: break-word;
}
.result-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.result-table tr:last-child td {
    border-bottom: none;
}

/* ── Badges ─────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-ok {
    background: rgba(0, 255, 163, 0.12);
    color: var(--brand-primary);
}
.badge-warn {
    background: rgba(255, 170, 0, 0.12);
    color: #ffaa00;
}
.badge-fail {
    background: rgba(255, 0, 85, 0.12);
    color: var(--brand-alert);
}

/* ── Loading & Error ────────────────────────────────── */
.tool-loading {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem 0;
    color: var(--text-muted);
}
.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.tool-error {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 0, 85, 0.08);
    border: 1px solid rgba(255, 0, 85, 0.25);
    color: var(--brand-alert);
    font-weight: 500;
}

/* ── Code Block / Output ────────────────────────────── */
.code-block {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
    position: relative;
    line-height: 1.6;
    color: var(--brand-primary);
}
.code-block .copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* ── Copy Button ────────────────────────────────────── */
.copy-btn {
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    transition: 0.15s;
    font-family: var(--font-main);
}
.copy-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.copy-btn.copied {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* ── Pre Output (ping, whois raw) ───────────────────── */
.raw-output {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.5;
    color: #cbd5e1;
}

/* ── Collapsible / Expandable ───────────────────────── */
.expandable-toggle {
    background: none;
    border: none;
    color: var(--brand-primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem 0;
    font-family: var(--font-main);
    font-weight: 600;
}
.expandable-content {
    display: none;
}
.expandable-content.open {
    display: block;
}

/* ── How It Works ───────────────────────────────────── */
.how-it-works {
    margin: 3rem 0;
}
.how-it-works h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.how-it-works p {
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 800px;
}

/* ── Related Tools ──────────────────────────────────── */
.related-tools {
    margin: 3rem 0;
}
.related-tools h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
}
.related-grid a {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.15s;
}
.related-grid a:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* ── FAQ Accordion ──────────────────────────────────── */
.faq-section {
    margin: 3rem 0;
}
.faq-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.faq-q {
    width: 100%;
    text-align: left;
    background: var(--bg-card);
    border: none;
    padding: 1rem 1.2rem;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-main);
}
.faq-q::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.faq-item.open .faq-q::after {
    content: '-';
}
.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.faq-item.open .faq-a {
    max-height: 500px;
}
.faq-a-inner {
    padding: 0 1.2rem 1.2rem;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.9rem;
}

/* ── Cron preview ───────────────────────────────────── */
.cron-preview {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-primary);
    padding: 1rem 0;
    flex-wrap: wrap;
}
.cron-preview .cron-part {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    min-width: 3ch;
    text-align: center;
}
.cron-human {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* ── Server requirements result ─────────────────────── */
.req-result {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}
.req-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: 8px;
    text-align: center;
}
.req-card .req-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-primary);
}
.req-card .req-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Password display ───────────────────────────────── */
.password-display {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 1.1rem;
    word-break: break-all;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}
.password-display .pw-text {
    flex: 1;
    color: var(--brand-primary);
    font-weight: 600;
}

/* ── Bandwidth result ───────────────────────────────── */
.bw-result {
    text-align: center;
    padding: 1.5rem 0;
}
.bw-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--brand-primary);
}
.bw-unit {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .tool-row, .tool-row-3 {
        grid-template-columns: 1fr;
    }
    .tool-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .tools-grid {
        grid-template-columns: 1fr;
    }
    .result-grid {
        grid-template-columns: 1fr 1fr;
    }
    .tool-panel {
        padding: 1.2rem;
    }
    .cron-preview {
        font-size: 1rem;
    }
}
@media (max-width: 500px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
    .check-group {
        flex-direction: column;
        gap: 0.6rem;
    }
}
