/**
 * AdWorksBid SEO — Arabic RTL overrides
 *
 * WordPress automatically enqueues the -rtl variant of a registered stylesheet
 * when the site language is RTL (e.g. Arabic, Hebrew, Farsi).
 * This file mirrors admin.css with directions flipped.
 *
 * Naming convention: WordPress looks for {handle}-rtl.css.
 * Our handle is "awbseo-admin", so this file must be admin-rtl.css
 * in the same directory as admin.css, and registered via:
 *   wp_style_add_data( 'awbseo-admin', 'rtl', 'replace' );
 *
 * @package AWBSEO
 * @since   1.1.0
 */

/* ── Cairo font — applied globally on RTL sites ─────────────────────────────── */

body.rtl #wpbody,
body.rtl #wpcontent,
body.rtl #adminmenu,
body.rtl .awb-seo-wrap,
body.rtl .awb-seo-wrap *,
body.rtl .awb-meta-box,
body.rtl .awb-meta-box * {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Restore monospace for code elements */
body.rtl .awb-seo-wrap code,
body.rtl .awb-seo-wrap pre,
body.rtl .awb-share-url,
body.rtl .awb-license-key-field {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace !important;
}

/* Robots.txt editor stays LTR monospace */
body.rtl .awb-robots-editor {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace !important;
}

/* ── Global direction ──────────────────────────────────────────────────────── */

body.rtl .awb-wrap,
body.rtl .awb-page {
    direction: rtl;
    text-align: right;
}

/* ── Admin sidebar menu ────────────────────────────────────────────────────── */

body.rtl #adminmenu .wp-menu-name {
    padding-right: 10px;
    padding-left: 0;
}

/* ── Page header ───────────────────────────────────────────────────────────── */

body.rtl .awb-page-header {
    flex-direction: row-reverse;
}

body.rtl .awb-page-header h1 {
    text-align: right;
}

body.rtl .awb-page-header .awb-header-actions {
    margin-right: auto;
    margin-left: 0;
}

/* ── Dashboard KPI strip ───────────────────────────────────────────────────── */

body.rtl .awb-kpi-strip {
    direction: rtl;
}

body.rtl .awb-kpi-card {
    text-align: right;
}

body.rtl .awb-kpi-card .awb-kpi-change {
    margin-right: 4px;
    margin-left: 0;
}

/* ── Tabs ──────────────────────────────────────────────────────────────────── */

body.rtl .awb-tabs {
    direction: rtl;
}

body.rtl .awb-tab {
    border-radius: 4px 4px 0 0;
}

/* ── Form layout ───────────────────────────────────────────────────────────── */

body.rtl .awb-form-row,
body.rtl .awb-settings-row {
    direction: rtl;
}

body.rtl .awb-form-row label,
body.rtl .awb-settings-row label {
    text-align: right;
}

body.rtl .awb-form-row input[type="text"],
body.rtl .awb-form-row input[type="url"],
body.rtl .awb-form-row input[type="email"],
body.rtl .awb-form-row textarea,
body.rtl .awb-settings-row input[type="text"],
body.rtl .awb-settings-row textarea {
    direction: rtl;
    text-align: right;
}

body.rtl .awb-form-row .awb-input-group {
    flex-direction: row-reverse;
}

body.rtl .awb-form-row .description,
body.rtl .awb-settings-row .description {
    text-align: right;
}

/* ── Buttons & actions ─────────────────────────────────────────────────────── */

body.rtl .awb-actions {
    flex-direction: row-reverse;
}

body.rtl .awb-btn + .awb-btn {
    margin-right: 8px;
    margin-left: 0;
}

/* ── Meta box ──────────────────────────────────────────────────────────────── */

body.rtl #awb-seo-metabox {
    direction: rtl;
}

body.rtl .awb-metabox-tabs {
    direction: rtl;
}

body.rtl .awb-metabox-tab {
    border-right: 3px solid transparent;
    border-left: none;
}

body.rtl .awb-metabox-tab.active,
body.rtl .awb-metabox-tab:hover {
    border-right-color: #b04a2f;
    border-left: none;
}

body.rtl .awb-metabox-content {
    padding-right: 16px;
    padding-left: 0;
}

body.rtl .awb-field-row {
    flex-direction: row-reverse;
}

body.rtl .awb-field-row label {
    text-align: right;
    padding-right: 0;
    padding-left: 12px;
}

body.rtl .awb-char-count {
    text-align: left;
}

body.rtl .awb-score-label-wrap {
    text-align: right;
}

/* ── Analysis tab checks ───────────────────────────────────────────────────── */

body.rtl .awb-check-item {
    flex-direction: row-reverse;
}

body.rtl .awb-check-icon {
    margin-right: 0;
    margin-left: 8px;
}

body.rtl .awb-check-text {
    text-align: right;
}

/* ── On-page score circle in post list ─────────────────────────────────────── */

body.rtl .awb-col-wrap {
    flex-direction: row-reverse;
}

body.rtl .awb-col-meta {
    text-align: right;
    padding-right: 6px;
    padding-left: 0;
}

body.rtl .awb-col-pills {
    justify-content: flex-end;
}

/* ── Bulk editor table ─────────────────────────────────────────────────────── */

