/**
 * Jit SEO Suite - Professional Admin Styles
 * SEOPress-inspired clean, modern UI with full responsiveness
 */

/* ===================================
   Root Colors & Variables
   =================================== */
:root {
    --primary-color: #0073aa;
    --primary-dark: #005a87;
    --secondary-color: #7ad03a;
    --warning-color: #ffba00;
    --danger-color: #dc3232;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --text-primary: #23282d;
    --text-secondary: #666;
    --text-muted: #999;
}

/* ===================================
   Meta Box Container
   =================================== */
.jit-seo-suite-metabox {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 0;
}

/* ===================================
   Header Section
   =================================== */
.jit-seo-suite-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004a77 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.jit-seo-suite-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.jit-seo-suite-header-icon {
    font-size: 24px;
}

/* ===================================
   Tab Navigation
   =================================== */
.jit-seo-suite-tabs {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.jit-seo-suite-tab-buttons {
    display: flex;
    background: #fafafa;
    border-bottom: 2px solid var(--border-color);
    margin: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.jit-seo-suite-tab-button {
    background: transparent;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ═══════════════════════════════════════════════════════════
   Animated 3D Emoji System
   ═══════════════════════════════════════════════════════════ */

/* ── Keyframes ────────────────────────────────────────────── */

/* Pop-in: used when emoji first appears / score changes */
@keyframes jit-pop-in {
    0%   { transform: scale(0.4) rotate(-10deg); opacity: 0; filter: blur(2px); }
    50%  { transform: scale(1.3) rotate(5deg);   opacity: 1; filter: blur(0); }
    75%  { transform: scale(0.92) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Good — happy bounce: floats up and down with slight scale */
@keyframes jit-bounce-good {
    0%, 100% { transform: translateY(0) scale(1);    filter: drop-shadow(0 2px 4px rgba(22,163,74,.35)); }
    40%      { transform: translateY(-5px) scale(1.12); filter: drop-shadow(0 6px 8px rgba(22,163,74,.5)); }
    70%      { transform: translateY(-2px) scale(1.06); filter: drop-shadow(0 4px 6px rgba(22,163,74,.4)); }
}

/* OK — thoughtful head tilt, side to side */
@keyframes jit-tilt-ok {
    0%, 100% { transform: rotate(0deg)   scale(1);    filter: drop-shadow(0 2px 4px rgba(217,119,6,.3)); }
    25%      { transform: rotate(-14deg) scale(1.08); filter: drop-shadow(0 3px 6px rgba(217,119,6,.45)); }
    50%      { transform: rotate(0deg)   scale(1); }
    75%      { transform: rotate(10deg)  scale(1.05); filter: drop-shadow(0 3px 6px rgba(217,119,6,.4)); }
}

/* Bad — anxious horizontal shake + slight red glow */
@keyframes jit-shake-bad {
    0%, 100% { transform: translateX(0) rotate(0deg);    filter: drop-shadow(0 2px 4px rgba(220,38,38,.3)); }
    15%      { transform: translateX(-5px) rotate(-5deg); filter: drop-shadow(0 2px 8px rgba(220,38,38,.6)); }
    30%      { transform: translateX(5px)  rotate(5deg); }
    45%      { transform: translateX(-4px) rotate(-3deg); }
    60%      { transform: translateX(4px)  rotate(3deg); }
    75%      { transform: translateX(-2px) rotate(-1deg); }
}

/* None — gentle idle pulse */
@keyframes jit-idle-none {
    0%, 100% { transform: scale(1);    opacity: 0.5; }
    50%      { transform: scale(1.08); opacity: 0.7; }
}

/* Check-item entry pop */
@keyframes jit-check-pop {
    0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
    60%  { transform: scale(1.25) rotate(5deg); opacity: 1; }
    80%  { transform: scale(0.9) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Check good: happy bounce (plays 2×) */
@keyframes jit-check-good {
    0%, 100% { transform: translateY(0) scale(1); }
    40%      { transform: translateY(-3px) scale(1.15); }
}

/* Check warning: nervous wobble (plays 3×) */
@keyframes jit-check-warn {
    0%, 100% { transform: rotate(0deg); }
    20%      { transform: rotate(-14deg); }
    40%      { transform: rotate(12deg); }
    60%      { transform: rotate(-8deg); }
    80%      { transform: rotate(6deg); }
}

/* Check bad: distressed shake (plays 2×) */
@keyframes jit-check-bad {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-4px); }
    40%      { transform: translateX(4px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}

/* ── Tab dot (CSS circle — instant render, no emoji load delay) ────────── */
.jit-tab-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4a5568;
    flex-shrink: 0;
    margin-right: 6px;
}

.jit-seo-suite-tab-button.active .jit-tab-dot {
    background-color: #1e40af;
}

.jit-tab-dot.jit-face-anim--none {
    opacity: 0.5;
}

/* ── Tab icon (SVG for Schema / Social / Advanced tabs) ───── */
.jit-tab-icon {
    display: block;
    flex-shrink: 0;
    color: inherit;
    opacity: 0.75;
    transition: opacity 0.2s ease, color 0.3s ease;
}
.jit-seo-suite-tab-button.active .jit-tab-icon,
.jit-seo-suite-tab-button:hover .jit-tab-icon {
    opacity: 1;
}

/* Score icons (SEO and Readability tabs) — color based on rating */
.jit-tab-score-icon {
    opacity: 1;
}

.jit-tab-score-icon.jit-tab-icon--good {
    color: #16a34a;
}

.jit-tab-score-icon.jit-tab-icon--ok {
    color: #d97706;
}

.jit-tab-score-icon.jit-tab-icon--bad {
    color: #dc2626;
}

.jit-tab-score-icon.jit-tab-icon--none {
    color: #9ca3af;
    opacity: 0.5;
}

/* ── Checklist dot (SVG colored circle) ───────────────────── */
.jit-check-dot {
    flex-shrink: 0;
    display: inline-flex;
    align-items: flex-start;
}

.jit-seo-suite-tab-button:hover {
    background: #fff;
    color: var(--primary-color);
}

.jit-seo-suite-tab-button.active {
    background: #fff;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.jit-seo-suite-tab-content {
    display: none;
    padding: 25px;
    background: #fff;
}

.jit-seo-suite-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===================================
   Tooltips
   =================================== */
.jit-seo-suite-tooltip {
    cursor: help;
    color: #666;
    font-size: 16px;
    margin-left: 5px;
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.jit-seo-suite-tooltip:hover {
    color: #0073aa;
}

.jit-seo-suite-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 10px 15px;
    background: #32373c;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    border-radius: 4px;
    white-space: normal;
    width: 300px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    font-weight: normal;
}

.jit-seo-suite-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: -1px;
    border: 6px solid transparent;
    border-top-color: #32373c;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.jit-seo-suite-tooltip:hover::after,
.jit-seo-suite-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   Fields
   =================================== */
.jit-seo-suite-field {
    margin-bottom: 20px;
}

.jit-seo-suite-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.jit-seo-suite-field input[type="text"],
.jit-seo-suite-field input[type="url"],
.jit-seo-suite-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.jit-seo-suite-field input[type="text"]:focus,
.jit-seo-suite-field input[type="url"]:focus,
.jit-seo-suite-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.jit-seo-suite-field .description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* ─────────────────────────────────────────────────────────────
   Keyphrase & Keywords Side-by-side Layout
   ───────────────────────────────────────────────────────────── */
.jit-seo-suite-keyphrase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.jit-seo-suite-keyphrase-col,
.jit-seo-suite-keywords-col {
    margin-bottom: 0;
}

/* Stack vertically on smaller screens */
@media (max-width: 1200px) {
    .jit-seo-suite-keyphrase-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Google Autocomplete
   =================================== */
.jit-seo-suite-autocomplete-wrapper {
    position: relative;
}

#jit-seo-suite-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.jit-seo-suite-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.jit-seo-suite-suggestion-item:last-child {
    border-bottom: none;
}

.jit-seo-suite-suggestion-item:hover,
.jit-seo-suite-suggestion-item.active {
    background: #f0f6fc;
}

.jit-seo-suite-suggestion-item strong {
    font-weight: 600;
    color: #000;
}

/* ===================================
   LSI / Related Keywords
   =================================== */
/* ── Related Keywords widget ──────────────────────────────── */

/* Manual add row — always visible at top of widget */
.jit-seo-lsi-manual-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

.jit-seo-lsi-manual-row input[type="text"] {
    flex: 1;
    font-size: 12px;
    padding: 5px 8px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    color: #1d2327;
    min-width: 0;
}

.jit-seo-lsi-manual-row input[type="text"]:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

#jit-seo-lsi-manual-add {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

#jit-seo-lsi-manual-add:hover {
    background: #135e96;
}

/* Empty-state hint */
.jit-seo-lsi-hint {
    font-size: 11px;
    color: #a0a0a0;
    font-style: italic;
    margin: 0;
    line-height: 1.5;
}

/* Suggestion chips (click to target) */
.jit-seo-lsi-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 6px;
}

.jit-seo-lsi-chip {
    display: inline-block;
    padding: 2px 9px;
    background: #f0f6fc;
    border: 1px solid #c3c4c7;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
    color: #2271b1;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}

.jit-seo-lsi-chip:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Targeted chips row */
.jit-seo-lsi-targeted-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

/* Each targeted chip: dot + word + × */
.jit-seo-lsi-targeted-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 5px 2px 7px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 10px;
    font-size: 11px;
    color: #1d2327;
}

.jit-lsi-dot {
    display: block;
    flex-shrink: 0;
}

.jit-lsi-chip-text {
    line-height: 1.3;
}

.jit-seo-lsi-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #787c82;
    font-size: 13px;
    line-height: 1;
    padding: 0 1px;
    opacity: 0.6;
    flex-shrink: 0;
}

.jit-seo-lsi-remove:hover {
    opacity: 1;
    color: #d63638;
}

/* ===================================
   Slug Editor
   =================================== */
.jit-seo-slug-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.jit-seo-slug-wrapper:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.jit-seo-slug-base {
    padding: 6px 8px;
    background: #f6f7f7;
    border-right: 1px solid #c3c4c7;
    font-size: 12px;
    color: #787c82;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.jit-seo-slug-input {
    flex: 1;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
    color: #1d2327;
    background: transparent;
    min-width: 0;
}

/* ===================================
   Snippet Preview
   =================================== */
.jit-seo-suite-snippet-preview {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 15px;
    margin-bottom: 20px;
}

.jit-seo-suite-snippet-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.jit-seo-suite-preview-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.jit-seo-suite-preview-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.jit-seo-suite-preview-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.jit-seo-suite-preview-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.jit-seo-suite-snippet {
    background: #fff;
    padding: 15px;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.jit-seo-suite-snippet.mobile {
    max-width: 400px;
}

.jit-seo-suite-snippet-url {
    font-size: 12px;
    color: #006621;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.jit-seo-suite-snippet-url::before {
    content: "▸";
    margin-right: 5px;
    color: #999;
}

.jit-seo-suite-snippet-title {
    font-size: 18px;
    color: #1a0dab;
    font-weight: 400;
    margin-bottom: 5px;
    line-height: 1.3;
    cursor: pointer;
}

.jit-seo-suite-snippet-title:hover {
    text-decoration: underline;
}

.jit-seo-suite-snippet-description {
    font-size: 13px;
    color: #545454;
    line-height: 1.5;
}

/* Yoast-style snippet card */
.jit-seo-snippet-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.jit-seo-snippet-main {
    flex: 1;
    min-width: 0;
}

.jit-seo-snippet-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.jit-seo-snippet-favicon-wrap {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.jit-seo-snippet-favicon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.jit-seo-snippet-favicon-initial {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.jit-seo-snippet-site {
    flex: 1;
    min-width: 0;
}

.jit-seo-snippet-sitename {
    font-size: 13px;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.jit-seo-snippet-breadcrumb {
    font-size: 12px;
    color: #4d5156;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.jit-seo-suite-snippet-title {
    font-size: 18px;
    color: #1a0dab;
    font-weight: 400;
    margin-bottom: 4px;
    line-height: 1.3;
    cursor: pointer;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.jit-seo-snippet-image-wrap {
    flex-shrink: 0;
    width: 92px;
    height: 92px;
    border-radius: 8px;
    overflow: hidden;
    background: #e8eaed;
    align-self: center;
}

.jit-seo-snippet-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===================================
   Character Counts
   =================================== */
.jit-seo-suite-title-length,
.jit-seo-suite-desc-length {
    float: right;
    font-weight: 600;
    font-size: 12px;
}

.jit-seo-suite-count-good {
    color: #7ad03a;
}

.jit-seo-suite-count-warning {
    color: #ffba00;
}

.jit-seo-suite-count-bad {
    color: #dc3232;
}

/* ===================================
   Analysis Section — Reporting UI
   =================================== */
.jit-seo-suite-analysis {
    background: #fff;
    border: 1px solid #e4e2f0;
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 160px 1fr;
    min-height: 220px;
}

/* ── Score header (now left column) ─────────────────── */
.jit-analysis-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: linear-gradient(135deg, #f8f7ff 0%, #eeebff 100%);
    border-right: 1px solid #e4e2f0;
}

.jit-analysis-ring {
    flex-shrink: 0;
    display: block;
}

.jit-analysis-ring circle,
.jit-analysis-ring #jit-seo-ring-arc,
.jit-analysis-ring #jit-read-ring-arc {
    transition: stroke-dashoffset 0.65s cubic-bezier(.4,0,.2,1),
                stroke 0.35s ease;
}

.jit-analysis-ring text {
    transition: fill 0.35s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.jit-analysis-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 8px;
}

.jit-analysis-score-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9490ac;
    line-height: 1.2;
}

.jit-analysis-score-pct {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    color: #c3c4c7;
    transition: color 0.35s ease;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.jit-analysis-score-status {
    font-size: 11px;
    font-weight: 600;
    color: #9490ac;
    transition: color 0.35s ease;
    line-height: 1.3;
}

/* Score state colors */
.jit-analysis-score-pct.jit-score--good,
.jit-analysis-score-status.jit-score--good   { color: #16a34a; }
.jit-analysis-score-pct.jit-score--ok,
.jit-analysis-score-status.jit-score--ok     { color: #d97706; }
.jit-analysis-score-pct.jit-score--bad,
.jit-analysis-score-status.jit-score--bad    { color: #dc2626; }
.jit-analysis-score-pct.jit-score--none,
.jit-analysis-score-status.jit-score--none   { color: #9490ac; }

/* ── Analysis right column (filters + list) ───────────── */
.jit-analysis-checks-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-left: 1px solid #e4e2f0;
}

/* ── Filter tabs ──────────────────────────────────────── */
.jit-checklist-filters {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f0eff8;
    background: #fafafa;
    padding: 0 8px;
    gap: 2px;
    flex-shrink: 0;
}

.jit-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 10px 7px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 500;
    color: #787c82;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.jit-filter-tab:hover {
    color: #1d2327;
}

.jit-filter-count {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    background: #f0f0f1;
    color: #787c82;
    line-height: 1.5;
    transition: background 0.15s, color 0.15s;
}

/* Active state — each tab gets its own accent colour */
.jit-filter-tab[data-filter="all"].active {
    color: #1d2327;
    border-bottom-color: #2271b1;
}
.jit-filter-tab[data-filter="all"].active .jit-filter-count {
    background: #dce9f5;
    color: #2271b1;
}
.jit-filter-tab[data-filter="bad"].active {
    color: #dc2626;
    border-bottom-color: #dc2626;
}
.jit-filter-tab[data-filter="bad"].active .jit-filter-count {
    background: #fef2f2;
    color: #dc2626;
}
.jit-filter-tab[data-filter="warning"].active {
    color: #d97706;
    border-bottom-color: #d97706;
}
.jit-filter-tab[data-filter="warning"].active .jit-filter-count {
    background: #fffbeb;
    color: #d97706;
}
.jit-filter-tab[data-filter="good"].active {
    color: #16a34a;
    border-bottom-color: #16a34a;
}
.jit-filter-tab[data-filter="good"].active .jit-filter-count {
    background: #f0fdf4;
    color: #16a34a;
}

/* ── Checks list ──────────────────────────────────────── */
.jit-seo-suite-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.jit-seo-suite-checks li {
    padding: 4px 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    border-bottom: 1px solid #f3f2f8;
    transition: background 0.12s ease;
}

.jit-seo-suite-checks li:last-child {
    border-bottom: none;
}

.jit-seo-suite-checks li:hover {
    background: #f8f7ff;
}

.jit-seo-suite-checks li > span:not(.jit-check-status):not(.jit-check-dot):not(.jit-seo-suite-check-bullet) {
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: #3c434a;
}

/* Circle status indicator */
.jit-check-status {
    flex-shrink: 0;
    font-size: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 3px;
    display: inline-block;
}

.jit-seo-suite-check-good .jit-check-status {
    background-color: #16a34a;
}

.jit-seo-suite-check-warning .jit-check-status,
.jit-seo-suite-check-info .jit-check-status {
    background-color: #d97706;
}

.jit-seo-suite-check-bad .jit-check-status {
    background-color: #dc2626;
}

/* Legacy bullet — kept for backwards compat but hidden when emoji present */
.jit-seo-suite-check-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-top: 5px;
    flex-shrink: 0;
}
.jit-seo-suite-check-good    .jit-seo-suite-check-bullet { background: #16a34a; }
.jit-seo-suite-check-warning .jit-seo-suite-check-bullet { background: #d97706; }
.jit-seo-suite-check-bad     .jit-seo-suite-check-bullet { background: #dc2626; }
.jit-seo-suite-check-info    .jit-seo-suite-check-bullet { background: #d97706; }
.jit-seo-suite-check-info    { opacity: 0.85; }

#jit-seo-suite-analyze-btn {
    margin-top: 10px;
}

/* ── Legacy score indicator (hidden — replaced by ring) ── */
.jit-seo-suite-score      { display: none; }
.jit-seo-suite-score-indicator { display: none; }

/* ===================================
   Social Tab
   =================================== */
.jit-seo-suite-tab-content h3 {
    margin: 20px 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.jit-seo-suite-tab-content h3:first-child {
    margin-top: 0;
}

/* ===================================
   Advanced Tab
   =================================== */
.jit-seo-suite-tab-content[data-tab="advanced"] label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jit-seo-suite-tab-content[data-tab="advanced"] input[type="checkbox"] {
    margin: 0;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 782px) {
    .jit-seo-suite-tab-buttons {
        flex-wrap: wrap;
    }
    
    .jit-seo-suite-tab-button {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .jit-seo-suite-tab-content {
        padding: 15px;
    }
    
    .jit-seo-suite-snippet-title {
        font-size: 16px;
    }
    
    .jit-seo-suite-snippet-description {
        font-size: 12px;
    }
}

/* ===================================
   WordPress Admin Overrides
   =================================== */
.post-php .jit-seo-suite-metabox,
.post-new-php .jit-seo-suite-metabox {
    margin: 0 -12px -12px;
}

#jit_seo_suite_seo_metabox .inside {
    margin: 0;
    padding: 0;
}

#jit_seo_suite_seo_metabox .postbox-header {
    border-bottom: 1px solid #ddd;
}

/* ===================================
   Accessibility
   =================================== */
.jit-seo-suite-tab-button:focus,
.jit-seo-suite-preview-btn:focus,
#jit-seo-suite-analyze-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.jit-seo-suite-suggestion-item:focus {
    background: #f0f6fc;
    outline: none;
}

/* ===================================
   Loading State
   =================================== */
#jit-seo-suite-analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===================================
   Tooltips
   =================================== */
.jit-seo-suite-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: #666;
    font-size: 16px;
    margin-left: 5px;
    vertical-align: middle;
}

.jit-seo-suite-tooltip:hover {
    color: #0073aa;
}

.jit-seo-suite-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 10px 15px;
    background: #23282d;
    color: #fff;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    white-space: normal;
    width: 300px;
    max-width: 90vw;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 1000;
}

.jit-seo-suite-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #23282d;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.jit-seo-suite-tooltip:hover::after,
.jit-seo-suite-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   Animations
   =================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#jit-seo-suite-suggestions {
    animation: slideDown 0.2s ease;
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .jit-seo-suite-metabox {
        display: none;
    }
}

/* ===================================
   Dark Mode Support (Future)
   =================================== */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* ===================================
   Settings Page — Option A Layout
   =================================== */

/* Pull the page out to full-width inside WP's content area */
.jit-settings-wrap {
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

.jit-settings-layout {
    display: flex;
    align-items: flex-start;
    background: #f0f0f1;
    min-height: 100vh;
    /* no overflow — let WP page scroll normally */
}

/* ── Left Sidebar ─────────────────────────────── */
.jit-settings-nav {
    width: 210px;
    flex-shrink: 0;
    align-self: flex-start;          /* critical for sticky to work in flex */
    position: sticky;
    top: 32px;                        /* just below WP admin bar */
    max-height: calc(100vh - 48px);   /* room below admin bar */
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #dcdcde;
    display: flex;
    flex-direction: column;
}

.jit-settings-nav-logo {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* total height: 14 + 28(SVG) + 14 + 1(border) = 57px */
}

.jit-settings-nav-links {
    flex: 1;
    padding: 8px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.jit-settings-nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #50575e;
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 0;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    line-height: 1.4;
}

.jit-settings-nav-link svg {
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.12s;
}

.jit-settings-nav-link:hover {
    background: #f6f7f7;
    color: #1d2327;
    text-decoration: none;
}

.jit-settings-nav-link:hover svg {
    opacity: 0.8;
}

.jit-settings-nav-link.active {
    background: #f0f6fc;
    color: #2271b1;
    border-left-color: #2271b1;
    font-weight: 600;
}

.jit-settings-nav-link.active svg {
    opacity: 1;
}

.jit-settings-nav-footer {
    padding: 14px 16px;
    border-top: 1px solid #f0f0f1;
    flex-shrink: 0;
}

.jit-settings-save-btn {
    width: 100%;
    justify-content: center;
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
}

/* ── Right Content Area ───────────────────────── */
.jit-settings-body {
    flex: 1;
    min-width: 0;
    padding: 20px 24px 40px;
}

/* ── Cards ────────────────────────────────────── */
.jit-settings-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    scroll-margin-top: 16px;
}

.jit-settings-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f1;
    background: #fafafa;
}

.jit-settings-card-header svg {
    flex-shrink: 0;
    color: #50575e;
}

.jit-settings-card-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    flex: 1;
}

.jit-settings-card-action {
    font-size: 12px;
    font-weight: 500;
    color: #2271b1;
    text-decoration: none;
    margin-left: auto;
    white-space: nowrap;
}

.jit-settings-card-action:hover {
    text-decoration: underline;
}

.jit-settings-card-body {
    padding: 20px;
}

/* ── Form table overrides inside cards ────────── */
.jit-settings-table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 0;
}

.jit-settings-table th,
.jit-settings-table td {
    padding: 10px 12px;
    vertical-align: top;
}

.jit-settings-table th {
    width: 200px;
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    padding-top: 12px;
}

.jit-settings-table tr {
    border-bottom: 1px solid #f6f7f7;
}

.jit-settings-table tr:last-child {
    border-bottom: none;
}

/* ── Sub-headings inside cards ────────────────── */
.jit-settings-sub-heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #787c82;
    margin: 0 0 8px;
    padding: 0;
}

/* ── Variable badge pills ─────────────────────── */
.jit-var-badges-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-bottom: 14px;
}

.jit-var-label {
    font-size: 12px;
    font-weight: 600;
    color: #787c82;
    margin-right: 2px;
}

.jit-var-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    font-weight: 500;
    color: #2271b1;
    background: #eef5fb;
    border: 1px solid #c8dff6;
    border-radius: 4px;
    padding: 2px 7px;
    line-height: 1.6;
    white-space: nowrap;
}

/* ── Slug hints ───────────────────────────────── */
.jit-slug-hint {
    display: block;
    font-weight: 400;
    font-size: 11px;
    color: #a7aaad;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    margin-top: 1px;
}

/* ── Checkbox groups ──────────────────────────── */
.jit-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
}

