/**
 * Bots Tracker - Admin Styles
 *
 * هذا الملف مخصص لأي تنسيقات (CSS) إضافية لصفحات لوحة التحكم الخاصة بالإضافة.
 * حالياً يحتوي على بعض التنسيقات الخفيفة ويمكنك التعديل عليه كما تريد.
 */

/* حاوية عامة لصفحات Bots Tracker */
.bt-bots-tracker-wrap {
    max-width: none;
    width: calc(100% - 20px);
    margin-right: 20px;
}

/* عنوان رئيسي */
.bt-bots-tracker-wrap h1 {
    margin-bottom: 15px;
    font-size: 2em;
    font-weight: 600;
}

/* جدول مخصص */
.bt-bots-table {
    width: 100%;
    border-collapse: collapse;
}

.bt-bots-table th,
.bt-bots-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e4e7;
    vertical-align: middle;
}

.bt-bots-table th {
    background: #f1f1f1;
    font-weight: 600;
}

/* نص صغير تحت العناوين */
.bt-bots-subtext {
    color: #666;
    font-size: 13px;
}

/* ============================================================
   ======      تنسيق رأس الأعمدة + المثلثات (Sorting)     ======
   ============================================================ */

.bt-bots-table th.manage-column {
    white-space: nowrap;
}

.bt-bots-table th.manage-column a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none;
    color: #2271b1;
}

.bt-bots-table th.manage-column a:hover {
    color: #135e96;
}

.bt-bots-table th.manage-column a span {
    display: inline-block;
    white-space: nowrap;
}

.bt-bots-table th.manage-column .sorting-indicator {
    position: relative;
    display: inline-block;
    width: 10px;
    height: 14px;
    margin-left: 4px;
}

