/* Subnet Calculator Page Styles */

.header {
    background-color: white !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */

.subnet-hero-section {
    background: linear-gradient(135deg, var(--primary-50) 0%, #ffffff 100%);
    padding: 80px 0 72px;
    min-height: 560px;
}

.subnet-hero-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.subnet-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.subnet-hero-content {
    padding-right: 16px;
}

.subnet-hero-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 16px;
    color: var(--text-color);
}

.subnet-hero-subtitle {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 20px;
    color: var(--text-color);
}

.subnet-hero-highlight {
    color: var(--primary-500);
    position: relative;
}

.subnet-hero-highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(55, 125, 255, 0.15);
    z-index: -1;
    border-radius: 2px;
}

.subnet-hero-description {
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0 0 28px;
}

.subnet-hero-trust {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subnet-hero-trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.subnet-hero-trust-item svg {
    color: #22c55e;
    flex-shrink: 0;
}

/* Form card */

.subnet-hero-form-wrapper {
    position: relative;
}

.subnet-hero-form-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light, #e5e7eb);
}

.subnet-hero-form-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-color);
}

.subnet-hero-form-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 20px;
}

.subnet-lookup-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subnet-form-row {
    display: flex;
    gap: 8px;
}

.subnet-form-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Roboto Mono', monospace, monospace;
    color: var(--text-color);
    transition: border-color 0.15s;
    min-width: 0;
    background: white;
}

.subnet-form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(55, 125, 255, 0.12);
}

.subnet-form-input::placeholder {
    color: #9ca3af;
}

.subnet-form-submit {
    padding: 12px 20px;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
}

.subnet-form-submit:hover {
    background: var(--primary-600, #2563eb);
}

.subnet-form-submit:active {
    transform: scale(0.98);
}

.subnet-form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 6px 0 0;
}

.subnet-example-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--primary-500);
    cursor: pointer;
    font-family: 'Roboto Mono', monospace, monospace;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.subnet-example-link:hover {
    color: var(--primary-700, #1d4ed8);
}

/* Alerts */

.subnet-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Results */

.subnet-results {
    margin-top: 20px;
}

.subnet-result-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.subnet-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.subnet-result-cidr {
    font-family: 'Roboto Mono', monospace, monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.subnet-result-chip {
    font-size: 12px;
    font-weight: 600;
    color: #15803d;
    background: #dcfce7;
    padding: 2px 10px;
    border-radius: 99px;
}

/* Visual subnet bar */

.subnet-range-bar {
    display: flex;
    height: 36px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
}

.subnet-bar-reserved {
    background: #6b7280;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.subnet-bar-left {
    border-right: 1px solid rgba(255,255,255,0.3);
}

.subnet-bar-right {
    border-left: 1px solid rgba(255,255,255,0.3);
}

.subnet-bar-hosts {
    flex: 1;
    background: #22c55e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
}

.subnet-bar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
}

/* Field grid */

.subnet-field-grid {
    padding: 12px 16px;
}

.subnet-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}

.subnet-field-row:last-child {
    border-bottom: none;
}

.subnet-field-label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.subnet-field-value {
    font-family: 'Roboto Mono', monospace, monospace;
    font-size: 13px;
    color: var(--text-color);
    background: none;
    text-align: right;
    word-break: break-all;
}


/* ─── Cheat Sheet ───────────────────────────────────────────────────────── */

.subnet-cheat-section {
    background: white;
    padding: 80px 0;
    border-top: 1px solid #f3f4f6;
}

.subnet-cheat-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.subnet-cheat-header {
    text-align: center;
    margin-bottom: 40px;
}

.subnet-cheat-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-color);
}

.subnet-cheat-highlight {
    color: var(--primary-500);
}

.subnet-cheat-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

.subnet-cheat-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.subnet-cheat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 700px;
}

.subnet-cheat-table thead {
    background: #f9fafb;
}

.subnet-cheat-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.subnet-cheat-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-color);
    vertical-align: middle;
}

.subnet-cheat-table td:nth-child(1) {
    font-family: 'Roboto Mono', monospace, monospace;
    font-size: 13px;
}

.subnet-cheat-table td:nth-child(2),
.subnet-cheat-table td:nth-child(3) {
    font-family: 'Roboto Mono', monospace, monospace;
    font-size: 13px;
}

.subnet-cheat-table td:nth-child(4),
.subnet-cheat-table td:nth-child(5) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.subnet-cheat-table td:last-child {
    color: var(--text-muted);
    font-size: 13px;
}

.subnet-cheat-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.subnet-cheat-table tbody tr:hover {
    background: #eff6ff;
}

