/**
 * Token List Block Styles
 * Optimized and consolidated CSS
 */

/* Base Container */
.neo-token-list-block {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Filter Section */
.neo-token-list-block .neo-token-filters {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.neo-token-list-block .neo-token-filters::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.neo-token-list-block .neo-token-filter-pill {
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    transition: all 0.2s ease;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    width: auto !important;
    display: inline-block;
}

.neo-token-list-block .neo-token-filter-pill:hover {
    background: rgba(15, 23, 42, 0.1);
    border-color: rgba(15, 23, 42, 0.12);
}

/* Search input: ensure bottom border is visible on load (block-level overrides in render.php) */
.neo-token-list-block input.neo-token-filter-pill[type="text"] {
    border-style: solid;
    border-bottom-width: 1px;
}

.neo-token-list-block .neo-search-btn {
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    transition: background 0.2s ease;
}

.neo-token-list-block .neo-search-btn:hover {
    background: #2563eb;
}

/* Content Wrapper */
.neo-token-list-block .neo-token-content {
    padding: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table Styles */
.neo-token-list-block .neo-token-table {
    width: 100%;
    border-collapse: collapse;
    box-sizing: border-box;
}

/* Table header/cell base – borders and row hover are controlled per-block in render.php */
.neo-token-list-block .neo-token-table thead th {
    text-align: left;
    padding: 12px 10px;
    vertical-align: middle;
    font-weight: 600;
    font-size: 13px;
    background: #f9fafb;
    color: #111827;
}

.neo-token-list-block .neo-token-table tbody td {
    padding: 12px 10px;
    vertical-align: middle;
    min-height: 50px;
    box-sizing: border-box;
}

.neo-token-list-block .neo-token-row {
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Row hover (transform, background, box-shadow, borders) is controlled only by block settings in render.php – no duplicate hover here */

/* Safety net: strip border/outline/box-shadow on row hover (higher specificity to beat theme/plugin overrides) */
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:hover {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:hover td,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:hover th,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus td,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus th,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus-within td,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus-within th,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:active td,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:active th {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus-within,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:hover td *,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:hover th *,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus td *,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus th *,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus-within td *,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:focus-within th *,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:active td *,
.neo-token-list-block.neo-token-list-block .neo-token-table tbody tr.neo-token-row:active th * {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.neo-token-list-block .neo-token-row:nth-child(even) {
    background: rgba(148, 163, 184, 0.04);
}

/* Token Information */
.neo-token-list-block .neo-token-name {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.neo-token-list-block .neo-token-name a,
.neo-token-list-block a.neo-token-name {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.neo-token-list-block .neo-token-name a:hover {
    color: #3b82f6;
}

.neo-token-list-block .neo-token-meta {
    font-size: 12px;
    color: rgba(100, 116, 139, 0.9);
    margin-top: 4px;
}

.neo-token-list-block .neo-token-symbol {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Badge Styles */
.neo-token-list-block .neo-token-badges {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: 12px;
    flex-wrap: wrap;
}

.neo-token-list-block .neo-token-badges .neo-badge-zone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.neo-token-list-block .neo-token-badges .neo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    font-weight: 600;
    font-size: 10px;
}

.neo-token-list-block .neo-token-badges img,
.neo-token-list-block .neo-token-badges svg {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

/* Token list badges: icons-only (fallback when block inline styles missing/cached) */
.neo-token-list-block .neo-token-list-badges .badge-text {
    display: none !important;
}
.neo-token-list-block .neo-token-list-badges .neo-badge.no-image {
    display: none !important;
}

/* Token Icon */
.neo-token-list-block .neo-token-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #f3f4f6;
}

/* Chain Overlay */
.neo-token-list-block .neo-chain-overlay {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.neo-token-list-block .neo-chain-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Vote Button */
.neo-token-list-block .neo-vote-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 14px;
    border: none;
    background-color: #3b82f6;
    color: white;
    cursor: pointer;
    font-size: 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 600;
    min-width: 60px;
}

.neo-token-list-block .neo-vote-button:hover {
    background-color: #2563eb;
    transform: scale(1.05);
}

.neo-token-list-block .neo-vote-button:active,
.neo-token-list-block .neo-vote-button.voted {
    background-color: #1d4ed8;
    transform: scale(0.98);
}

.neo-token-list-block .neo-vote-button span:first-child {
    font-size: 24px;
    line-height: 1;
}

.neo-token-list-block .neo-vote-button span:last-child {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Status Tags */
.neo-token-list-block .neo-audit-badge {
    font-size: 12px;
    background-color: #dbeafe;
    color: #0369a1;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 4px;
}

.neo-token-list-block .neo-kyc-badge {
    font-size: 12px;
    background-color: #dcfce7;
    color: #166534;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.neo-token-list-block .neo-category-tag {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-block;
    font-weight: 500;
}

/* Pagination */
.neo-token-list-block .neo-token-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.neo-token-list-block .neo-token-page-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    min-width: 36px;
    text-align: center;
}

.neo-token-list-block .neo-token-page-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.neo-token-list-block .neo-token-page-btn.is-active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* Loading States */
.neo-token-list-block .neo-token-skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    /* Block root must not scroll; only filters and table content scroll horizontally */
    .neo-token-list-block {
        overflow-x: visible !important;
    }

    .neo-token-list-block .neo-token-filters {
        flex-direction: column !important;
        align-items: stretch !important;
        overflow-x: visible;
    }

    .neo-token-list-block .neo-token-filter-pill,
    .neo-token-list-block .neo-search-btn {
        width: 100% !important;
    }

    /* Table content area: 100% of block width, horizontal scroll only here */
    .neo-token-list-block .neo-token-content {
        padding: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .neo-token-list-block .neo-token-table {
        display: table !important;
        width: 100% !important;
        min-width: 800px !important;
        table-layout: auto !important;
    }
    
    .neo-token-list-block .neo-token-table thead {
        display: table-header-group !important;
    }
    
    .neo-token-list-block .neo-token-table tbody {
        display: table-row-group !important;
    }
    
    .neo-token-list-block .neo-token-table tr {
        display: table-row !important;
    }

    .neo-token-list-block .neo-token-table td,
    .neo-token-list-block .neo-token-table th {
        display: table-cell !important;
        white-space: nowrap;
        padding: 8px;
    }
    
    .neo-token-list-block .neo-token-table td::before {
        content: none !important;
        display: none !important;
    }
    /* Do not hide td:last-child::after — used for row line shaded edges */
    .neo-token-list-block .neo-token-table tbody .neo-token-row td:not(:last-child)::after {
        content: none !important;
        display: none !important;
    }

    .neo-token-list-block .neo-vote-button {
        min-width: 50px;
        padding: 8px 10px;
    }

    .neo-token-list-block .neo-token-name {
        font-size: 14px;
    }

    /* .neo-token-sticky is position:sticky so ::after on it works without extra position:relative */
    .neo-token-list-block .neo-token-table td[data-column="coin"] .neo-token-badges {
        flex-shrink: 0;
        min-width: min-content;
        margin-left: 0;
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .neo-token-list-block .neo-token-content {
        padding: 8px;
    }

    .neo-token-list-block .neo-token-table tbody td {
        padding: 8px 0;
        min-height: auto;
    }

    .neo-token-list-block .neo-token-name {
        font-size: 13px;
    }

    .neo-token-list-block .neo-token-icon {
        width: 32px;
        height: 32px;
    }

    .neo-token-list-block .neo-vote-button {
        padding: 6px 8px;
        font-size: 14px;
    }

    .neo-token-list-block .neo-vote-button span:first-child {
        font-size: 20px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .neo-token-list-block .neo-token-table thead th {
        background: #1f2937;
        color: #f3f4f6;
    }

    .neo-token-list-block .neo-token-row {
        background: #111827;
    }

    .neo-token-list-block .neo-token-row:nth-child(even) {
        background: rgba(31, 41, 55, 0.8);
    }

    .neo-token-list-block .neo-token-filter-pill {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.15);
        color: #e5e7eb;
    }

    .neo-token-list-block .neo-token-page-btn {
        background: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }

    .neo-token-list-block .neo-token-page-btn:hover {
        background: #374151;
    }
}

/* Utilities */
.neo-token-list-block .text-center {
    text-align: center;
}

.neo-token-list-block .text-left {
    text-align: left;
}

.neo-token-list-block .text-right {
    text-align: right;
}

.neo-token-list-block .flex {
    display: flex;
}

.neo-token-list-block .flex-col {
    flex-direction: column;
}

.neo-token-list-block .items-center {
    align-items: center;
}

.neo-token-list-block .gap-2 {
    gap: 8px;
}

.neo-token-list-block .gap-4 {
    gap: 16px;
}

.neo-token-list-block .mt-4 {
    margin-top: 16px;
}

.neo-token-list-block .mb-4 {
    margin-bottom: 16px;
}
