/* =============================================================
   GPS Robots.txt Tester v2 — Admin CSS
   Matches technicalseo.com/tools/robots-txt/ visual style
   ============================================================= */

.gps-rt-wrap * { box-sizing: border-box; }

.gps-rt-wrap {
    max-width: 1400px;
    margin: 20px 20px 60px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #1d2327;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
}

/* ── Intro bar ──────────────────────────────────────────────── */
.gps-rt-intro {
    padding: 14px 20px;
    font-size: 13px;
    color: #646970;
    background: #fff;
    border-bottom: 1px solid #dcdcde;
    line-height: 1.5;
}

/* ── Toolbar ────────────────────────────────────────────────── */
.gps-rt-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 0;
    padding: 14px 20px;
    background: #fff;
    border-bottom: 1px solid #dcdcde;
    flex-wrap: wrap;
    gap: 12px;
}

.gps-rt-tb-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gps-rt-tb-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #50575e;
}

/* URL field — takes remaining space */
.gps-rt-tb-url {
    flex: 1;
    min-width: 260px;
}

.gps-rt-input {
    height: 36px;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    padding: 0 10px;
    font-size: 13px;
    font-family: inherit;
    color: #1d2327;
    outline: none;
    width: 100%;
    transition: border-color 0.15s;
}
.gps-rt-input:focus { border-color: #2271b1; box-shadow: 0 0 0 2px rgba(34,113,177,.15); }

/* Agent selector */
.gps-rt-tb-agent { min-width: 230px; position: relative; }

.gps-rt-agent-wrap { position: relative; }

.gps-rt-agent-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    padding: 0 10px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s;
    min-width: 220px;
}
.gps-rt-agent-trigger:hover,
.gps-rt-agent-trigger.is-open { border-color: #2271b1; }

.gps-rt-agent-selected { display: flex; align-items: center; gap: 8px; flex: 1; }
.gps-rt-agent-sel-label { font-size: 13px; font-weight: 500; color: #1d2327; }
.gps-rt-agent-sel-token {
    font-size: 11px; font-family: monospace;
    background: #f0f0f1; padding: 2px 6px; border-radius: 3px; color: #646970;
}
.gps-rt-arrow { color: #646970; font-size: 16px; transition: transform .2s; }
.gps-rt-agent-trigger.is-open .gps-rt-arrow { transform: rotate(180deg); }

/* Agent dropdown */
.gps-rt-agent-dropdown {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    min-width: 260px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 99999;
    overflow: hidden;
}
.gps-rt-agent-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f1;
}
.gps-rt-agent-search-row .dashicons { color: #a7aaad; font-size: 16px; flex-shrink: 0; }
.gps-rt-agent-search-row input {
    border: none; outline: none; font-size: 13px; width: 100%; font-family: inherit;
}
#gps-rt-agent-list {
    margin: 0; padding: 4px 0; list-style: none;
    max-height: 280px; overflow-y: auto;
}
#gps-rt-agent-list li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px; font-size: 13px; cursor: pointer; transition: background .1s;
}
#gps-rt-agent-list li:hover { background: #f0f6fc; }
#gps-rt-agent-list li.is-selected { background: #f0f6fc; font-weight: 600; }
.gps-rt-agent-group-hdr {
    padding: 6px 14px 3px;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: #a7aaad; pointer-events: none;
}
.gps-rt-item-token {
    font-size: 11px; font-family: monospace;
    background: #f0f0f1; padding: 2px 6px; border-radius: 3px; color: #a7aaad;
}

/* Mode radios */
.gps-rt-tb-mode {
    flex-direction: row;
    align-items: center;
    gap: 0;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    overflow: hidden;
    height: 36px;
    margin-top: 19px; /* align with inputs */
}
.gps-rt-mode-opt {
    display: flex; align-items: center; justify-content: center;
    padding: 0 14px;
    height: 100%;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #646970;
    transition: background .15s, color .15s;
    user-select: none;
    white-space: nowrap;
    gap: 6px;
}
.gps-rt-mode-opt:not(:last-child) { border-right: 1px solid #dcdcde; }
.gps-rt-mode-opt input[type="radio"] { position: absolute; opacity: 0; width:0; height:0; }
.gps-rt-mode-opt:has(input:checked) {
    background: #2271b1; color: #fff;
}

/* Check Resources */
.gps-rt-tb-resources { justify-content: flex-end; padding-bottom: 8px; }
.gps-rt-check-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; cursor: pointer; color: #1d2327; white-space: nowrap;
}

/* TEST button */
.gps-rt-test-btn {
    height: 36px; padding: 0 28px;
    background: #2271b1; color: #fff;
    border: none; border-radius: 3px;
    font-size: 13px; font-weight: 700;
    cursor: pointer; outline: none;
    display: flex; align-items: center; gap: 8px;
    margin-top: 19px;
    transition: background .15s;
    white-space: nowrap;
}
.gps-rt-test-btn:hover:not(:disabled) { background: #135e96; }
.gps-rt-test-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Spinner */
.gps-rt-spinner {
    display: inline-block;
    width: 13px; height: 13px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gps-rt-spin .7s linear infinite;
}
@keyframes gps-rt-spin { to { transform: rotate(360deg); } }

/* ── Editor panel ───────────────────────────────────────────── */
.gps-rt-editor-panel {
    border-bottom: 1px solid #dcdcde;
}
.gps-rt-editor-textarea {
    display: block;
    width: 100%;
    min-height: 220px;
    border: none;
    outline: none;
    padding: 14px 20px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.65;
    color: #1d2327;
    background: #fafafa;
    resize: vertical;
}
.gps-rt-editor-textarea:focus { background: #fff; }

/* ── Content area ───────────────────────────────────────────── */
.gps-rt-content-area {
    min-height: 260px;
    background: #fff;
}

/* Empty state */
.gps-rt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #a7aaad;
}
.gps-rt-empty-icon {
    font-size: 36px; width: 36px; height: 36px;
    color: #dcdcde; margin-bottom: 12px;
}
.gps-rt-empty-state p { margin: 0 0 6px; font-size: 14px; color: #646970; }
.gps-rt-empty-sub { font-size: 13px !important; color: #a7aaad !important; }

/* ── Code View ──────────────────────────────────────────────── */
.gps-rt-code-view {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1;
    overflow-x: auto;
    background: #fff;
    counter-reset: line;
}

.gps-rt-line {
    display: flex;
    align-items: stretch;
    min-height: 26px;
    border-bottom: 1px solid transparent;
}
.gps-rt-line:hover { background: #fafafa; }

/* Line number */
.gps-rt-ln {
    flex-shrink: 0;
    width: 48px;
    text-align: right;
    padding: 5px 14px 5px 0;
    color: #c3c4c7;
    font-size: 12px;
    user-select: none;
    border-right: 1px solid #f0f0f1;
    background: #fafafa;
}

/* Match icon column */
.gps-rt-li {
    flex-shrink: 0;
    width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Line content */
.gps-rt-lc {
    flex: 1;
    padding: 5px 14px;
    white-space: pre;
    line-height: 1.6;
    color: #1d2327;
}

/* Highlighted lines */
.gps-rt-line.is-blocked  { background: #fff0f0 !important; border-bottom-color: #f5c0c0; }
.gps-rt-line.is-blocked  .gps-rt-ln  { background: #fce8e8; color: #b32d2e; }
.gps-rt-line.is-blocked  .gps-rt-lc  { color: #b32d2e; font-weight: 600; }
.gps-rt-line.is-allowed  { background: #edfaed !important; border-bottom-color: #a8e8b3; }
.gps-rt-line.is-allowed  .gps-rt-ln  { background: #dff5df; color: #007a1f; }
.gps-rt-line.is-allowed  .gps-rt-lc  { color: #007a1f; font-weight: 600; }

/* Syntax colouring */
.gps-rt-d-useragent { color: #0073aa; }
.gps-rt-d-allow     { color: #007a1f; }
.gps-rt-d-disallow  { color: #d63638; }
.gps-rt-d-sitemap   { color: #8650dc; }
.gps-rt-d-crawl     { color: #9a6700; }
.gps-rt-d-comment   { color: #a7aaad; font-style: italic; }
.gps-rt-d-value     { color: #1d2327; }

/* ── Status bar ─────────────────────────────────────────────── */
.gps-rt-status-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 8px 18px;
    background: #f6f7f7;
    border-top: 1px solid #dcdcde;
    font-size: 12.5px;
    color: #646970;
}
.gps-rt-sb-segment {
    display: flex; align-items: center; gap: 5px;
}
.gps-rt-sb-segment:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 1px; height: 14px;
    background: #dcdcde;
    margin: 0 14px;
}
.gps-rt-sb-segment a { color: #2271b1; text-decoration: none; }
.gps-rt-sb-segment a:hover { text-decoration: underline; }

.gps-rt-http-badge {
    display: inline-block;
    padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 700;
    white-space: nowrap;
}
.gps-rt-http-200  { background: #edfaed; color: #007a1f; }
.gps-rt-http-404  { background: #fcf0f0; color: #d63638; }
.gps-rt-http-other{ background: #fcf9e8; color: #9a6700; }

.gps-rt-sb-path { color: #1d2327; }
.gps-rt-sb-path strong { color: #50575e; font-weight: 600; }

.gps-rt-result-allowed { color: #007a1f; font-weight: 700; }
.gps-rt-result-blocked  { color: #d63638; font-weight: 700; }
.gps-rt-result-label    { color: #646970; }

/* ── Tables ─────────────────────────────────────────────────── */
.gps-rt-panel-section {
    border-top: 1px solid #dcdcde;
}

.gps-rt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.gps-rt-table th {
    text-align: left;
    padding: 9px 18px;
    background: #f6f7f7;
    color: #50575e;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid #dcdcde;
}
.gps-rt-table td {
    padding: 9px 18px;
    border-bottom: 1px solid #f0f0f1;
    color: #1d2327;
    vertical-align: middle;
}
.gps-rt-table tr:last-child td { border-bottom: none; }
.gps-rt-table a { color: #2271b1; text-decoration: none; word-break: break-all; }
.gps-rt-table a:hover { text-decoration: underline; }

.gps-rt-status-ok    { color: #007a1f; font-weight: 600; }
.gps-rt-status-err   { color: #d63638; font-weight: 600; }
.gps-rt-status-other { color: #9a6700; font-weight: 600; }

/* Resource type badges */
.gps-rt-type-badge {
    display: inline-block;
    padding: 1px 7px; border-radius: 3px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase;
}
.gps-rt-type-css  { background: #e7f5ff; color: #0073aa; }
.gps-rt-type-js   { background: #fffae6; color: #9a6700; }
.gps-rt-type-img  { background: #f3f0ff; color: #5a35b5; }
.gps-rt-type-other{ background: #f0f0f1; color: #646970; }

.gps-rt-resource-allowed { color: #007a1f; }
.gps-rt-resource-blocked  { color: #d63638; }

/* Section header */
.gps-rt-section-header {
    padding: 8px 18px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: #646970;
    background: #f6f7f7; border-bottom: 1px solid #dcdcde;
}

/* ── Frontend shortcode overrides ──────────────────────────────
   Keeps the tool self-contained when rendered inside a page/post.
   ──────────────────────────────────────────────────────────── */
.gps-rt-wrap {
    margin: 0 0 40px 0;   /* remove WP admin left margin on frontend */
    max-width: 100%;
}

/* Reset any theme button styles leaking in */
.gps-rt-test-btn,
.gps-rt-test-btn:hover,
.gps-rt-test-btn:focus {
    box-shadow: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
}

/* Make mode radio :has() work in older themes that reset label styles */
.gps-rt-tb-mode .gps-rt-mode-opt {
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 14px !important;
}

/* ── Inline editor (replaces separate editor panel) ────────────
   Sits inside gps-rt-content-area, same visual weight as code view.
   ──────────────────────────────────────────────────────────── */
#gps-rt-edit-view {
    border: none;
    background: #fff;
}

.gps-rt-inline-editor {
    display: block;
    width: 100%;
    min-height: 420px;
    padding: 14px 18px 14px 62px; /* left-pad aligns with code view line content */
    border: none;
    outline: none;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.65;
    color: #1d2327;
    background: #fff;
    resize: vertical;
    box-sizing: border-box;
}

.gps-rt-inline-editor:focus {
    background: #fafffe;
}

/* ── Back-to-edit bar ──────────────────────────────────────── */
.gps-rt-back-bar {
    padding: 8px 18px;
    background: #f6f7f7;
    border-top: 1px solid #dcdcde;
}

.gps-rt-back-btn {
    background: none;
    border: 1px solid #dcdcde;
    border-radius: 3px;
    padding: 5px 14px;
    font-size: 12.5px;
    font-family: inherit;
    color: #50575e;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.gps-rt-back-btn:hover {
    background: #fff;
    color: #2271b1;
    border-color: #2271b1;
}

/* Remove old editor-panel styles (kept for safety) */
.gps-rt-editor-panel { display: none !important; }

/* ── Plugin B integration overrides ─────────────────────────────
   Applied when tool is embedded inside .gps-wrap (admin) or
   rendered directly as a frontend shortcode.
   ────────────────────────────────────────────────────────────── */
.gps-wrap .gps-rt-wrap {
    border: 1px solid #dcdcde;
    border-radius: 6px;
    overflow: hidden;
    margin: 0;
}

/* Prevent theme buttons from overriding tool buttons */
.gps-rt-wrap .gps-rt-test-btn,
.gps-rt-wrap .gps-rt-test-btn:hover,
.gps-rt-wrap .gps-rt-test-btn:focus {
    box-shadow: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
}
