/* ==========================================================================
   WSM Ahrefs Overview Table — Dark theme
   Palette:
     #2a2a2a  main bg / table row bg
     #3a3a3a  filter bar, header row, alternate rows
     #3e3e3e  borders, hover
     #ffffff26 subtle overlay border
     #ffffffb3 muted labels
     #ffffff   primary text
     #c2ff01   accent (links, prices, niche badge, header separator)
     #888888   subdued text (subtitles, timestamps)
   ========================================================================== */

.wsm-ahrefs-overview-wrapper {
    width: 100%;
    /* Force horizontal scroll always visible, !important to beat WoodMart's
       global overflow rules. overflow: hidden was here before to clip
       border-radius but it was also killing the x-scroll — replaced with
       explicit x/y declarations so both goals are met. */
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch; /* smooth inertia scrolling on iOS */
    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #c2ff01 #3a3a3a;
    margin: 20px 0;
    background: #2a2a2a;
    border: 1px solid #3e3e3e;
    border-radius: 10px;
}

/* WebKit/Blink scrollbar — more specific than any theme wildcard rule
   (e.g. * { display:none } or ::-webkit-scrollbar { height:0 }) so this wins
   without needing !important on pseudo-element selectors. */
.wsm-ahrefs-overview-wrapper::-webkit-scrollbar {
    display: block;
    height: 6px;
}

.wsm-ahrefs-overview-wrapper::-webkit-scrollbar-track {
    background: #3a3a3a;
    border-radius: 0 0 10px 10px;
}

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

.wsm-ahrefs-overview-wrapper::-webkit-scrollbar-thumb:hover {
    background: #d4ff33;
}

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

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

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

/* ==========================================================================
   Filter bar
   ========================================================================== */

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

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

.wsm-ahrefs-ov-filter-label {
    font-size: 12.5px;
    font-weight: 500;
    color: #ffffffb3;
    white-space: nowrap;
}

/* Native <select> — width/display overrides fight WoodMart's global
   select { width:100% } rule. Dark bg + white text on all three controls. */
.wsm-ahrefs-ov-filter-bar select {
    display: inline-block !important;
    width: auto !important;
    max-width: 210px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    font-size: 12.5px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border: 1px solid #3e3e3e !important;
    border-radius: 4px !important;
    cursor: pointer;
    outline: none !important;
}

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

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

/* Override theme's global table { margin-bottom: 35px } which adds
   unwanted space below our table inside the card container. */
.wsm-ahrefs-overview-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 880px;
    font-size: 14px;
    margin-bottom: 0 !important;
}

/* Header row — slightly lighter bg, acid-green bottom separator */
.wsm-ahrefs-ov-th {
    padding: 12px 14px;
    background: #3a3a3a;
    border-bottom: 2px solid #c2ff01;
    font-size: 11.5px;
    font-weight: 600;
    color: #ffffffb3;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Body rows */
.wsm-ahrefs-overview-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #3e3e3e;
    vertical-align: middle;
    color: #ffffff;
}

/* Alternate row tint */
.wsm-ahrefs-ov-row:nth-child(even) {
    background: #3a3a3a;
}

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

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

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

/* display: flex on a <td> causes sub-pixel border misalignment in some
   browsers because flex containers break the normal table cell rendering.
   Using display: block on the inner elements instead stacks them the same
   way visually, without touching the cell's own table layout. */
.wsm-ahrefs-ov-col-website {
    min-width: 180px;
    vertical-align: middle;
}

.wsm-ahrefs-ov-domain {
    display: block;
    font-weight: 600;
    color: #c2ff01;
    text-decoration: none;
}

.wsm-ahrefs-ov-domain:hover {
    text-decoration: underline;
    color: #c2ff01;
}

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

/* Stat value cells */
.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: #ffffff;
}

/* Niche badge — acid green tint on dark */
.wsm-ahrefs-ov-col-niche {
    white-space: nowrap;
}

.wsm-ahrefs-ov-niche-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgb(253 255 248 / 12%);
    color: #fff;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1;
}

/* Price — accent green to make it pop as the CTA number */
.wsm-ahrefs-ov-col-price {
    white-space: nowrap;
    font-weight: 700;
    color: #c2ff01;
}

/* Ensure WooCommerce sale price markup also stays green */
.wsm-ahrefs-ov-col-price del,
.wsm-ahrefs-ov-col-price ins {
    color: #c2ff01;
}

.wsm-ahrefs-ov-col-price del {
    opacity: 0.5;
    text-decoration: line-through;
}

.wsm-ahrefs-ov-col-price ins {
    text-decoration: none;
}

.wsm-ahrefs-ov-col-action {
    text-align: right;
    white-space: nowrap;
}

/* The Add to Cart button uses WoodMart's own classes so the theme
   CSS handles all button styling — nothing overridden here. */

/* ==========================================================================
   Pagination — server-rendered inside the same partial as the table so
   it always reflects the current filtered state.
   ========================================================================== */

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

.wsm-ahrefs-ov-page-btn {
    display: inline-block;
    min-width: 34px;
    padding: 7px 12px;
    background: #3a3a3a;
    color: #ffffffb3;
    border: 1px solid #3e3e3e;
    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: #3e3e3e;
    color: #ffffff;
}

.wsm-ahrefs-ov-page-btn.is-current {
    background: #c2ff01;
    color: #2a2a2a;
    border-color: #c2ff01;
    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: 12px;
        padding: 12px 14px;
    }

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