/**
 * Admin Styles for DraftSEO.AI
 *
 * @package DraftSEO_Publisher
 * @since   1.0.0
 */

/* ── Page wrapper ─────────────────────────────────────────────────────────── */
.draftseo-settings {
    max-width: 1200px;
}

.draftseo-header {
    background: #fff;
    border-left: 4px solid #2271b1;
    padding: 15px 20px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.draftseo-header p {
    margin: 0;
    font-size: 14px;
    color: #646970;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.draftseo-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    margin: 0 0 25px 0;
    padding: 0;
}

.draftseo-card h2 {
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid #c3c4c7;
    background: #f6f7f7;
    font-size: 16px;
    font-weight: 600;
}

.draftseo-card .form-table {
    margin-top: 0;
}

.draftseo-card .form-table th,
.draftseo-card .form-table td {
    padding: 15px 20px;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.draftseo-nav-tabs {
    margin-top: 16px;
    margin-bottom: 0;
    border-bottom: 1px solid #c3c4c7;
}

.draftseo-nav-tabs .nav-tab {
    position: relative;
    margin-bottom: -1px;
}

/* Red badge on the Logs tab showing error count */
.draftseo-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: #d63638;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    line-height: 1;
    vertical-align: middle;
}

/* ── Logs toolbar ─────────────────────────────────────────────────────────── */
.draftseo-logs-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.draftseo-log-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.draftseo-log-filters select,
.draftseo-log-filters input[type="text"] {
    font-size: 13px;
    padding: 4px 8px;
    height: 30px;
}

.draftseo-log-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.draftseo-log-actions .button {
    font-size: 13px;
    height: 30px;
    line-height: 28px;
    padding: 0 10px;
}

.draftseo-log-meta {
    padding: 10px 20px 0;
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

/* ── Log table ────────────────────────────────────────────────────────────── */
.draftseo-log-table {
    margin: 8px 0 0 !important;
    border: none !important;
    border-top: 1px solid #e5e7eb !important;
}

.draftseo-log-table thead th {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    padding: 8px 12px !important;
    border-bottom: 1px solid #e5e7eb;
}

.draftseo-log-table tbody td {
    padding: 8px 12px !important;
    vertical-align: top;
    font-size: 13px;
}

/* ── Level badges ─────────────────────────────────────────────────────────── */
.draftseo-level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.draftseo-level-error {
    background: #fee2e2;
    color: #991b1b;
}

.draftseo-level-warning {
    background: #fef3c7;
    color: #92400e;
}

.draftseo-level-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.draftseo-log-pagination {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.draftseo-log-pagination .page-numbers {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 2px;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
    background: #fff;
}

.draftseo-log-pagination .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.draftseo-log-pagination .page-numbers:hover:not(.current) {
    background: #f0f6fc;
}

/* ── Retention notice ─────────────────────────────────────────────────────── */
.draftseo-log-retention-notice {
    padding: 10px 20px;
    font-size: 12px;
    color: #9ca3af;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ── Misc ─────────────────────────────────────────────────────────────────── */
#connection-status {
    display: inline-block;
    margin-left: 10px;
    font-weight: 600;
}

#connection-status.success { color: #00a32a; }
#connection-status.error   { color: #d63638; }
#connection-status.testing { color: #2271b1; }

.draftseo-settings code {
    background: #f0f0f1;
    padding: 3px 8px;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.draftseo-settings .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    padding: 8px 20px;
    height: auto;
    font-size: 14px;
}

.draftseo-settings .button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.draftseo-settings input[type="password"],
.draftseo-settings input[type="text"],
.draftseo-settings select {
    font-size: 14px;
    padding: 6px 10px;
}

.draftseo-settings .description {
    margin-top: 5px;
    color: #646970;
    font-size: 13px;
}

.draftseo-settings label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.draftseo-settings input[type="checkbox"] {
    margin: 0 8px 0 0;
}

.notice.notice-success { border-left-color: #00a32a; }
.notice.notice-error   { border-left-color: #d63638; }

/* Loading spinner */
.draftseo-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-left-color: #2271b1;
    border-radius: 50%;
    animation: draftseo-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes draftseo-spin {
    to { transform: rotate(360deg); }
}
