/**
 * TSLAC Compliance Styles
 * TLD SLA Compliance monitoring pages
 */

/* Search Help */
.search-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding-left: 0.5rem;
}
.search-help a {
    color: var(--accent);
}

/* Bottom Search (navigation aid at page bottom) */
.bottom-search {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.bottom-search .search-help {
    text-align: center;
    padding-left: 0;
}

/* Table Footnote */
.table-footnote {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.table-footnote a {
    color: var(--accent);
}

/* Visually Hidden (screen reader only) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Table Wrapper */
.table-wrapper {
    overflow-x: auto;
}

/* Compliance Table */
.compliance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.compliance-table th,
.compliance-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.compliance-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}
.compliance-table th.metric,
.compliance-table td.metric {
    text-align: right;
    white-space: nowrap;
}
.compliance-table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* TLD Links */
.tld-link {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.tld-link:hover {
    text-decoration: underline;
}

/* Operator */
.operator {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* Status colors - accessible palette */
.metric .status-pass { color: #3b82f6; } /* Blue - meets threshold */
.metric .status-marginal { color: #f59e0b; } /* Amber - close to threshold */
.metric .status-below { color: #ef4444; } /* Red - below threshold */
.metric .na { color: var(--text-muted); font-style: italic; }

/* Protocol tag (RDAP/WHOIS indicator) */
.protocol-tag {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.125rem 0.25rem;
    border-radius: 2px;
    margin-left: 0.25rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Legacy classes for backwards compat */
.metric .success { color: #3b82f6; }
.metric .warning { color: #f59e0b; }
.metric .error { color: #ef4444; }

/* Methodology section */
.section-intro {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.card-body h3 {
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.card-body h3:first-child {
    margin-top: 0;
}

/* Formula display */
.formula {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0.75rem 0;
    font-size: 0.875rem;
    overflow-x: auto;
}

/* Method list */
.method-list {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}
.method-list li {
    margin-bottom: 0.25rem;
}

/* Status legend */
.status-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Shape-based indicators for accessibility */
.indicator-shape {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-block;
}
.indicator-shape.circle {
    background: #3b82f6; /* Blue - clearly different from warning/error */
    border-radius: 50%;
}
.indicator-shape.triangle {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid #f59e0b; /* Amber */
}
.indicator-shape.square {
    background: #ef4444; /* Red */
    border-radius: 2px;
}

/* Staff Toolbar - maroon warning style like SLAM admin */
.staff-toolbar {
    margin-bottom: 1rem;
    border: 2px solid #5c1515;
    border-radius: 6px;
    background: #7f1d1d;
}
.staff-toggle {
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.staff-toggle:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}
.toggle-icon {
    transition: transform 0.2s;
    font-size: 0.625rem;
}
.staff-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(90deg);
}
.staff-panel {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.1);
}
.staff-panel[hidden] {
    display: none;
}
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.staff-section h4 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.staff-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    color: white;
}
.staff-label {
    color: rgba(255, 255, 255, 0.7);
}
.staff-value {
    font-weight: 500;
    color: white;
}
.staff-value code {
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    color: white;
}
.staff-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.btn-staff {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    text-decoration: none;
    text-align: center;
}
.btn-staff:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Inline button for detail rows */
.btn-inline {
    display: inline-block;
    margin-left: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.6875rem;
    font-family: var(--font-sans);
    text-decoration: none;
    vertical-align: middle;
}
.btn-inline:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    gap: 1.5rem;
}
.metric-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* Metrics Table */
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.metrics-table th,
.metrics-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.metrics-table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.025em;
}
.metrics-table td.success { color: var(--success); }
.metrics-table td.warning { color: var(--warning); }
.metrics-table td.error { color: var(--error); }
.metrics-table td.na {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

/* Dark mode adjustments for status colors */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .metric .status-pass,
    :root:not([data-theme="light"]) .indicator-shape.circle {
        background: #60a5fa;
        color: #60a5fa;
    }
    :root:not([data-theme="light"]) .metric .status-marginal,
    :root:not([data-theme="light"]) .indicator-shape.triangle {
        border-bottom-color: #fbbf24;
        color: #fbbf24;
    }
    :root:not([data-theme="light"]) .metric .status-below,
    :root:not([data-theme="light"]) .indicator-shape.square {
        background: #f87171;
        color: #f87171;
    }
}

:root[data-theme="dark"] .metric .status-pass { color: #60a5fa; }
:root[data-theme="dark"] .metric .status-marginal { color: #fbbf24; }
:root[data-theme="dark"] .metric .status-below { color: #f87171; }
:root[data-theme="dark"] .indicator-shape.circle { background: #60a5fa; }
:root[data-theme="dark"] .indicator-shape.triangle { border-bottom-color: #fbbf24; }
:root[data-theme="dark"] .indicator-shape.square { background: #f87171; }

/* Current Check Status - detail items */
.details-cell {
    font-size: 0.8125rem;
}
.detail-item {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--bg-tertiary);
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-right: 0.25rem;
    font-family: var(--font-mono);
}
.detail-item.muted {
    background: transparent;
    color: var(--text-muted);
}
.detail-item.detail-modern {
    background: #3b82f6;
    color: white;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .detail-item.detail-modern {
        background: #2563eb;
    }
}
:root[data-theme="dark"] .detail-item.detail-modern {
    background: #2563eb;
}

/* Muted text for footnotes and secondary info */
.muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Test It Yourself panel */
.test-commands {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.test-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
.cli-commands {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.cli-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}
.cli-item code {
    flex-shrink: 0;
    background: var(--bg-tertiary);
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    user-select: all;
    cursor: text;
}
.cli-item span {
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.cli-item .btn-inline {
    margin-left: 0;
}

/* Browse Page - Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.filter-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.filter-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.filter-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s;
}
.filter-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}
.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.filter-btn .count {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.25rem;
}

/* Browse Page - Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.875rem;
}
.pagination a:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}
.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}
.pagination .ellipsis {
    border: none;
    padding: 0.5rem 0.25rem;
}

/* Browse Page - Type Badges */
.type-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.type-badge.gtld { background: var(--accent-bg); color: var(--accent); }
.type-badge.cctld { background: var(--success-bg); color: var(--success); }
.type-badge.legacy { background: var(--warning-bg); color: var(--warning); }
.type-badge.root { background: var(--bg-tertiary); color: var(--text-secondary); }

/* Browse Page - Info */
.page-info {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* RDAP Timing Waterfall */
.rdap-waterfall {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.waterfall-row {
    display: grid;
    grid-template-columns: 140px 1fr 70px;
    align-items: center;
    gap: 0.75rem;
}
.waterfall-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: right;
}
.waterfall-bar-container {
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}
.waterfall-bar {
    height: 100%;
    border-radius: 4px;
    min-width: 2px;
}
.waterfall-bar.dns {
    background: #0ea5e9;  /* sky */
}
.waterfall-bar.tcp {
    background: #6366f1;  /* indigo */
}
.waterfall-bar.tls {
    background: #8b5cf6;  /* violet */
}
.waterfall-bar.ttfb {
    background: #22c55e;  /* green */
}
.waterfall-time {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-align: right;
}
.waterfall-footnote {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}
.waterfall-footnote code {
    font-size: 0.7rem;
}

/* Filter Bar Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Probe Matrix Table */
.probe-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    table-layout: fixed;
}
.probe-matrix-table th,
.probe-matrix-table td {
    padding: 0.375rem 0.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.probe-matrix-table th {
    font-weight: 600;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
}
.probe-matrix-table .probe-col {
    width: 60px;
    text-align: left;
}
.probe-matrix-table .timestamp-col {
    width: 70px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-family: var(--font-mono);
}
.probe-matrix-table .server-col {
    width: 50px;
    font-family: var(--font-mono);
}
.probe-matrix-table .rtt-cell {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    padding: 0.25rem 0.125rem;
}
.rtt-pair {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.1;
}
.rtt-v4, .rtt-v6 {
    display: block;
}
.rtt-fast { color: var(--success); }
.rtt-ok { color: var(--text-primary); }
.rtt-slow { color: var(--warning); }
.rtt-fail { color: var(--error); }
.rtt-na { color: var(--text-muted); }
.rtt-legend {
    display: inline-flex;
    gap: 1rem;
    margin-left: 1rem;
}
.rtt-legend span {
    font-size: 0.6875rem;
}
.rtt-legend .rtt-fast::before,
.rtt-legend .rtt-ok::before,
.rtt-legend .rtt-slow::before {
    content: "●";
    margin-right: 0.25rem;
}

/* Data Timestamp */
.data-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Service availability checkmark (browse page) */
.check-yes {
    color: #22c55e;
    font-weight: 600;
}
