:root{
    --control-height: 44px;
}

/* =========================
   Base
   ========================= */
body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f2f2f2;
    margin: 0;
    padding: 0;
}

.container {
    position: relative;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

/* =========================
   Header
   ========================= */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

h1 {
    text-align: center;
    margin: 10px 0;
}

.subtitle {
    text-align: center;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 20px;
}

/* =========================
   Search box
   ========================= */
.searchbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* =========================
   Inputs (independent)
   ========================= */

/* Host / IP input */
.host-input {
    height: var(--control-height);
    padding: 0 10px;
    width: 300px;

    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Port input (fixed 100px) */
.port-input {
    height: var(--control-height);
    width: 100px;
    min-width: 100px;
    max-width: 100px;

    padding: 0 8px;
    text-align: center;

    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Remove number spinners */
.port-input::-webkit-outer-spin-button,
.port-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.port-input[type=number] {
    -moz-appearance: textfield;
}

/* Focus (same as other tool) */
.host-input:focus,
.port-input:focus {
    outline: none;
    border-color: #8EAFDA;
}

/* =========================
   Buttons
   ========================= */
button {
    height: var(--control-height);
    padding: 0 20px;
    font-size: 16px;

    background-color: #8EAFDA;
    color: #fff;

    border: 1px solid transparent;
    border-radius: 4px;
    box-sizing: border-box;

    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    filter: brightness(0.95);
}

/* =========================
   Presets
   ========================= */
.preset-box {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.preset-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn {
    height: var(--control-height);
    padding: 0 14px;

    background-color: #8EAFDA;
    color: #fff;

    border: 1px solid transparent;
    border-radius: 4px;

    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.preset-btn:hover {
    filter: brightness(0.95);
}

.preset-btn small {
    font-weight: normal;
    opacity: 0.85;
    margin-left: 6px;
}

/* =========================
   Spinner
   ========================= */
.spinner-container {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    margin: 150px 0;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #8EAFDA;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================
   Results table
   ========================= */
.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    background: #fff;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background-color: #f8f9fa;
}

th, td {
    padding: 15px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

/* =========================
   Footer
   ========================= */
.footer {
    text-align: center;
    font-size: 9px;
    color: #777;
    margin-top: 40px;
}

.footer a {
    color: #777;
    text-decoration: none;
}
