/**
 * LLMs.txt Curator — Admin Styles
 */

/* Status Box */
.llms-txt-status-box {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 16px;
}

.llms-txt-status-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.llms-txt-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.llms-txt-status-label {
    font-weight: 600;
    color: #1d2327;
    min-width: 110px;
    flex-shrink: 0;
}

.llms-txt-status-row .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.llms-txt-status-ok { color: #00a32a; }
.llms-txt-status-ok .dashicons { color: #00a32a; }
.llms-txt-status-warn { color: #996800; }
.llms-txt-status-warn .dashicons { color: #dba617; }
.llms-txt-status-neutral { color: #50575e; }
.llms-txt-status-neutral .dashicons { color: #8c8f94; }

.llms-txt-status-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #f0f0f1;
}

.llms-txt-cache-hint {
    font-size: 12px !important;
}

/* Cards */
.llms-txt-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}
.llms-txt-card h2 { margin: 0 0 4px; padding: 0; font-size: 1.15em; }
.llms-txt-card > .description:first-of-type { margin-top: 2px; margin-bottom: 16px; }

.llms-txt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.llms-txt-card-header h2 { margin-bottom: 0; }
.llms-txt-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.llms-txt-card-actions .dashicons { font-size: 16px; width: 16px; height: 16px; margin-right: 2px; vertical-align: text-bottom; }

.llms-txt-template-select { min-width: 160px; }
.llms-txt-tabs { margin-bottom: 20px; }
.llms-txt-notices .notice { margin: 12px 0; }

/* Section Manager */
.llms-txt-sections { min-height: 40px; }
.llms-txt-section { border: 1px solid #dcdcde; border-radius: 4px; margin-bottom: 12px; background: #f6f7f7; transition: box-shadow 0.15s; }
.llms-txt-section.ui-sortable-helper { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.llms-txt-section-header { display: flex; align-items: center; padding: 10px 14px; gap: 10px; cursor: pointer; user-select: none; }
.llms-txt-section-header:hover { background: #f0f0f1; }

.llms-txt-drag-handle { cursor: grab; color: #8c8f94; font-size: 18px; flex-shrink: 0; }
.llms-txt-drag-handle:active { cursor: grabbing; }

.llms-txt-section-name { flex: 1; border: 1px solid transparent; background: transparent; padding: 4px 8px; font-size: 14px; font-weight: 600; border-radius: 3px; min-width: 0; }
.llms-txt-section-name:focus { border-color: #2271b1; background: #fff; outline: none; box-shadow: 0 0 0 1px #2271b1; }
.llms-txt-section-count { color: #8c8f94; font-size: 13px; white-space: nowrap; }
.llms-txt-section-toggle { color: #8c8f94; font-size: 20px; transition: transform 0.2s; }
.llms-txt-section.collapsed .llms-txt-section-toggle { transform: rotate(-90deg); }

.llms-txt-section-actions { display: flex; gap: 4px; }
.llms-txt-section-actions button { background: none; border: none; padding: 2px 4px; cursor: pointer; color: #8c8f94; font-size: 18px; border-radius: 3px; }
.llms-txt-section-actions button:hover { color: #d63638; background: rgba(214,54,56,0.08); }
.llms-txt-section-actions .llms-txt-add-page-btn:hover { color: #2271b1; background: rgba(34,113,177,0.08); }

.llms-txt-section-body { padding: 0 14px 14px; border-top: 1px solid #dcdcde; }
.llms-txt-section.collapsed .llms-txt-section-body { display: none; }

/* Page list */
.llms-txt-page-list { list-style: none; margin: 0; padding: 8px 0 0; min-height: 10px; }
.llms-txt-page-item { display: flex; align-items: center; padding: 7px 10px; margin-bottom: 4px; background: #fff; border: 1px solid #dcdcde; border-radius: 3px; gap: 8px; font-size: 13px; transition: border-color 0.15s; }
.llms-txt-page-item:hover { border-color: #a7aaad; }
.llms-txt-page-item.ui-sortable-helper { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.llms-txt-page-item .llms-txt-drag-handle { font-size: 14px; }
.llms-txt-page-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.llms-txt-page-type { display: inline-block; background: #e7e8ea; color: #50575e; font-size: 11px; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.llms-txt-page-desc { color: #8c8f94; font-size: 12px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.llms-txt-page-actions { display: flex; gap: 2px; flex-shrink: 0; }
.llms-txt-page-actions button { background: none; border: none; padding: 2px 4px; cursor: pointer; color: #a7aaad; font-size: 16px; border-radius: 3px; }
.llms-txt-page-actions button:hover { color: #d63638; background: rgba(214,54,56,0.06); }
.llms-txt-page-actions .llms-txt-edit-desc-btn:hover { color: #2271b1; background: rgba(34,113,177,0.06); }

/* Empty states */
.llms-txt-empty-state { text-align: center; padding: 40px 20px; color: #8c8f94; background: #f6f7f7; border: 2px dashed #c3c4c7; border-radius: 4px; }
.llms-txt-section-empty { text-align: center; padding: 16px; color: #a7aaad; font-size: 13px; font-style: italic; }

/* Modal */
.llms-txt-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 160000; display: flex; align-items: center; justify-content: center; }
.llms-txt-modal-content { background: #fff; border-radius: 8px; width: 90%; max-width: 640px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
.llms-txt-modal-sm { max-width: 480px; }
.llms-txt-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #dcdcde; }
.llms-txt-modal-header h3 { margin: 0; }
.llms-txt-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #8c8f94; padding: 0; line-height: 1; }
.llms-txt-modal-close:hover { color: #1d2327; }
.llms-txt-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.llms-txt-modal-body input[type="text"] { width: 100%; margin-bottom: 12px; }
.llms-txt-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #dcdcde; }

/* Page search results */
.llms-txt-page-results { max-height: 360px; overflow-y: auto; border: 1px solid #dcdcde; border-radius: 3px; }
.llms-txt-page-result { display: flex; align-items: center; padding: 8px 12px; gap: 10px; cursor: pointer; border-bottom: 1px solid #f0f0f1; transition: background 0.1s; }
.llms-txt-page-result:last-child { border-bottom: none; }
.llms-txt-page-result:hover { background: #f0f6fc; }
.llms-txt-page-result.selected { background: #e7f3fe; }
.llms-txt-page-result input[type="checkbox"] { flex-shrink: 0; }
.llms-txt-page-result-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Preview */
.llms-txt-preview-code { background: #1e1e1e; color: #d4d4d4; padding: 20px; border-radius: 4px; overflow-x: auto; font-family: Consolas, Monaco, "Courier New", monospace; font-size: 13px; line-height: 1.6; max-height: 500px; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; margin: 0; }

/* Validation */
.llms-txt-validation-item { display: flex; align-items: flex-start; padding: 8px 0; gap: 8px; border-bottom: 1px solid #f0f0f1; font-size: 13px; }
.llms-txt-validation-item:last-child { border-bottom: none; }
.llms-txt-validation-icon { flex-shrink: 0; font-size: 18px; line-height: 1.2; }
.llms-txt-validation-error .llms-txt-validation-icon { color: #d63638; }
.llms-txt-validation-warning .llms-txt-validation-icon { color: #dba617; }
.llms-txt-validation-info .llms-txt-validation-icon { color: #2271b1; }
.llms-txt-validation-success { color: #00a32a; padding: 12px 0; font-weight: 500; }

/* SEO test */
.llms-txt-seo-test-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.llms-txt-seo-test-row input[type="text"] { width: 320px; }

/* Crawler log stats */
.llms-txt-stat-grid { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.llms-txt-stat-box { background: #f6f7f7; border: 1px solid #dcdcde; border-radius: 4px; padding: 16px 20px; text-align: center; min-width: 140px; flex: 1; }
.llms-txt-stat-number { display: block; font-size: 22px; font-weight: 600; color: #1d2327; margin-bottom: 4px; }
.llms-txt-stat-label { display: block; font-size: 12px; color: #8c8f94; text-transform: uppercase; letter-spacing: 0.5px; }

/* Badge on tab */
.llms-txt-badge { display: inline-block; background: #2271b1; color: #fff; font-size: 11px; line-height: 18px; min-width: 18px; text-align: center; border-radius: 9px; padding: 0 6px; margin-left: 4px; vertical-align: middle; }

/* Responsive */
@media screen and (max-width: 782px) {
    .llms-txt-card { padding: 14px 16px; }
    .llms-txt-card-header { flex-direction: column; align-items: flex-start; }
    .llms-txt-card-actions { width: 100%; justify-content: flex-start; }
    .llms-txt-section-header { flex-wrap: wrap; }
    .llms-txt-page-desc { display: none; }
    .llms-txt-status-label { min-width: 90px; }
    .llms-txt-status-actions { flex-direction: column; }
}

/* ============================================================
   Change Detection Banner
   ============================================================ */
.llms-txt-changes-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff8e1;
    border: 1px solid #f0b429;
    border-left: 4px solid #f0b429;
    border-radius: 4px;
    padding: 10px 16px;
    margin: 12px 0 16px;
    font-size: 13px;
}
.llms-txt-changes-banner .dashicons {
    color: #b45309;
    flex-shrink: 0;
}
.llms-txt-changes-list {
    flex: 1;
    color: #555;
}
.llms-txt-changes-list a {
    color: #2271b1;
    text-decoration: none;
}

/* ============================================================
   Description Suggestions
   ============================================================ */
.llms-txt-suggest-result {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 0 0 12px;
}
.llms-txt-suggest-filled {
    color: #1a7e3b;
    font-weight: 500;
}
.llms-txt-suggest-missing {
    color: #8a6a00;
    font-weight: 500;
}
.llms-txt-review-list {
    margin: 8px 0 0 16px;
    list-style: disc;
}
.llms-txt-review-list li {
    margin-bottom: 4px;
}
.llms-txt-review-list a {
    color: #2271b1;
    text-decoration: none;
}

/* ============================================================
   Title Override
   ============================================================ */
.llms-txt-title-overridden {
    color: #2271b1;
    font-style: italic;
}
.llms-txt-edit-title-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    color: #50575e;
    line-height: 1;
}
.llms-txt-edit-title-btn:hover {
    color: #2271b1;
}
.llms-txt-edit-title-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ============================================================
   Safety Mode Card
   ============================================================ */
.llms-txt-safety-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-bottom: 16px;
}
.llms-txt-safety-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #3c434a;
}
.llms-txt-check-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.llms-txt-check-pass { color: #1a7e3b; }
.llms-txt-check-fail { color: #cc1818; }

.llms-txt-validation-result {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}
.llms-txt-safety-passed {
    background: #edfaef;
    border-left: 4px solid #1a7e3b;
    padding: 12px 16px;
    color: #1a7e3b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.llms-txt-safety-passed .dashicons {
    font-size: 20px;
    margin-right: 6px;
    vertical-align: middle;
}
.llms-txt-safety-header {
    padding: 10px 16px;
    font-size: 13px;
}
.llms-txt-safety-header .dashicons {
    vertical-align: middle;
    margin-right: 4px;
}
.llms-txt-safety-errors {
    background: #fce8e8;
    border-left: 4px solid #cc1818;
    color: #cc1818;
}
.llms-txt-safety-warnings {
    background: #fff8e1;
    border-left: 4px solid #f0b429;
    color: #8a6a00;
}
.llms-txt-safety-stats {
    padding: 4px 16px 8px;
    margin: 0;
    font-size: 12px;
    color: #646970;
    background: #f6f7f7;
    border-top: 1px solid #dcdcde;
}
.llms-txt-safety-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    border-top: 1px solid #dcdcde;
}
.llms-txt-safety-item .dashicons {
    flex-shrink: 0;
    margin-top: 1px;
}
.llms-txt-item-error .dashicons  { color: #cc1818; }
.llms-txt-item-warning .dashicons { color: #b45309; }

/* ============================================================
   Scheduled Regeneration Card
   ============================================================ */
.llms-txt-card fieldset label strong {
    margin-left: 4px;
}

/* ============================================================
   Crawler Analytics (7-day bar chart)
   ============================================================ */
.llms-txt-period-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #2271b1;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.llms-txt-analytics-total {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
}
.llms-txt-analytics-total-number {
    font-size: 36px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1;
}
.llms-txt-analytics-total-label {
    font-size: 14px;
    color: #646970;
}
.llms-txt-analytics-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 560px;
}
.llms-txt-analytics-row {
    display: grid;
    grid-template-columns: 160px 1fr 40px;
    align-items: center;
    gap: 10px;
}
.llms-txt-analytics-bot {
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.llms-txt-analytics-bar-wrap {
    background: #f0f0f1;
    border-radius: 3px;
    height: 10px;
    overflow: hidden;
}
.llms-txt-analytics-bar {
    height: 100%;
    background: #2271b1;
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 3px;
}
.llms-txt-analytics-count {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    text-align: right;
}
.llms-txt-analytics-empty {
    text-align: center;
    padding: 24px 0;
    color: #8c8f94;
}

/* ============================================================
   Health / Reachability Banner
   ============================================================ */
.llms-txt-health-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff8e1;
    border-left: 4px solid #f0b429;
    border-radius: 0 4px 4px 0;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.llms-txt-health-icon {
    color: #b45309;
    font-size: 22px;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 1px;
}
.llms-txt-health-body {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: #1d2327;
}
.llms-txt-health-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.llms-txt-banner-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: #646970;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}
.llms-txt-banner-dismiss:hover { color: #1d2327; }

/* ============================================================
   Status bar error state
   ============================================================ */
.llms-txt-status-error {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #cc1818;
}

/* ============================================================
   Diagnostics Panel
   ============================================================ */
.llms-txt-diag-table th {
    width: 220px;
    font-weight: 600;
    vertical-align: top;
    padding: 8px 12px;
}
.llms-txt-diag-table td {
    vertical-align: top;
    padding: 8px 12px;
    font-size: 13px;
}
.llms-txt-diag-ok {
    color: #1a7e3b;
    display: flex;
    align-items: center;
    gap: 4px;
}
.llms-txt-diag-warn {
    color: #b45309;
    display: flex;
    align-items: center;
    gap: 4px;
}
.llms-txt-diag-neutral { color: #646970; }
.llms-txt-diag-note {
    margin-left: 8px;
    font-size: 12px;
    color: #8c8f94;
}

/* ==========================================================================
   v1.4 — 30-day crawler chart & last-crawled banner
   ========================================================================== */

.llms-txt-last-crawled-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f6ff;
    border: 1px solid #c5d9f0;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1d4e89;
}
.llms-txt-last-crawled-banner .dashicons {
    color: #2271b1;
    flex-shrink: 0;
}

.llmscu-chart-wrap {
    margin-top: 16px;
}

.llmscu-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    padding-bottom: 22px; /* room for labels */
    border-bottom: 1px solid #dcdcde;
    overflow-x: auto;
}

.llmscu-chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    min-width: 18px;
    height: 100%;
    position: relative;
    cursor: default;
}

.llmscu-chart-bar-inner {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: opacity .15s;
}

.llmscu-chart-col:hover .llmscu-chart-bar-inner {
    opacity: .8;
}

.llmscu-chart-segment {
    width: 100%;
}

.llmscu-chart-label {
    position: absolute;
    bottom: -20px;
    font-size: 10px;
    color: #757575;
    white-space: nowrap;
    transform: rotate(-35deg) translateX(-4px);
    transform-origin: top left;
}

.llmscu-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 28px;
    font-size: 12px;
}

.llmscu-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.llmscu-legend-swatch {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 2px;
    flex-shrink: 0;
}
