/* dns.enhost.uk - page-specific styles */

body {
    max-width: 800px;
}

header {
    margin-bottom: 40px;
}

h1 {
    margin-bottom: 5px;
}

.lookup-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
}

.expected-group {
    margin-bottom: 15px;
}

.expected-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
}

.input-group select {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.lookup-btn {
    padding: 12px 24px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'IBM Plex Sans', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
}

.lookup-btn:hover {
    background: #0052a3;
}

.lookup-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Secondary action beside the primary lookup button */
.share-btn {
    padding: 12px 24px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    font-family: 'IBM Plex Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #f5f5f5;
    border-color: #0066cc;
    color: #0066cc;
}

.share-btn.copied {
    border-color: #2e7d32;
    color: #2e7d32;
}

#map {
    height: 420px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    z-index: 0;
}

.map-legend {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #666;
    margin-bottom: 15px;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.map-popup {
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    font-size: 13px;
}

.map-popup .popup-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.map-popup .popup-org {
    color: #666;
    margin-bottom: 5px;
}

.map-popup .popup-records {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    word-break: break-all;
}

.enhost-icon {
    height: 16px;
    width: auto;
    vertical-align: text-bottom;
}

/* Record values that point at enhost infrastructure. Brand blue, not green:
   green is reserved for the expected-value match state on .record-item, and
   an "ours" value can appear inside a mismatched box. */
.enhost-value {
    color: #0066cc;
    font-weight: 500;
}

/* The service behind one of our addresses, e.g. "App Hosting LB" */
.enhost-label {
    display: inline-block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #0066cc;
    background: #e7f0fa;
    border-radius: 10px;
    padding: 1px 8px;
    margin-left: 4px;
    vertical-align: 1px;
    white-space: nowrap;
}

.server-group-header {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    font-weight: 600;
    margin: 20px 0 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e0e0e0;
}

.show-all-btn {
    display: block;
    width: 100%;
    margin: 20px 0 10px;
    padding: 8px 16px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #0066cc;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-all-btn:hover {
    background: #f5f5f5;
    border-color: #0066cc;
}

.protocol-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 400;
    white-space: nowrap;
}

.protocol-badge.doh {
    background: #e3f2fd;
    color: #1976d2;
}

.protocol-badge.do53 {
    background: #f4f4f4;
    color: #666;
}

.dnssec-badge {
    font-size: 11px;
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 400;
    white-space: nowrap;
}

.provider-time {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.results {
    margin-top: 20px;
    display: none;
}

.results.show {
    display: block;
}

.results-header {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 10px;
}

.provider-section {
    margin-bottom: 20px;
}

.provider-header {
    font-size: 14px;
    font-weight: 600;
    color: #0066cc;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.provider-org {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.record-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    padding-right: 75px;
    margin-bottom: 10px;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    color: #666;
    font-size: 11px;
    font-family: 'IBM Plex Sans', sans-serif;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    border-color: #0066cc;
    color: #0066cc;
}

.copy-btn.copied {
    border-color: #2e7d32;
    color: #2e7d32;
}

.copy-btn.inline {
    position: static;
    margin-left: 10px;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: normal;
}

.hoverinfo {
    border-bottom: 1px dotted #999;
    cursor: help;
}

.query-btn {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    color: #0066cc;
    font-size: 11px;
    font-family: 'IBM Plex Sans', sans-serif;
    padding: 1px 6px;
    margin-left: 6px;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.2s;
}

.query-btn:hover {
    border-color: #0066cc;
    background: #f5f5f5;
}

.record-item.mismatch {
    border-left: 4px solid #ff9800;
    background: #fff3e0;
}

.record-item.match {
    border-left: 4px solid #2e7d32;
}

.record-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: #333;
    word-break: break-all;
}

.record-ttl {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.comparison-note {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 4px;
    padding: 10px;
    font-size: 12px;
    color: #1565c0;
    margin-bottom: 15px;
}

.error-message {
    background: #ffebee;
    border: 1px solid #ef5350;
    border-radius: 4px;
    padding: 15px;
    color: #c62828;
    font-size: 14px;
}

.no-records {
    background: #fff3e0;
    border: 1px solid #ff9800;
    border-radius: 4px;
    padding: 15px;
    color: #e65100;
    font-size: 14px;
}

.pending-note {
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    color: #999;
    font-size: 14px;
}

.info-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.info-section p {
    margin-bottom: 10px;
    font-size: 14px;
}

.info-section code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    display: inline-block;
}

.info-section pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 3px;
    overflow-x: auto;
    margin: 10px 0;
}

.info-section pre code {
    padding: 0;
    background: none;
    display: block;
}

/* Collapsed reference tables: root servers, reserved names */
.reference-table summary {
    cursor: pointer;
    font-size: 14px;
    color: #0066cc;
    margin-top: 15px;
    width: fit-content;
}

.reference-table summary:hover {
    text-decoration: underline;
}

.reference-table table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 15px;
    font-size: 13px;
}

.reference-table th,
.reference-table td {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.reference-table td:first-child,
.reference-table td:nth-child(3),
.reference-table td:nth-child(4) {
    font-family: 'IBM Plex Mono', monospace;
    white-space: nowrap;
}

.reference-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

@media (max-width: 600px) {
    /* The pill would push the IP out of a narrow row, so stack it instead */
    .enhost-label {
        display: block;
        width: fit-content;
        margin-left: 0;
        margin-top: 4px;
    }

    .lookup-section {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #map {
        height: 300px;
    }
    
    .info-section pre {
        padding: 10px;
        font-size: 11px;
    }
}
