/* Coin Holders Page Specific Styles - Match Myriad Markets Design */

/* Enable scrolling on the main content */
html, body {
    overflow: auto !important;
    height: auto !important;
}

.main-content {
    overflow-y: auto !important;
    overflow-x: visible !important;
    height: 100vh;
    position: relative;
}

.main {
    min-height: auto;
    padding-bottom: 40px; /* Add bottom padding for scrolling */
    overflow: visible;
}

/* CSS Variables */
:root {
    --maxw: 1280px;
    --gutter: 24px;
    --header-h: 88px;
    --header-pad: 16px;
}

/* Reusable container for ALL page sections */
.container {
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gutter);
    box-sizing: border-box;
    overflow: visible;
}

/* Full-bleed header background */
.site-header {
    background: linear-gradient(180deg, #0e1520 0%, #0b121a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    /* center content to the same grid as cards */
    padding-inline: max(calc((100vw - var(--maxw)) / 2), var(--gutter));
    padding-block: var(--header-pad);
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    width: 100%;
}

/* Make sure nothing nudges the row */
.site-header > * {
    margin: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0;
    gap: 16px;
}

/* Time Period Selector - Left aligned */
.time-period-selector {
    display: flex;
    align-items: center;
    margin: 0;
}

.time-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
    margin: 0;
}

/* Avoid device notch pushing content unevenly */
@supports (padding: max(0px)) {
    .header { 
        padding-top: max(var(--header-pad), env(safe-area-inset-top)); 
    }
}

.page-title {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-100);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px rgba(52, 214, 255, 0.3);
    margin: 0;
    white-space: nowrap;
}

.tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    line-height: 36px;
    padding: 0 14px;
    background: var(--bg-800);
    border: 1px solid var(--line);
    color: var(--text-400);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: "Orbitron", system-ui, sans-serif;
    white-space: nowrap;
    box-sizing: border-box;
    margin: 0;
}

.tab-button:first-child {
    margin-left: 0 !important;
}

.tab-button:hover {
    background: var(--card-800);
    border-color: var(--cyan);
    color: var(--text-100);
}

.tab-button.active {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
    box-shadow: 0 0 20px rgba(122, 92, 255, 0.3);
    /* Do not change height/padding/border on active */
}

/* Content Sections - Match main site style */
.content-section {
    background: linear-gradient(135deg, rgba(255,255,255,.03), rgba(0,0,0,.1)),
                var(--card-800);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow: visible;
    position: relative;
    transition: all 0.2s ease;
    z-index: 1;
}

.content-section:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(52, 214, 255, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg-800);
}

.section-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-100);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(52, 214, 255, 0.3);
    font-family: "Orbitron", system-ui, sans-serif;
}

/* Token Selector Section */
.token-search-container {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: 100%;
    position: relative;
    overflow: visible;
    z-index: 15;
}

.search-input-wrapper {
    position: relative;
    flex: 0 0 300px; /* Fixed width for search */
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-400);
    font-size: 14px;
    z-index: 2;
}

.token-search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    background: var(--card-800);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-100);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
}

.token-search-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(52, 214, 255, 0.1);
}

.token-search-input::placeholder {
    color: var(--text-400);
}

.token-dropdown {
    min-width: 400px;
    max-width: 600px;
    flex: 1;
    padding: 12px 16px;
    background: var(--card-800);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-100);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 48px;
    position: relative;
}

/* Custom dropdown for images */
.custom-dropdown {
    position: relative;
    min-width: 300px;
    max-width: 600px;
    flex: 1;
    overflow: visible;
    z-index: 1;
}

/* Ensure token analytics stays below dropdown */
.token-analytics {
    position: relative;
    z-index: 1;
}

.dropdown-trigger {
    width: 100%;
    padding: 12px 16px;
    background: var(--card-800);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-100);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dropdown-trigger:hover {
    border-color: var(--cyan);
}

.dropdown-trigger:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(52, 214, 255, 0.1);
}

.dropdown-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.token-image {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-arrow {
    color: var(--text-400);
    transition: transform 0.3s ease;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: fixed;
    background: var(--card-800);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 4px;
    /* width is now handled by JavaScript */
}

.dropdown-option {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--line);
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: var(--card-700);
}