.subnet-cheat-table tbody tr:last-child td {
    border-bottom: none;
}

.subnet-cheat-note {
    margin: 20px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.subnet-cheat-note a {
    color: var(--primary-500);
    text-decoration: none;
}

.subnet-cheat-note a:hover {
    text-decoration: underline;
}

/* ─── How It Works ──────────────────────────────────────────────────────── */

.subnet-how-section {
    background: var(--primary-50, #eff6ff);
    padding: 80px 0;
    border-top: 1px solid #e5e7eb;
}

.subnet-how-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.subnet-how-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.subnet-how-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 36px;
    color: var(--text-color);
}

.subnet-how-block {
    margin-bottom: 28px;
}

.subnet-how-h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 8px;
}

.subnet-how-block p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0;
}

.subnet-how-block p code {
    font-family: 'Roboto Mono', monospace, monospace;
    font-size: 13px;
    background: rgba(55, 125, 255, 0.08);
    color: var(--primary-700, #1d4ed8);
    padding: 1px 5px;
    border-radius: 4px;
}

/* Example card */

.subnet-how-card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 80px;
}

.subnet-how-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-500);
    margin-bottom: 20px;
    font-family: 'Roboto Mono', monospace, monospace;
}

.subnet-how-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}

.subnet-how-card-row:last-of-type {
    border-bottom: none;
}

.subnet-how-card-label {
    font-size: 13px;
    color: var(--text-muted);
}

.subnet-how-card-value {
    font-family: 'Roboto Mono', monospace, monospace;
    font-size: 13px;
    color: var(--text-color);
    background: none;
}

.subnet-how-card-highlight {
    color: #15803d;
    font-weight: 700;
}

.subnet-how-card-binary {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.subnet-how-card-binary-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.subnet-how-card-binary-value {
    font-family: 'Roboto Mono', monospace, monospace;
    font-size: 12px;
    color: var(--text-color);
    background: none;
    word-break: break-all;
}

.subnet-how-bar {
    display: flex;
    height: 30px;
    margin-top: 16px;
    border-radius: 6px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 700;
}

.subnet-how-bar-reserved {
    width: 28px;
    background: #6b7280;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subnet-how-bar-left { border-radius: 6px 0 0 6px; }
.subnet-how-bar-right { border-radius: 0 6px 6px 0; }

.subnet-how-bar-hosts {
    flex: 1;
    background: #22c55e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}


/* ─── FAQ ───────────────────────────────────────────────────────────────── */

.subnet-faq-section {
    background: #f9fafb;
    padding: 80px 0;
    border-top: 1px solid #f3f4f6;
}

.subnet-faq-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
}

.subnet-faq-header {
    text-align: center;
    margin-bottom: 48px;
}

.subnet-faq-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-color);
}

.subnet-faq-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
}

.subnet-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subnet-faq-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.subnet-faq-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.subnet-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    gap: 16px;
    line-height: 1.4;
}

.subnet-faq-question:hover {
    color: var(--primary-500);
}

.subnet-faq-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.subnet-faq-item.open .subnet-faq-icon {
    transform: rotate(180deg);
}

.subnet-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.subnet-faq-item.open .subnet-faq-answer {
    max-height: 600px;
    padding: 0 20px 18px;
}

.subnet-faq-answer p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0;
}

.subnet-faq-answer code {
    font-family: 'Roboto Mono', monospace, monospace;
    font-size: 13px;
    background: rgba(55,125,255,0.08);
    color: var(--primary-700, #1d4ed8);
    padding: 1px 5px;
    border-radius: 4px;
}

.subnet-faq-answer a {
    color: var(--primary-500);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .subnet-hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .subnet-hero-title {
        font-size: 32px;
    }

    .subnet-how-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .subnet-how-card {
        position: static;
    }
}

@media (max-width: 600px) {
    .subnet-hero-section,
    .subnet-cheat-section,
    .subnet-how-section,
    .subnet-api-section,
    .subnet-faq-section {
        padding: 48px 0;
    }

    .subnet-hero-title {
        font-size: 28px;
    }

    .subnet-hero-subtitle {
        font-size: 18px;
    }

    .subnet-form-row {
        flex-direction: column;
    }

    .subnet-form-submit {
        width: 100%;
    }

    .subnet-cheat-title,
    .subnet-how-title,
    .subnet-api-title,
    .subnet-faq-title {
        font-size: 26px;
    }

    .subnet-api-field {
        flex-direction: column;
        gap: 4px;
    }

    .subnet-api-field code {
        min-width: unset;
    }
}
