/* ══════════════════════════════════════════════════════════════
   Shared DataTable Styling — blockspot.io
   All DataTable card components use these classes.
   Scoped under .bs-dt root class.
   ══════════════════════════════════════════════════════════════ */

/* ── Card Container ── */
.bs-dt {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e4e7ed;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
}

.bs-dt * { box-sizing: border-box; }

/* ── Card Header ── */
.bs-dt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 28px 20px;
}

.bs-dt-title {
    font-size: 20px;
    font-weight: 700;
    color: #111318;
    letter-spacing: -0.3px;
    line-height: 1.3;
    margin: 0 !important;
    padding: 0 !important;
}

.bs-dt-subtitle {
    font-size: 13px;
    color: #333;
    font-weight: 400;
    margin-top: 4px;
    max-width: 680px;
}

.bs-dt-viewall {
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: color 0.2s;
    flex-shrink: 0;
}

.bs-dt-viewall:hover { color: #2563eb; }

/* ── Description Block ── */
.bs-dt-description-body {
    padding: 0 28px 28px;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}

.bs-dt-description-body p {
    margin: 0 0 16px;
}

.bs-dt-description-body p:last-child {
    margin-bottom: 0;
}

.bs-dt-viewall svg {
    width: 14px;
    height: 14px;
}

/* ── Custom Toolbar ── */
.bs-dt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px 16px;
    gap: 12px;
}

.bs-dt-toolbar label {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.bs-dt-toolbar select {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 13px;
    padding: 6px 28px 6px 10px;
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    outline: none;
    background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 8px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    color: #111318;
}

.bs-dt-toolbar select:focus {
    border-color: #3b82f6;
}

.bs-dt .bs-dt-clear-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 16px;
    border: 1.5px solid #e4e7ed;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.bs-dt .bs-dt-clear-btn:hover {
    background: #111318;
    color: #fff;
    border-color: #111318;
}

/* ── Table Base ── */
.bs-dt-table {
    width: 100% !important;
    border-collapse: collapse;
    border-spacing: 0;
    background: transparent;
    border: none !important;
    border-radius: 0;
    box-shadow: none;
}

/* Column headers */
.bs-dt-table thead th {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 20px 14px;
    text-align: right;
    border-bottom: 1px solid #eef0f4 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent;
    cursor: default;
}

.bs-dt-table thead th:first-child {
    padding-left: 28px;
}

.bs-dt-table thead th:last-child {
    padding-right: 28px;
}

/* Alignment utilities — apply to th and td */
.bs-col-left { text-align: left !important; }
.bs-col-right { text-align: right !important; }
.bs-col-center { text-align: center !important; }

/* Rows */
.bs-dt-table tbody tr {
    transition: background 0.15s;
    cursor: pointer;
    height: auto;
}

.bs-dt-table tbody tr:hover {
    background: #f8f9fb;
}

.bs-dt-table tbody td {
    padding: 11px 20px;
    font-size: 14px;
    text-align: right;
    border-bottom: 1px solid #f3f4f6 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
    background: transparent !important;
}

.bs-dt-table tbody tr:last-child td {
    border-bottom: none !important;
}

.bs-dt-table tbody td:first-child {
    padding-left: 28px;
}

.bs-dt-table tbody td:last-child {
    padding-right: 28px;
}

/* Remove odd row striping from DataTables defaults */
.bs-dt-table tbody tr:nth-child(odd) td {
    background: transparent !important;
}

/* ── Column Filters ── */
.bs-dt-table thead tr.bs-filter-row th {
    padding: 8px 16px 14px;
    border-bottom: 1px solid #eef0f4 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent;
}

.bs-dt-table thead tr.bs-filter-row th:first-child {
    padding-left: 28px;
}

.bs-dt-table thead tr.bs-filter-row th:last-child {
    padding-right: 28px;
}

.bs-dt .bs-filter-input,
.bs-dt .bs-filter-select {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 13px;
    padding: 7px 12px;
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
    background: #f9fafb;
    color: #111318;
    -webkit-appearance: none;
    appearance: none;
}

.bs-dt .bs-filter-select {
    background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 10px center;
    padding-right: 28px;
    cursor: pointer;
}

.bs-dt .bs-filter-input:focus,
.bs-dt .bs-filter-select:focus {
    border-color: #3b82f6;
    background: #fff;
}

.bs-dt .bs-filter-input::placeholder {
    color: #9ca3af;
}

/* ── Entity Cell (logo + name) ── */
.bs-entity-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bs-entity-cell img:not(.bs-verified-badge) {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.06);
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
}

.bs-entity-cell a {
    font-weight: 600;
    color: #111318;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.15s;
}

.bs-entity-cell a:hover {
    color: #3b82f6;
}

/* Small variant — 28px square logos for exchanges/wallets/companies */
.bs-entity-cell--sm img:not(.bs-verified-badge) {
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px;
    border-width: 1px;
}

.bs-entity-cell--sm {
    gap: 10px;
    min-width: 160px;
}