.dropdown-option.selected {
    background: var(--card-700);
}

.option-image {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-symbol {
    font-weight: 600;
    color: var(--text-100);
    font-size: 14px;
}

.option-details {
    font-size: 12px;
    color: var(--text-400);
}

.token-dropdown:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(52, 214, 255, 0.1);
}

/* Token Selection State */
.token-selection-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.token-selection-state .selection-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.selection-content {
    max-width: 400px;
}

.selection-message {
    text-align: center;
}

.selection-message h3 {
    color: var(--text-100);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.selection-message p {
    color: var(--text-400);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* Loading Animation */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--line);
    border-top: 3px solid var(--cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-300);
    font-size: 1rem;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.selection-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.selection-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-100);
    margin-bottom: 0.5rem;
}

.selection-content p {
    color: var(--text-400);
    font-size: 1rem;
    line-height: 1.6;
}

/* Token Header */
.token-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.token-logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.token-details h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-100);
    margin-bottom: 0.5rem;
}

.token-address {
    font-family: 'Courier New', monospace;
    color: var(--text-400);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.token-actions {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.action-btn, .table-controls select {
    padding: 0.75rem 1.5rem;
    background: var(--card-800);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-100);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: var(--bg-800);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Overview Cards */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.overview-card {
    background: linear-gradient(135deg, rgba(255,255,255,.03), rgba(0,0,0,.1)),
                var(--card-800);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.overview-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(52, 214, 255, 0.1);
    transform: translateY(-2px);
}

.overview-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.overview-card-header h3 {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.overview-icon {
    font-size: 16px;
    opacity: 0.7;
}

.overview-card-value {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-100);
    margin-bottom: 6px;
}

.overview-card-change {
    font-size: 12px;
    font-weight: 600;
    font-family: "Orbitron", system-ui, sans-serif;
}

.overview-card-change.positive {
    color: var(--green);
}

.overview-card-change.negative {
    color: var(--red);
}

.overview-card-change.neutral {
    color: var(--text-400);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.chart-container {
    background: linear-gradient(135deg, rgba(255,255,255,.03), rgba(0,0,0,.1)),
                var(--card-800);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

/* Force chart legend text to be white */
.chart-container canvas + div,
.chart-container .chartjs-legend,
.chart-container .chartjs-legend * {
    color: #FFFFFF !important;
}

/* Target Chart.js legend specifically */
.coin-holders-page .chart-container canvas + div {
    color: #FFFFFF !important;
}

.coin-holders-page .chart-container canvas + div * {
    color: #FFFFFF !important;
}

/* More aggressive targeting for Chart.js legend */
.coin-holders-page div[style*="position: relative"] div {
    color: #FFFFFF !important;
}

.coin-holders-page div[style*="position: relative"] div * {
    color: #FFFFFF !important;
}

/* Target any text elements in chart containers */
.coin-holders-page .chart-container * {
    color: #FFFFFF !important;
}

/* USD value styling in holders table */
.usd-value {
    color: var(--text-400);
    font-size: 0.85rem;
    font-weight: 400;
    margin-left: 0.5rem;
}

.chart-container:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(52, 214, 255, 0.1);
    transform: translateY(-2px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-100);
    margin: 0;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

/* Table Controls */
.table-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Holders Table - Match transactions table styling */
.transactions-table-container {
    overflow-x: auto;
}

.holders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.holders-table th,
.holders-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(34, 48, 68, 0.3);
}

.holders-table th {
    background: var(--bg-800);
    color: var(--text-400);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: "Orbitron", system-ui, sans-serif;
}

.holders-table td {
    color: var(--text-100);
}

.holders-table tr:hover {
    background: rgba(52, 214, 255, 0.05);
}

.rank-number {
    font-weight: 600;
    color: var(--text-400);
}

.wallet-address {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--cyan);
    cursor: pointer;
    transition: color 0.3s ease;
}

.wallet-address:hover {
    color: var(--text-100);
    text-decoration: underline;
}

.balance-amount {
    font-family: "Orbitron", system-ui, sans-serif;
    font-weight: 600;
    color: var(--text-100);
}

.balance-symbol {
    font-size: 0.8rem;
    color: var(--text-400);
    margin-left: 0.25rem;
}

.percentage-value {
    font-weight: 600;
    color: var(--text-100);
}

.change-value {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.change-value.positive {
    color: var(--green);
}

.change-value.negative {
    color: var(--red);
}

.change-value.neutral {
    color: var(--text-400);
}

.table-action-btn {
    background: var(--bg-800);
    border: 1px solid var(--line);
    color: var(--text-400);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table-action-btn:hover {
    background: var(--card-800);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-400);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-100);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Holder Distribution Section */
.holder-distribution-container {
    padding: 1.5rem;
}

.distribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.distribution-item {
    background: linear-gradient(135deg, rgba(255,255,255,.02), rgba(0,0,0,.05)),
                var(--card-700);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.distribution-item:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(52, 214, 255, 0.1);
    transform: translateY(-1px);
}

.distribution-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.distribution-label {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-100);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.distribution-count {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--cyan);
}

.distribution-percentage {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-300);
    margin-bottom: 8px;
}

.distribution-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-800);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.distribution-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.distribution-value {
    font-size: 12px;
    color: var(--text-400);
    font-family: "Exo 2", system-ui, sans-serif;
}

