body {
    font-family: 'Helvetica', Arial, sans-serif;
    background-color: #f5f5f5;
    text-align: center;
    margin: 0;
    padding: 0 0 60px 0;
    font-size: 18px;
    line-height: 1.8;
}

header {
    background-color: #333;
    color: #fff;
    padding: 20px;
}

footer {
    background-color: #333;
    color: #fff;
    padding: 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

.footer-link {
    color: #fff;
    text-decoration: none;
}

.footer-link:hover {
    color: #ccc;
}

h1 {
    color: #fff;
    margin: 0;
}

h3 {
    margin-top: 0;
}

main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

p {
    color: #666;
}

code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
    background-color: #f0f0f0;
    padding: 1px 5px;
    border-radius: 3px;
}

#urlForm {
    margin: 20px auto;
    max-width: 600px;
    background-color: #fff;
    border: 2px solid transparent;
    padding: 30px;
    border-radius: 1px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#urlForm label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

#urlForm input {
    width: 80%;
    padding: 12px;
    border: 2px solid #007bff;
    border-radius: 5px;
    margin-bottom: 20px;
}

#urlFormErrorMsg {
    color: red;
}

#urlForm.drag-over {
    border: 2px dashed #007bff;
    background-color: #f0f7ff;
}

.form-divider {
    position: relative;
    margin: 24px 0 20px;
    color: #999;
    font-size: 14px;
}

.form-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid #ddd;
}

.form-divider span {
    position: relative;
    background-color: #fff;
    padding: 0 12px;
}

#urlForm input[type="file"] {
    width: 80%;
    padding: 10px;
    border: 2px dashed #bbb;
    border-radius: 5px;
    margin-bottom: 8px;
    background-color: #fafafa;
    font-size: 14px;
    cursor: pointer;
}

#harDropHint {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

#harFileName {
    font-size: 14px;
    color: #333;
    margin-top: 8px;
    font-weight: bold;
}

button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

#wptSubmit {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s;
}

#wptSubmit:hover {
    background-color: #0056b3;
}

#loading {
    display: none;
    margin: 20px auto;
    color: #555;
    font-style: italic;
}

/* Shared panel styling */
#testSummary,
#hostSummary,
#resourceDetail {
    display: none;
    background-color: #fff;
    max-width: 1200px;
    margin: 20px auto;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: left;
}

#testSummary table,
#hostSummary table,
#resourceDetail table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
}

#testSummary th,
#testSummary td,
#hostSummary th,
#hostSummary td,
#resourceDetail th,
#resourceDetail td {
    /* border-box keeps a header's style.width equal to its rendered width, so
       dragging a column by N pixels actually moves it N pixels. */
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    font-size: 15px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#testSummary th,
#hostSummary th,
#resourceDetail th {
    background-color: #f0f0f0;
    font-weight: bold;
    color: #333;
    white-space: normal;
}

/* Sortable headers */
#hostSummaryTable th,
#resourceDetailTable th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 26px;
}

#hostSummaryTable th:hover,
#resourceDetailTable th:hover {
    background-color: #e2e6ea;
}

#hostSummaryTable th::after,
#resourceDetailTable th::after {
    content: '\2195';
    position: absolute;
    right: 11px;
    color: #aaa;
    font-size: 12px;
}

#hostSummaryTable th.sort-asc::after {
    content: '\25B2';
    color: #007bff;
}

#hostSummaryTable th.sort-desc::after {
    content: '\25BC';
    color: #007bff;
}

#resourceDetailTable th.sort-asc::after {
    content: '\25B2';
    color: #007bff;
}

#resourceDetailTable th.sort-desc::after {
    content: '\25BC';
    color: #007bff;
}

/* Host summary rows are clickable */
#hostSummaryTable tbody tr {
    cursor: pointer;
}

#hostSummaryTable tbody tr:hover {
    background-color: #f0f7ff;
}

#hostSummaryTable tbody tr.selected {
    background-color: #d6e9ff;
    font-weight: bold;
}

#hostSummaryTable tbody tr td:first-child::before {
    content: '\25B8';
    color: #007bff;
    margin-right: 6px;
}

#hostSummaryTable tbody tr.selected td:first-child::before {
    content: '\25BE';
}

.recommendation {
    text-align: left;
    font-size: 16px;
    margin-bottom: 8px;
    padding-left: 22px;
    position: relative;
}

.recommendation::before {
    content: '\2139';
    position: absolute;
    left: 0;
    color: #007bff;
    font-weight: bold;
}

#filterToggleLabel,
#durationToggleLabel {
    display: block;
    font-size: 15px;
    cursor: pointer;
    color: #333;
}

#filterToggleLabel {
    margin-top: 14px;
}

#durationToggleLabel {
    margin-top: 2px;
}

#filterHiddenCount {
    color: #777;
    font-style: italic;
}

#hostSummary_empty {
    font-size: 16px;
    color: #555;
}

#ts_note {
    font-size: 14px;
    color: #777;
    margin-top: 10px;
}

/* Value colouring */
.stale {
    color: #c0392b;
    font-weight: bold;
}

.muted {
    color: #999;
}

.multi {
    color: #777;
    font-size: 13px;
}

td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Column widths: Cache-Control values are long, so it gets the widest share
   after the identifying column. These are starting points -- dragging a column
   header replaces them with pixel widths. */
#hostSummaryTable th:nth-child(1) { width: 20%; }
#hostSummaryTable th:nth-child(2) { width:  9%; }
#hostSummaryTable th:nth-child(3) { width:  9%; }
#hostSummaryTable th:nth-child(4) { width: 29%; }
#hostSummaryTable th:nth-child(5) { width: 10%; }
#hostSummaryTable th:nth-child(6) { width: 13%; }
#hostSummaryTable th:nth-child(7) { width: 10%; }

#resourceDetailTable th:nth-child(1) { width: 27%; }
#resourceDetailTable th:nth-child(2) { width:  8%; }
#resourceDetailTable th:nth-child(3) { width:  9%; }
#resourceDetailTable th:nth-child(4) { width: 27%; }
#resourceDetailTable th:nth-child(5) { width: 10%; }
#resourceDetailTable th:nth-child(6) { width: 12%; }
#resourceDetailTable th:nth-child(7) { width:  7%; }

/* Cache-Control wraps rather than truncating, so the whole directive list stays
   readable even at the default width. */
#hostSummaryTable td:nth-child(4),
#resourceDetailTable td:nth-child(4) {
    white-space: normal;
    word-break: break-word;
}

.table-scroll {
    overflow-x: auto;
}

/* Drag handle on the right edge of every header cell. */
.col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
}

.col-resizer:hover,
.col-resizer.active {
    background-color: #007bff;
    opacity: 0.4;
}

body.col-resizing {
    cursor: col-resize;
    user-select: none;
}

.hint {
    font-size: 14px;
    color: #777;
    font-style: italic;
    margin-top: 10px;
}

#resourceDetailTable a {
    color: #007bff;
    text-decoration: none;
}

#resourceDetailTable a:hover {
    text-decoration: underline;
}

#wptDetailsLink {
    display: block;
    margin-top: 12px;
    font-size: 15px;
}