body.rtl .awb-bulk-table th,
body.rtl .awb-bulk-table td {
    text-align: right;
}

body.rtl .awb-bulk-table input[type="text"],
body.rtl .awb-bulk-table textarea {
    direction: rtl;
    text-align: right;
}

/* ── Rank tracker ──────────────────────────────────────────────────────────── */

body.rtl .awb-rank-table th,
body.rtl .awb-rank-table td {
    text-align: right;
}

body.rtl .awb-rank-add-row {
    flex-direction: row-reverse;
}

body.rtl .awb-rank-add-row input {
    direction: rtl;
    text-align: right;
}

/* ── Sitemap table ─────────────────────────────────────────────────────────── */

body.rtl .awb-sitemap-table th,
body.rtl .awb-sitemap-table td {
    text-align: right;
}

body.rtl .awb-sitemap-status {
    margin-right: 0;
    margin-left: 6px;
}

/* ── Local SEO ─────────────────────────────────────────────────────────────── */

body.rtl .awb-location-card {
    text-align: right;
}

body.rtl .awb-location-card .awb-location-actions {
    flex-direction: row-reverse;
}

body.rtl .awb-location-hours td {
    text-align: right;
}

/* ── Schema manager ────────────────────────────────────────────────────────── */

body.rtl .awb-schema-type-list {
    direction: rtl;
}

body.rtl .awb-schema-field-row label {
    text-align: right;
}

/* ── Redirects table ───────────────────────────────────────────────────────── */

body.rtl .awb-redirects-table th,
body.rtl .awb-redirects-table td {
    text-align: right;
}

body.rtl .awb-redirect-arrow {
    transform: scaleX(-1);
}

/* ── Broken links table ────────────────────────────────────────────────────── */

body.rtl .awb-broken-links-table th,
body.rtl .awb-broken-links-table td {
    text-align: right;
}

/* ── Settings page ─────────────────────────────────────────────────────────── */

body.rtl .awb-settings-section {
    direction: rtl;
    text-align: right;
}

body.rtl .awb-settings-section h2,
body.rtl .awb-settings-section h3 {
    text-align: right;
}

body.rtl .awb-connect-status {
    flex-direction: row-reverse;
}

body.rtl .awb-connect-status .dashicons {
    margin-right: 0;
    margin-left: 6px;
}

/* ── Instant indexing ──────────────────────────────────────────────────────── */

body.rtl .awb-indexing-log th,
body.rtl .awb-indexing-log td {
    text-align: right;
}

/* ── Robots.txt editor ─────────────────────────────────────────────────────── */

body.rtl .awb-robots-editor {
    direction: ltr; /* code editors stay LTR */
    text-align: left;
}

body.rtl .awb-robots-actions {
    flex-direction: row-reverse;
}

/* ── Setup wizard ──────────────────────────────────────────────────────────── */

body.rtl .awb-wizard-step {
    direction: rtl;
    text-align: right;
}

body.rtl .awb-wizard-step .awb-wizard-nav {
    flex-direction: row-reverse;
}

body.rtl .awb-wizard-step input,
body.rtl .awb-wizard-step textarea,
body.rtl .awb-wizard-step select {
    direction: rtl;
    text-align: right;
}

/* ── Notices ───────────────────────────────────────────────────────────────── */

body.rtl .awb-notice {
    padding-right: 16px;
    padding-left: 0;
    border-right: 4px solid;
    border-left: none;
}

body.rtl .awb-notice-icon {
    margin-right: 0;
    margin-left: 8px;
}

/* ── Pro upsell banner ─────────────────────────────────────────────────────── */

body.rtl .awb-pro-banner {
    direction: rtl;
    text-align: right;
}

body.rtl .awb-pro-banner .awb-pro-actions {
    flex-direction: row-reverse;
}

/* ── WP native admin table overrides ──────────────────────────────────────── */

body.rtl .wp-list-table .column-awb_seo_score {
    text-align: right;
}

/* ── Health section RTL ───────────────────────────────────────────────────── */

/* Score sits on the left in RTL (start of the header) */
body.rtl .awb-health-section__header {
    flex-direction: row-reverse;
}

/* Health check rows: flip column order for RTL */
body.rtl .awb-hc-row {
    direction: rtl;
    grid-template-columns: 56px 80px 80px 1fr 26px;
}
body.rtl .awb-hc-count,
body.rtl .awb-hc-fix { text-align: left; }
body.rtl .awb-hc-label { text-align: right; }

/* Date picker right-to-left */
body.rtl .awb-date-picker { flex-direction: row-reverse; }
body.rtl .awb-date-picker__custom { flex-direction: row-reverse; }

/* KPI strip */
body.rtl .awb-kpi-card { text-align: right; }
body.rtl .awb-kpi-card__change { flex-direction: row-reverse; }

/* Chart legend */
body.rtl .awb-chart-legend { flex-direction: row-reverse; }
body.rtl .awb-legend-dot { margin-right: 0; margin-left: 5px; }

/* Analytics tables */
body.rtl .awb-analytics-table th,
body.rtl .awb-analytics-table td { text-align: right; }

/* See-all link on the right becomes left in RTL */
body.rtl .awb-see-all { margin-left: 0; margin-right: 8px; }