/* Special styling for total holders */
.distribution-item.total-holders {
    background: linear-gradient(135deg, rgba(52, 214, 255, 0.1), rgba(122, 92, 255, 0.1)),
                var(--card-700);
    border-color: var(--cyan);
}

.distribution-item.total-holders .distribution-label {
    color: var(--cyan);
}

.distribution-item.total-holders .distribution-count {
    color: var(--cyan);
    font-size: 20px;
}

.distribution-item.total-holders .distribution-progress-bar {
    background: linear-gradient(90deg, var(--cyan), var(--purple));
}

/* Top Gainers & Losers Section */
.gainers-losers-container {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.gainers-losers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.gainers-column, .losers-column {
    background: linear-gradient(135deg, rgba(255,255,255,.02), rgba(0,0,0,.05)),
                var(--card-700);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

/* Table Styles */
.tokens-table-container {
    margin-top: 1rem;
    overflow-x: auto;
}

.tokens-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tokens-table thead th {
    background: rgba(255,255,255,.05);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tokens-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,.05);
    transition: background-color 0.2s ease;
}

.tokens-table tbody tr:hover {
    background: rgba(255,255,255,.02);
}

.tokens-table tbody tr:last-child {
    border-bottom: none;
}

.tokens-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

.token-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.token-cell img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.token-cell-info {
    display: flex;
    flex-direction: column;
}

.token-cell-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.token-cell-symbol {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.holders-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.change-cell {
    font-weight: 600;
}

.change-cell.positive {
    color: var(--success);
}

.change-cell.negative {
    color: var(--danger);
}

/* Specific styling for change percentage column */
.tokens-table tbody tr td:nth-child(4) {
    font-weight: 600;
}

.tokens-table tbody tr td:nth-child(4).positive {
    color: var(--success);
}

.tokens-table tbody tr td:nth-child(4).negative {
    color: var(--danger);
}

.price-cell {
    font-weight: 600;
}

.price-cell.positive {
    color: var(--success);
}

.price-cell.negative {
    color: var(--danger);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    vertical-align: middle;
}

.table-action-btn {
    background: rgba(255,255,255,.1);
    border: 1px solid var(--line);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 28px;
    line-height: 1;
}

.table-action-btn:hover {
    background: rgba(255,255,255,.2);
    color: var(--text-primary);
    border-color: var(--primary);
}

.gainers-column:hover, .losers-column:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(52, 214, 255, 0.1);
    transform: translateY(-2px);
}

.column-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.column-header h3 {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-100);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.column-header h3 i {
    font-size: 1rem;
}

.gainers-column .column-header h3 i {
    color: var(--green);
}

.losers-column .column-header h3 i {
    color: var(--red);
}

.column-header p {
    font-size: 0.85rem;
    color: var(--text-400);
    margin: 0;
}

.tokens-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.token-item {
    background: var(--card-800);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.token-item:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(52, 214, 255, 0.1);
    transform: translateY(-1px);
}

.token-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.token-item-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.token-item-info {
    flex: 1;
    min-width: 0;
}

.token-item-name {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-100);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-item-symbol {
    font-size: 0.75rem;
    color: var(--text-400);
    font-weight: 500;
}

.token-item-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-family: "Orbitron", system-ui, sans-serif;
}