/* Optional entity info column (name + CTA) */
.bs-entity-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bs-entity-cta {
    display: inline-block;
    background: #f0faf9;
    color: #1a8a82;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #d0ece9;
    white-space: nowrap;
    width: fit-content;
}

/* ── Rank Badges ── */
.bs-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1;
}

.bs-rank-1 { background: linear-gradient(135deg, #fcd34d, #f59e0b); color: #78350f; }
.bs-rank-2 { background: linear-gradient(135deg, #cbd5e1, #7c8ca2); color: #0f172a; }
.bs-rank-3 { background: linear-gradient(135deg, #fdba74, #b45309); color: #fff; }
.bs-rank-default { background: #e2e5eb; color: #374151; }

/* ── Price ── */
.bs-price {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    font-size: 14px;
    color: #111318;
    white-space: nowrap;
}

/* ── Change Pills ── */
.bs-change {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 12px;
    border-radius: 6px;
    white-space: nowrap;
}

.bs-change-up {
    color: #047857;
    background: #d1fae5;
}

.bs-change-down {
    color: #b91c1c;
    background: #fee2e2;
}

/* ── Monospace Numeric Values ── */
.bs-mcap, .bs-vol, .bs-supply, .bs-num {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #111318;
    font-weight: 600;
    white-space: nowrap;
}

.bs-num {
    text-align: right;
}

/* ── Yes/No Pills ── */
.bs-pill-yes {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    color: #047857;
    background: #d1fae5;
}

.bs-pill-no {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    color: #6b7280;
    background: #f3f4f6;
}

/* ── Status Indicators ── */
.bs-status-online {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #047857;
}

.bs-status-online::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}

.bs-status-offline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #b91c1c;
}

.bs-status-offline::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
}

.bs-status-other {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

/* ── Type Badge ── */
.bs-type-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    color: #1e40af;
    background: #dbeafe;
    white-space: nowrap;
}

/* ── Buy/Trade Button ── */
.bs-buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    border: 1.5px solid #e4e7ed;
    background: #fff;
    color: #1a1d29;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1;
}

.bs-buy-btn svg {
    width: 12px;
    height: 12px;
    color: #9ca3af;
    transition: color 0.2s;
}

.bs-buy-btn:hover {
    background: #1a1d29;
    color: #fff;
    border-color: #1a1d29;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    text-decoration: none !important;
}

.bs-buy-btn:hover svg {
    color: #fff;
}

.bs-dt-table tbody tr:hover .bs-buy-btn {
    border-color: #c7cbd4;
}

/* ── Skeleton Loading ── */
.bs-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: bs-shimmer 1.5s infinite;
    border-radius: 4px;
    height: 16px;
    display: inline-block;
}

@keyframes bs-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Scrollable Table Wrapper ── */
.bs-dt .bs-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── DataTables Overrides (1.x class names) ── */

.bs-dt .dataTables_processing {
    display: none !important;
}

.bs-dt .dataTables_filter {
    padding: 0 28px 16px;
}

.bs-dt .dataTables_filter label {
    font-size: 0;
    display: flex;
    align-items: center;
}

.bs-dt .dataTables_filter input[type="search"] {
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    padding: 10px 16px;
    border: 1px solid #e4e7ed;
    border-radius: 10px;
    outline: none;
    width: 100%;
    max-width: 320px;
    transition: border-color 0.2s;
    background: #f9fafb;
    color: #111318;
}

.bs-dt .dataTables_filter input[type="search"]:focus {
    border-color: #3b82f6;
    background: #fff;
}

.bs-dt .dataTables_length {
    display: none;
}

.bs-dt .dataTables_info {
    font-size: 12px;
    color: #6b7280;
    padding: 16px 28px;
}

.bs-dt .dataTables_paginate {
    padding: 16px 28px;
    text-align: center;
}

.bs-dt .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    margin: 0 3px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151 !important;
    background: transparent !important;
    border: 1.5px solid #e4e7ed !important;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-shadow: none !important;
}

.bs-dt .dataTables_paginate .paginate_button:hover {
    background: #f8f9fb !important;
    border-color: #c7cbd4 !important;
    color: #111318 !important;
}

.bs-dt .dataTables_paginate .paginate_button.current {
    background: #111318 !important;
    border-color: #111318 !important;
    color: #fff !important;
}

.bs-dt .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: default;
}

.bs-dt .dataTables_paginate .paginate_button.disabled:hover {
    background: transparent !important;
    border-color: #e4e7ed !important;
}

/* Bottom bar (DT 1.x) */
.bs-dt .dataTables_wrapper .dataTables_info,
.bs-dt .dataTables_wrapper .dataTables_paginate {
    display: inline-block;
}

.bs-dt .dataTables_wrapper > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f3f4f6;
}

/* Remove DT 1.x sorting icons */
.bs-dt-table thead th.sorting,
.bs-dt-table thead th.sorting_asc,
.bs-dt-table thead th.sorting_desc {
    background-image: none !important;
}

/* ── DataTables Overrides (2.x class names) ── */

