/* ==========================================================
   NexusDrop Subnet Calculator — style.css
   Matches the design language of nexusdrop-password-generator
   ========================================================== */

/* Container */
.nsc-container {
    max-width: 100%;
    margin: 40px 0;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.07);
    font-family: "Segoe UI", sans-serif;
    color: #333;
}

/* Header */
.nsc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 700;
    color: #0e4c85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nsc-header-icon {
    background: #f0f5ff;
    border-radius: 8px;
    padding: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0e4c85;
}

/* ─── Input Section ─────────────────────────────────────── */
.nsc-input-section {
    margin-bottom: 28px;
}
.nsc-input-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.nsc-field-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px;
    min-width: 0;
}
.nsc-cidr-group {
    flex: 0 1 130px;
}
.nsc-label {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.nsc-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 18px;
    font-family: "Courier New", Courier, monospace;
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fdfdfd;
    color: #222;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.nsc-input:focus {
    border-color: #0e4c85;
    box-shadow: 0 0 0 3px rgba(14, 76, 133, 0.08);
}
.nsc-input.nsc-invalid {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.08);
}
.nsc-cidr-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fdfdfd;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nsc-cidr-wrap:focus-within {
    border-color: #0e4c85;
    box-shadow: 0 0 0 3px rgba(14, 76, 133, 0.08);
}
.nsc-slash {
    font-size: 22px;
    font-weight: 700;
    color: #f16123;
    padding: 0 8px 0 14px;
    user-select: none;
}
.nsc-cidr-input {
    border: none !important;
    box-shadow: none !important;
    padding: 12px 10px 12px 4px;
    font-size: 18px;
    width: 100%;
    background: transparent;
}
.nsc-cidr-input::-webkit-inner-spin-button,
.nsc-cidr-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ─── Quick Select Pills ────────────────────────────────── */
.nsc-pills-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.nsc-pills-label {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.nsc-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.nsc-pill {
    background: #f0f4f8;
    border: 1.5px solid #dce3ee;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #0e4c85;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: "Segoe UI", sans-serif;
}
.nsc-pill em {
    font-style: normal;
    color: #888;
    font-weight: 400;
    font-size: 11px;
    margin-left: 3px;
}
.nsc-pill:hover {
    background: #dce8f7;
    border-color: #0e4c85;
}
.nsc-pill.active {
    background: #0e4c85;
    border-color: #0e4c85;
    color: #fff;
}
.nsc-pill.active em {
    color: rgba(255,255,255,0.7);
}

/* ─── Validation Error ──────────────────────────────────── */
.nsc-error {
    margin-top: 10px;
    color: #d32f2f;
    font-size: 13px;
    font-weight: 600;
    background: #fff5f5;
    border: 1px solid #fcd0d0;
    border-radius: 6px;
    padding: 8px 14px;
}

/* ─── Results Grid ──────────────────────────────────────── */
.nsc-results {
    border-top: 1px solid #eef0f3;
    padding-top: 24px;
}
.nsc-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.nsc-span2 {
    grid-column: span 2;
}
.nsc-result-item {
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nsc-result-item.nsc-highlight {
    background: #f0f5ff;
    border-color: #d0dff5;
}
.nsc-result-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #888;
}
.nsc-result-item.nsc-highlight .nsc-result-label {
    color: #0e4c85;
}
.nsc-result-value-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.nsc-result-value {
    font-family: "Courier New", Courier, monospace;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    word-break: break-all;
}
.nsc-orange {
    color: #f16123;
}

/* Copy Button (small, inline) */
.nsc-copy-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid #dce3ee;
    border-radius: 5px;
    color: #0e4c85;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    white-space: nowrap;
    transition: all 0.15s ease;
    font-family: "Segoe UI", sans-serif;
    flex-shrink: 0;
}
.nsc-copy-btn:hover {
    background: #dce8f7;
    border-color: #0e4c85;
}
.nsc-copy-btn.copied {
    color: #2e7d32;
    border-color: #a5d6a7;
    background: #f1f8e9;
}

/* ─── Binary Breakdown ──────────────────────────────────── */
.nsc-binary-section {
    background: #1a1a2e;
    border-radius: 10px;
    padding: 20px 22px;
    color: #e0e0e0;
}
.nsc-binary-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    color: #888;
    margin-bottom: 14px;
}
.nsc-binary-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nsc-binary-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
}
.nsc-binary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #888;
    width: 100px;
    flex-shrink: 0;
}
.nsc-binary-value {
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    letter-spacing: 1px;
    line-height: 1.6;
    word-break: break-all;
}
/* Network bits = blue, host bits = orange */
.nsc-bit-net  { color: #64b5f6; }
.nsc-bit-host { color: #f16123; }
.nsc-bit-sep  { color: #555; margin: 0 3px; }

.nsc-binary-legend {
    margin-top: 14px;
    display: flex;
    gap: 18px;
    font-size: 11px;
}
.nsc-legend-net {
    color: #64b5f6;
    font-weight: 600;
}
.nsc-legend-host {
    color: #f16123;
    font-weight: 600;
}

/* ─── Download Button ───────────────────────────────────── */
.nsc-download-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.nsc-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f16123;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    font-family: "Segoe UI", sans-serif;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.1s ease;
    white-space: nowrap;
}
.nsc-download-btn:hover {
    background: #d6501b;
    transform: translateY(-1px);
}
.nsc-download-btn:active {
    transform: translateY(0);
}
.nsc-download-btn.done {
    background: #2e7d32;
}
.nsc-download-note {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 540px) {
    .nsc-container {
        padding: 20px 16px;
    }
    .nsc-results-grid {
        grid-template-columns: 1fr;
    }
    .nsc-span2 {
        grid-column: span 1;
    }
    .nsc-binary-value {
        font-size: 11px;
        letter-spacing: 0.5px;
    }
    .nsc-binary-label {
        width: 80px;
    }
}