.bt-bots-table th.manage-column .sorting-indicator:before,
.bt-bots-table th.manage-column .sorting-indicator:after {
    content: "";
    position: absolute;
    left: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.bt-bots-table th.manage-column .sorting-indicator:before {
    top: 0;
    border-bottom: 6px solid #b4b9be;
}

.bt-bots-table th.manage-column .sorting-indicator:after {
    bottom: 0;
    border-top: 6px solid #b4b9be;
}

.bt-bots-table th.manage-column.sortable:not(.sorted) .sorting-indicator:before,
.bt-bots-table th.manage-column.sortable:not(.sorted) .sorting-indicator:after {
    border-bottom-color: #b4b9be;
    border-top-color:    #b4b9be;
}

.bt-bots-table th.manage-column.sorted.asc .sorting-indicator:before {
    border-bottom-color: #000000;
}
.bt-bots-table th.manage-column.sorted.asc .sorting-indicator:after {
    border-top-color: #b4b9be;
}

.bt-bots-table th.manage-column.sorted.desc .sorting-indicator:after {
    border-top-color: #000000;
}
.bt-bots-table th.manage-column.sorted.desc .sorting-indicator:before {
    border-bottom-color: #b4b9be;
}

/* =====================
   دعم RTL لرأس الجدول
   ===================== */

body.rtl .bt-bots-table th.manage-column {
    text-align: right !important;
}

body.rtl .bt-bots-table th.manage-column a {
    justify-content: flex-end !important;
}

body.rtl .bt-bots-table th.manage-column .sorting-indicator {
    margin-left: 4px;
    margin-right: 0;
}

/* ============================
 * Database Optimization UI
 * ============================ */

.bt-bots-db-optimization {
    margin-top: 30px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.bt-bots-db-optimization h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.bt-bots-db-stats {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.bt-bots-db-stats ul {
    margin: 0;
    padding-left: 18px;
}

/* صندوق عام */
.bt-bots-db-box {
    margin-top: 20px;
    padding: 15px 15px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
}

.bt-bots-db-box h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.bt-bots-db-box-danger {
    border-color: #dc3232;
    background: #fff5f5;
}

.bt-bots-button-danger {
    border-color: #dc3232;
    color: #ffffff;
    background: #dc3232;
}

.bt-bots-button-danger:hover,
.bt-bots-button-danger:focus {
    background: #b82020;
    border-color: #b82020;
}

/* دعم RTL للقائمة داخل الإحصائيات */
body.rtl .bt-bots-db-stats ul {
    padding-left: 0;
    padding-right: 18px;
}

/* ============================
   Database Optimization Layout
   ============================ */

/* صف علوي يحتوي الإحصائيات + زر الحذف جنب بعض */
.bt-bots-db-top-row {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    justify-content: space-between;
}

/* صندوق حالة الجدول */
.bt-bots-db-stats {
    flex: 1;
    min-width: 300px;
}

/* صندوق حذف السجلات القديمة أو أي كارت آخر */
.bt-bots-db-box {
    flex: 1;
    min-width: 300px;
}

/* دعم RTL – يجعل Delete على اليمين */
body.rtl .bt-bots-db-top-row {
    flex-direction: row-reverse;
}

/* ============================
   Bot Filter – Multiselect UI
   ============================ */

.bt-bots-multiselect-wrapper {
    position: relative;
    max-width: 260px;
}

.bt-bots-multiselect-select-hidden {
    display: none;
}

.bt-bots-multiselect-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding-right: 8px;
}

.bt-bots-multiselect-toggle::after {
    content: "▾";
    font-size: 11px;
    opacity: 0.7;
    margin-left: 6px;
}

.bt-bots-multiselect-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
    max-height: 220px;
    overflow: auto;
    z-index: 9999;
    display: none;
}

.bt-bots-multiselect-menu.is-open {
    display: block;
}

.bt-bots-multiselect-menu ul {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.bt-bots-multiselect-menu li {
    margin: 0;
    padding: 0;
}

.bt-bots-multiselect-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    cursor: pointer;
}

.bt-bots-multiselect-item:hover {
    background: #f0f0f1;
}

.bt-bots-multiselect-item input[type="checkbox"] {
    margin: 0;
}

/* ============================================================
   Page Main (Bot visits) - Replace inline styles
   ============================================================ */

/* بدل: style="margin-top:15px;" على nav tabs */
.bt-bots-nav-tabs {
    margin-top: 15px;
}

/* بدل: form style="margin-bottom:20px;" */
.bt-bots-filter-form {
    margin-bottom: 20px;
}

/* بدل: select style="min-width:250px;" */
.bt-bots-bot-select {
    min-width: 250px;
}

/* بدل: div custom dates style="margin-top:8px; display:none;" */
.bt-main-custom-dates {
    margin-top: 8px;
    display: none;
}

/* بدل: input url style="min-width:350px; direction:ltr;" */
.bt-bots-url-input {
    min-width: 350px;
    direction: ltr;
}

/* بدل: table style="margin-top:10px; width:100%;" */
.bt-bots-table-main {
    margin-top: 10px;
    width: 100%;
}

/* بدل style داخل رابط URL */
.bt-bots-url-link {
    direction: ltr;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* بدل: tablenav style="margin-top:15px;" */
.bt-bots-tablenav {
    margin-top: 15px;
}


/* ============================
   Common helpers
   ============================ */
.bt-is-hidden {
    display: none !important;
}

/* ============================
   Crawl budget: forms layout
   ============================ */
.bt-bots-crawl-forms-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
}

.bt-bots-filters-form,
.bt-bots-export-form {
    box-sizing: border-box;
}

.bt-bots-filters-form {
    flex: 1 1 auto;
    min-width: 520px;
}

.bt-bots-export-form {
    flex: 0 0 360px;
    max-width: 420px;
}

@media (max-width: 1200px) {
    .bt-bots-crawl-forms-row {
        display: block;
    }
    .bt-bots-filters-form,
    .bt-bots-export-form {
        width: 100%;
        max-width: none;
        min-width: 0;
    }
}

/* Inputs / selects on crawl page */
.bt-custom-dates,
.bt-export-custom-dates,
.bt-per-page-custom-wrap {
    margin-top: 10px;
}

.bt-per-page-custom-input {
    width: 120px;
}

.bt-export-fieldset {
    margin-bottom: 10px;
}

.bt-export-legend {
    font-weight: 600;
    margin-bottom: 5px;
}

.bt-export-radio {
    display: block;
    margin-bottom: 4px;
}

.bt-export-bot-select {
    min-width: 220px;
}

.bt-bots-actions {
    margin-top: 10px;
}

/* ============================
   Crawl budget: summary grid
   (moved from inline <style>)
   ============================ */
.bt-bots-summary-grid {
    margin-top: 15px;
    margin-bottom: 15px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    text-align: center;
}

.bt-bots-summary-card {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 12px 10px;
    box-sizing: border-box;
}

.bt-bots-summary-label {
    font-size: 15px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

.bt-bots-summary-value {
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

@media (max-width: 960px) {
    .bt-bots-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .bt-bots-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Notice spacing (removed inline style) */
.bt-bots-notice-space {
    margin-top: 15px;
}

/* URL ellipsis links */
.bt-bots-url-link {
    direction: ltr;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

