/* ==========================================================================
   WSM Ahrefs Overview Table — Astra/Elementor edition (light neutral theme)
   Palette:
     #ffffff  card / row background
     #f7f8fa  filter bar, header row, alternate rows
     #e8eaed  borders
     #0170b9  accent (links, active states) — Astra's default accent blue
     #1a1a1a  primary text
     #5f6368  muted labels
     #9aa0a6  subdued text (subtitles)
   ========================================================================== */

.wsm-ahrefs-overview-wrapper {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #0170b9 #f7f8fa;
    margin: 20px 0;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
}

.wsm-ahrefs-overview-wrapper::-webkit-scrollbar {
    display: block;
    height: 6px;
}

.wsm-ahrefs-overview-wrapper::-webkit-scrollbar-track {
    background: #f7f8fa;
    border-radius: 0 0 8px 8px;
}

.wsm-ahrefs-overview-wrapper::-webkit-scrollbar-thumb {
    background: #0170b9;
    border-radius: 3px;
}

.wsm-ahrefs-overview-empty {
    padding: 20px;
    color: #9aa0a6;
    font-style: italic;
}

.wsm-ahrefs-ov-results {
    transition: opacity 0.15s ease;
}

.wsm-ahrefs-ov-results.wsm-ahrefs-ov-loading {
    opacity: 0.45;
    pointer-events: none;
}

/* ==========================================================================
   Filter bar: Niche | Country | Extension | Price | Sort
   ========================================================================== */

.wsm-ahrefs-ov-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: #f7f8fa;
    border-bottom: 1px solid #e8eaed;
}

.wsm-ahrefs-ov-filter-group {
    display: flex;
    align-items: center;
    gap: 7px;
}

.wsm-ahrefs-ov-filter-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #5f6368;
    white-space: nowrap;
    margin: 0;
}

/* Native <select> — width/display overrides fight themes' (and
   Elementor's) global select { width:100% } rules. */
.wsm-ahrefs-ov-filter-bar select {
    display: inline-block !important;
    width: auto !important;
    max-width: 180px !important;
    min-width: 0 !important;
    margin: 0 !important;
    /* Extra right padding reserves room for the chevron so it never
       overlaps the option text. Paired with a custom background arrow
       below (native arrow removed via appearance:none). */
    padding: 6px 30px 6px 10px !important;
    font-size: 12.5px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    border: 1px solid #d5d8dc !important;
    border-radius: 4px !important;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    height: auto !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%235f6368%22%20d%3D%22M6%208.5L1.5%204h9z%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 10px 10px !important;
}

.wsm-ahrefs-ov-filter-bar select:focus {
    border-color: #0170b9 !important;
}

/* Export CSV button — pushed to the far right of the filter bar. */
.wsm-ahrefs-ov-export-group {
    margin-left: auto;
}

.wsm-ahrefs-ov-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    line-height: 1.4 !important;
    color: #ffffff !important;
    background-color: #0170b9 !important;
    border: 1px solid #0170b9 !important;
    border-radius: 4px !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: background-color 0.12s ease, opacity 0.12s ease;
    white-space: nowrap;
}

.wsm-ahrefs-ov-export-btn:hover:not(:disabled) {
    background-color: #015a94 !important;
    border-color: #015a94 !important;
}

.wsm-ahrefs-ov-export-btn:disabled,
.wsm-ahrefs-ov-export-btn.is-exporting {
    opacity: 0.6;
    cursor: default;
}

.wsm-ahrefs-ov-export-icon {
    font-size: 14px;
    line-height: 1;
}

/* Price column. */
.wsm-ahrefs-overview-table td.wsm-ahrefs-ov-col-price {
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
}

.wsm-ahrefs-ov-col-price .amount,
.wsm-ahrefs-ov-col-price bdi {
    white-space: nowrap;
}

/* ==========================================================================
   Table structure
   ========================================================================== */

.wsm-ahrefs-overview-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
    font-size: 14px;
    margin-bottom: 0 !important;
    border: none !important;
}

.wsm-ahrefs-ov-th {
    padding: 12px 14px;
    background: #f7f8fa;
    border: none !important;
    border-bottom: 2px solid #0170b9 !important;
    font-size: 11.5px;
    font-weight: 600;
    color: #5f6368;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    vertical-align: middle;
}

.wsm-ahrefs-overview-table tbody td {
    padding: 12px 14px;
    border: none !important;
    border-bottom: 1px solid #e8eaed !important;
    vertical-align: middle;
    color: #1a1a1a;
    background: transparent;
}

.wsm-ahrefs-ov-row:nth-child(even) {
    background: #f7f8fa;
}

.wsm-ahrefs-ov-row:hover {
    background: #eef3f8;
}

.wsm-ahrefs-ov-row:last-child td {
    border-bottom: none !important;
}

/* ==========================================================================
   Cell content
   ========================================================================== */

.wsm-ahrefs-ov-col-website {
    min-width: 180px;
    vertical-align: middle;
}

.wsm-ahrefs-ov-domain {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
}

.wsm-ahrefs-ov-title {
    display: block;
    font-size: 12px;
    color: #9aa0a6;
    margin-top: 2px;
}

.wsm-ahrefs-overview-table td.wsm-ahrefs-ov-col-domain_rating,
.wsm-ahrefs-overview-table td.wsm-ahrefs-ov-col-organic_traffic,
.wsm-ahrefs-overview-table td.wsm-ahrefs-ov-col-backlinks,
.wsm-ahrefs-overview-table td.wsm-ahrefs-ov-col-referring_domains,
.wsm-ahrefs-overview-table td.wsm-ahrefs-ov-col-organic_keywords {
    font-weight: 600;
    color: #1a1a1a;
}

.wsm-ahrefs-ov-col-niche {
    white-space: nowrap;
}

.wsm-ahrefs-ov-niche-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #eaf2fb;
    color: #0b5c96;
    border: 1px solid #d0e3f5;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1;
}

.wsm-ahrefs-ov-col-country {
    white-space: nowrap;
    color: #5f6368;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.wsm-ahrefs-ov-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-top: 1px solid #e8eaed;
    background: #ffffff;
}

.wsm-ahrefs-ov-page-btn {
    display: inline-block;
    min-width: 34px;
    padding: 7px 12px;
    background: #f7f8fa;
    color: #5f6368;
    border: 1px solid #e8eaed;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.wsm-ahrefs-ov-page-btn:hover:not(:disabled) {
    background: #eef3f8;
    color: #1a1a1a;
}

.wsm-ahrefs-ov-page-btn.is-current {
    background: #0170b9;
    color: #ffffff;
    border-color: #0170b9;
    cursor: default;
}

.wsm-ahrefs-ov-page-btn:disabled:not(.is-current) {
    opacity: 0.4;
    cursor: default;
}

@media (max-width: 600px) {
    .wsm-ahrefs-overview-table {
        font-size: 13px;
    }

    .wsm-ahrefs-ov-th,
    .wsm-ahrefs-overview-table tbody td {
        padding: 9px 10px;
    }

    .wsm-ahrefs-ov-filter-bar {
        gap: 10px;
        padding: 12px 14px;
    }

    .wsm-ahrefs-ov-filter-bar select {
        max-width: 140px !important;
        font-size: 12px !important;
    }
}