.bs-dt .dt-processing {
    display: none !important;
}

.bs-dt .dt-length {
    display: none !important;
}

/* DT 2.x search input styling (mirrors 1.x .dataTables_filter) */
.bs-dt .dt-search {
    padding: 0 28px 16px;
}

.bs-dt .dt-search label {
    font-size: 0;
    display: flex;
    align-items: center;
}

.bs-dt .dt-search input[type="search"] {
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    padding: 10px 16px;
    border: 1px solid #e4e7ed;
    border-radius: 10px;
    outline: none;
    width: 100%;
    max-width: 320px;
    transition: border-color 0.2s;
    background: #f9fafb;
    color: #111318;
}

.bs-dt .dt-search input[type="search"]:focus {
    border-color: #3b82f6;
    background: #fff;
}

.bs-dt .dt-info {
    font-size: 12px;
    color: #6b7280;
    padding: 16px 28px;
}

.bs-dt .dt-paging {
    padding: 16px 28px;
    text-align: center;
}

.bs-dt .dt-paging .dt-paging-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    margin: 0 3px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151 !important;
    background: transparent !important;
    border: 1.5px solid #e4e7ed !important;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    box-shadow: none !important;
}

.bs-dt .dt-paging .dt-paging-button:hover {
    background: #f8f9fb !important;
    border-color: #c7cbd4 !important;
    color: #111318 !important;
}

.bs-dt .dt-paging .dt-paging-button.current {
    background: #111318 !important;
    border-color: #111318 !important;
    color: #fff !important;
}

.bs-dt .dt-paging .dt-paging-button.disabled {
    opacity: 0.4;
    cursor: default;
}

.bs-dt .dt-paging .dt-paging-button.disabled:hover {
    background: transparent !important;
    border-color: #e4e7ed !important;
}

/* Bottom bar (DT 2.x) */
.bs-dt .dt-layout-row:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f3f4f6;
}

/* Remove DT 2.x sorting icons */
.bs-dt-table thead th.dt-orderable-none::after,
.bs-dt-table thead th.dt-orderable-none::before {
    content: none !important;
}

/* ── Responsive (max-width: 767px) ── */
@media (max-width: 767px) {
    .bs-dt-hide-mobile { display: none !important; }

    .bs-dt { border-radius: 14px; }

    .bs-dt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 20px 16px 16px;
    }

    .bs-dt-title { font-size: 17px; }

    .bs-dt-table thead th,
    .bs-dt-table tbody td {
        padding: 12px 10px;
    }

    .bs-dt-table thead th:first-child,
    .bs-dt-table tbody td:first-child {
        padding-left: 14px;
    }

    .bs-dt-table thead th:last-child,
    .bs-dt-table tbody td:last-child {
        padding-right: 14px;
    }

    .bs-entity-cell img:not(.bs-verified-badge) {
        width: 28px !important;
        height: 28px !important;
    }

    .bs-entity-cell { gap: 8px; }

    .bs-entity-cell--sm img:not(.bs-verified-badge) {
        width: 24px !important;
        height: 24px !important;
    }

    .bs-entity-cell--sm {
        gap: 8px;
        min-width: 140px;
    }

    .bs-rank {
        width: 26px;
        height: 26px;
        font-size: 11px;
        border-radius: 7px;
    }

    .bs-change {
        padding: 4px 8px;
        font-size: 11px;
    }

    .bs-buy-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    /* DT 1.x mobile */
    .bs-dt .dataTables_filter {
        padding: 0 16px 12px;
    }

    .bs-dt .dataTables_filter input[type="search"] {
        max-width: 100%;
    }

    .bs-dt .dataTables_info {
        padding: 12px 16px;
        font-size: 11px;
    }

    .bs-dt .dataTables_paginate {
        padding: 12px 16px;
    }

    .bs-dt .dataTables_paginate .paginate_button {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
        margin: 0 2px;
    }

    .bs-dt .dataTables_wrapper > div:last-child {
        flex-direction: column;
        gap: 4px;
    }

    /* DT 2.x mobile */
    .bs-dt .dt-search {
        padding: 0 16px 12px;
    }

    .bs-dt .dt-search input[type="search"] {
        max-width: 100%;
    }

    .bs-dt .dt-info {
        padding: 12px 16px;
        font-size: 11px;
    }

    .bs-dt .dt-paging {
        padding: 12px 16px;
    }

    .bs-dt .dt-paging .dt-paging-button {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
        margin: 0 2px;
    }

    .bs-dt .dt-layout-row:last-child {
        flex-direction: column;
        gap: 4px;
    }

    /* Scrollbar styling */
    .bs-dt .bs-table-scroll {
        scrollbar-width: thin;
        scrollbar-color: #d1d5db transparent;
    }

    .bs-dt .bs-table-scroll::-webkit-scrollbar {
        height: 4px;
    }

    .bs-dt .bs-table-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .bs-dt .bs-table-scroll::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 4px;
    }

    .bs-filter-input,
    .bs-filter-select {
        font-size: 12px;
        padding: 6px 10px;
    }
}