.jit-checkbox-label {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
}

.jit-checkbox-label input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    position: relative;
    top: 1px;
}

/* ── Toggle labels (Advanced noindex) ─────────── */
.jit-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
}

/* ── Robots.txt viewer ────────────────────────── */
.jit-robots-viewer {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
    font-size: 12px !important;
    background: #f6f7f7 !important;
    resize: vertical;
    color: #2c3338;
}

/* ── Tools row ────────────────────────────────── */
.jit-tools-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.jit-tools-row .button svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    position: relative;
    top: -1px;
}

.jit-import-label {
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
}

/* ── Notice position fix ──────────────────────── */
.jit-settings-wrap .notice {
    margin: 10px 24px 0;
}

/* ── Responsive: collapse sidebar on narrow screens ── */
@media (max-width: 960px) {
    .jit-settings-layout {
        flex-direction: column;
    }
    .jit-settings-nav {
        width: 100%;
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #dcdcde;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .jit-settings-nav-logo {
        border-bottom: 1px solid #f0f0f1;
        border-right: none;
        width: 100%;
        box-sizing: border-box;
    }
    .jit-settings-nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 6px 8px;
        gap: 0;
        flex: none;
        width: 100%;
    }
    .jit-settings-nav-link {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 8px 12px;
    }
    .jit-settings-nav-link.active {
        border-left-color: transparent;
        border-bottom-color: #2271b1;
    }
    .jit-settings-nav-footer {
        padding: 10px 16px;
        width: 100%;
        box-sizing: border-box;
    }
    .jit-settings-save-btn {
        width: auto;
    }
    .jit-settings-body {
        padding: 16px 16px 40px;
    }
}