.stat-value {
    font-family: "Orbitron", system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-100);
}

.stat-value.positive {
    color: var(--green);
}

.stat-value.negative {
    color: var(--red);
}

.token-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.token-action-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-800);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text-400);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.token-action-btn:hover {
    background: var(--card-800);
    border-color: var(--cyan);
    color: var(--cyan);
}

/* Empty state for gainers/losers */
.gainers-losers-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-400);
}

.gainers-losers-empty i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.gainers-losers-empty h3 {
    font-size: 1rem;
    color: var(--text-100);
    margin-bottom: 0.5rem;
}

.gainers-losers-empty p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Copy Toast */
.copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--purple);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(122, 92, 255, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Sidebar Styles */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100vw !important;
    }
    
    .container {
        padding-inline: 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .time-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        max-width: 100%;
        overflow: hidden;
    }
    
    .tab-button {
        padding: 8px 12px;
        font-size: 11px;
        min-width: 60px;
        flex-shrink: 1;
        max-width: calc(33.333% - 6px); /* Ensure buttons don't overflow */
    }
    
    .page-title {
        margin-top: 16px;
        font-size: 1.1rem;
    }
    
    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chart-container {
        padding: 16px;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    .distribution-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 12px;
    }
    
    .distribution-item {
        padding: 12px;
    }
    
    .distribution-label {
        font-size: 12px;
    }
    
    .distribution-count {
        font-size: 16px;
    }
    
    .distribution-percentage {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .main-content {
        overflow-x: hidden !important; /* Prevent horizontal scroll on mobile */
    }
    
    .site-header {
        min-height: auto;
        padding-block: 12px;
        gap: 12px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin: 0;
    }
    
    .page-title {
        margin-top: 16px;
        font-size: 1rem;
    }
    
    .token-search-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .search-input-wrapper {
        flex: none;
        width: 100%;
        max-width: none;
    }
    
    .token-search-input {
        width: 100%;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Mobile dropdown improvements */
    .custom-dropdown {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }
    
    .dropdown-trigger {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .dropdown-menu {
        position: fixed !important;
        left: 1rem !important;
        right: 1rem !important;
        width: calc(100vw - 2rem) !important;
        max-height: 60vh !important;
    }
    
    .dropdown-option {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .option-image {
        width: 20px;
        height: 20px;
    }
    
    .option-symbol {
        font-size: 14px;
        font-weight: 600;
    }
    
    .option-name {
        font-size: 12px;
    }
    
    .option-details {
        font-size: 10px;
    }
    
    .token-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .token-actions {
        margin-left: 0;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
        min-width: 100px;
        max-width: 120px;
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .overview-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 1rem;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 1rem;
    }
    
    .chart-container {
        padding: 16px;
        overflow: hidden;
    }
    
    .chart-wrapper {
        height: 200px;
        overflow: hidden;
    }
    
    .distribution-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .distribution-item {
        padding: 10px;
    }
    
    .distribution-label {
        font-size: 11px;
    }
    
    .distribution-count {
        font-size: 14px;
    }
    
    .distribution-percentage {
        font-size: 12px;
    }
    
    .distribution-value {
        font-size: 10px;
    }
    
    .gainers-losers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gainers-column, .losers-column {
        padding: 1rem;
    }
    
    .column-header h3 {
        font-size: 1rem;
    }
    
    /* Mobile responsive tokens table */
    .tokens-table-container {
        margin: 0;
        padding: 0;
        overflow-x: visible; /* Remove horizontal scroll on mobile */
    }
    
    .tokens-table {
        min-width: 100%; /* Use full width of container */
        font-size: 0.8rem;
        width: 100%;
    }
    
    .tokens-table thead th {
        padding: 0.4rem 0.2rem;
        font-size: 0.7rem;
    }
    
    .tokens-table td {
        padding: 0.4rem 0.2rem;
    }
    
    /* Make columns more compact on mobile */
    .tokens-table th:nth-child(1),
    .tokens-table td:nth-child(1) {
        width: 40%; /* Token name column */
    }
    
    .tokens-table th:nth-child(2),
    .tokens-table td:nth-child(2) {
        width: 25%; /* Holders column */
    }
    
    .tokens-table th:nth-child(3),
    .tokens-table td:nth-child(3) {
        width: 20%; /* Change column */
    }
    
    .tokens-table th:nth-child(4),
    .tokens-table td:nth-child(4) {
        width: 15%; /* Actions column */
    }
    
    .token-cell {
        gap: 0.25rem;
    }
    
    .token-cell-image {
        width: 20px;
        height: 20px;
        min-width: 20px;
    }
    
    .token-cell-info {
        min-width: 0;
    }
    
    .token-cell-name {
        font-size: 0.75rem;
    }
    
    .token-cell-symbol {
        font-size: 0.7rem;
    }
    
    .holders-cell {
        font-size: 0.75rem;
    }
    
    .change-cell {
        font-size: 0.75rem;
    }
    
    .table-action-btn {
        padding: 4px 6px;
        font-size: 0.7rem;
        min-width: 24px;
        height: 24px;
    }
    }
    
    .token-item {
        padding: 0.75rem;
    }
    
    .token-item-image {
        width: 28px;
        height: 28px;
    }
    
    .token-item-name {
        font-size: 0.85rem;
    }
    
    .token-item-symbol {
        font-size: 0.7rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .stat-value {
        font-size: 0.8rem;
    }
    
    .token-action-btn {
        font-size: 0.7rem;
        padding: 0.4rem;
    }
    
    /* Table improvements for mobile */
    .holders-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .holders-table {
        font-size: 0.75rem;
        min-width: 600px;
    }
    
    .holders-table th,
    .holders-table td {
        padding: 0.4rem 0.3rem;
        white-space: nowrap;
    }
    
    .holders-table th:first-child,
    .holders-table td:first-child {
        position: sticky;
        left: 0;
        background: var(--card-800);
        z-index: 10;
        min-width: 120px;
    }
    
    .balance-amount {
        font-size: 0.7rem;
    }
    
    .balance-symbol {
        font-size: 0.65rem;
    }
    
    .usd-value {
        font-size: 0.6rem;
    }
    
    .percentage-value {
        font-size: 0.7rem;
    }
    
    .change-value {
        font-size: 0.7rem;
    }
    
    .table-action-btn {
        padding: 4px 6px;
        font-size: 10px;
        min-width: 24px;
        height: 24px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .table-controls {
        width: 100%;
        justify-content: flex-start;
    }
    
    .time-period-selector {
        justify-content: center;
        width: 100%;
        margin: 0;
    }
    
    .time-tabs {
        gap: 6px;
        justify-content: center;
        flex-wrap: wrap;
        max-width: 100%;
        overflow: hidden;
    }
    
    .tab-button {
        height: 36px;
        line-height: 36px;
        padding: 0 12px;
        font-size: 11px;
        min-width: 60px;
        flex-shrink: 1;
        max-width: calc(33.333% - 4px); /* Ensure buttons don't overflow */
    }
}

@media (max-width: 480px) {
    .container {
        padding-inline: 8px;
    }
    
    .header-content {
        gap: 0.8rem;
    }
    
    .page-title {
        font-size: 0.9rem;
    }
    
    .time-tabs {
        gap: 4px;
        max-width: 100%;
        overflow: hidden;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .site-header {
        padding-block: 8px;
        gap: 8px;
    }
    
    .tab-button {
        height: 32px;
        line-height: 32px;
        padding: 0 8px;
        font-size: 9px;
        min-width: 45px;
        flex-shrink: 1;
        max-width: calc(33.333% - 3px); /* Ensure buttons don't overflow */
    }
    
    /* Extra small screen dropdown */
    .dropdown-menu {
        min-width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        left: 0.5rem !important;
        right: 0.5rem !important;
    }
    
    .dropdown-option {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .option-image {
        width: 18px;
        height: 18px;
    }
    
    .option-symbol {
        font-size: 13px;
    }
    
    .option-name {
        font-size: 11px;
    }
    
    .option-details {
        font-size: 9px;
    }
    
    .token-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .action-btn {
        width: 100%;
        max-width: none;
        min-width: auto;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .overview-cards {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0.8rem;
    }
    
    .overview-card {
        padding: 12px;
    }
    
    .overview-card-header h3 {
        font-size: 11px;
    }
    
    .overview-card-value {
        font-size: 18px;
    }
    
    .chart-container {
        padding: 12px;
    }
    
    .chart-wrapper {
        height: 180px;
    }
    
    .distribution-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .distribution-item {
        padding: 8px;
    }
    
    .distribution-label {
        font-size: 10px;
    }
    
    .distribution-count {
        font-size: 12px;
    }
    
    .distribution-percentage {
        font-size: 11px;
    }
    
    .distribution-value {
        font-size: 9px;
    }
    
    .content-section {
        margin-bottom: 1rem;
    }
    
    .section-header {
        padding: 0.8rem;
    }
    
    .token-search-container {
        padding: 0.8rem;
    }
    
    .token-header {
        padding: 0.8rem;
    }
    
    .charts-section {
        padding: 0.8rem;
    }
    
    /* Extra small table */
    .holders-table-container {
        margin: 0 -0.8rem;
        padding: 0 0.8rem;
    }
    
    .holders-table {
        font-size: 0.65rem;
        min-width: 500px;
    }
    
    .holders-table th,
    .holders-table td {
        padding: 3px 2px;
        min-width: 50px;
    }
    
    .holders-table th:first-child,
    .holders-table td:first-child {
        min-width: 100px;
    }
    
    .balance-amount {
        font-size: 0.6rem;
    }
    
    .balance-symbol {
        font-size: 0.55rem;
    }
    
    .usd-value {
        font-size: 0.5rem;
    }
    
    .percentage-value {
        font-size: 0.6rem;
    }
    
    .change-value {
        font-size: 0.6rem;
    }
    
    .table-action-btn {
        padding: 3px 4px;
        font-size: 9px;
        min-width: 20px;
        height: 20px;
    }
    
    /* Extra small screen gainers/losers */
    .gainers-losers-container {
        padding: 0.8rem;
    }
    
    .gainers-column, .losers-column {
        padding: 0.8rem;
    }
    
    .tokens-table {
        min-width: 100%; /* Use full width of container */
        font-size: 0.75rem;
        width: 100%;
    }
    
    .tokens-table thead th {
        padding: 0.3rem 0.15rem;
        font-size: 0.65rem;
    }
    
    .tokens-table td {
        padding: 0.3rem 0.15rem;
    }
    
    /* Make columns more compact on very small screens */
    .tokens-table th:nth-child(1),
    .tokens-table td:nth-child(1) {
        width: 40%; /* Token name column */
    }
    
    .tokens-table th:nth-child(2),
    .tokens-table td:nth-child(2) {
        width: 25%; /* Holders column */
    }
    
    .tokens-table th:nth-child(3),
    .tokens-table td:nth-child(3) {
        width: 20%; /* Change column */
    }
    
    .tokens-table th:nth-child(4),
    .tokens-table td:nth-child(4) {
        width: 15%; /* Actions column */
    }
    
    .token-cell-image {
        width: 18px;
        height: 18px;
        min-width: 18px;
    }
    
    .token-cell-name {
        font-size: 0.7rem;
    }
    
    .token-cell-symbol {
        font-size: 0.65rem;
    }
    
    .holders-cell {
        font-size: 0.7rem;
    }
    
    .change-cell {
        font-size: 0.7rem;
    }
    
    .table-action-btn {
        padding: 2px 4px;
        font-size: 8px;
        min-width: 20px;
        height: 20px;
    }
}
