/**
 * Crypto ERC20 Tracker - Frontend Styles
 * Card-style list + Token detail page
 */

.crypto-tracker-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 100%;
    margin: 1.5rem 0;
    color: #333;
    background: #fff;
}

/* —— List mode —— */
.crypto-tracker-search {
    margin-bottom: 1.25rem;
}

.crypto-tracker-search-input {
    width: 100%;
    max-width: 400px;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.crypto-tracker-search-input:focus {
    outline: none;
    border-color: #53225d;
    box-shadow: 0 0 0 3px rgba(71, 25, 81, 0.2);
}

.crypto-tracker-search-input::placeholder {
    color: #9ca3af;
}

.crypto-tracker-table-wrap {
    overflow-x: auto;
    background: transparent;
    border: none;
}

.crypto-tracker-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    font-size: 0.9375rem;
}

.crypto-tracker-table thead {
    display: none;
}

.crypto-tracker-table tbody tr {
    background: #f5f5f5;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
}

.crypto-tracker-table tbody tr:hover {
    background: #53225d !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.crypto-tracker-table tbody tr.crypto-tracker-row-link:hover td {
    color: rgba(255, 255, 255, 0.95);
}

.crypto-tracker-table tbody tr.crypto-tracker-row-link:hover strong,
.crypto-tracker-table tbody tr.crypto-tracker-row-link:hover .crypto-tracker-price-value,
.crypto-tracker-table tbody tr.crypto-tracker-row-link:hover .crypto-tracker-change-positive,
.crypto-tracker-table tbody tr.crypto-tracker-row-link:hover .crypto-tracker-change-negative {
    color: rgba(255, 255, 255, 0.95);
}

.crypto-tracker-table tbody tr.crypto-tracker-row-link {
    cursor: pointer;
}

.crypto-tracker-table tbody tr td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border: none;
    background: transparent;
}

.crypto-tracker-table tbody tr td:first-child {
    border-radius: 10px 0 0 10px;
    padding-left: 1.25rem;
    color: #888;
    font-size: 0.875rem;
    width: 2.5rem;
}

.crypto-tracker-table tbody tr td:nth-child(2) {
    font-weight: 600;
    color: #333;
    min-width: 5rem;
}

.crypto-tracker-table tbody tr td:nth-child(3) {
    color: #333;
}

.crypto-tracker-table tbody tr td:nth-child(4) {
    color: #53225d;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.crypto-tracker-table tbody tr td:nth-child(5) {
    text-align: right;
}

.crypto-tracker-table tbody tr td:nth-child(6) {
    text-align: right;
    color: #333;
}

.crypto-tracker-table tbody tr td:nth-child(7) {
    text-align: center;
}

.crypto-tracker-table tbody tr td:last-child {
    border-radius: 0 10px 10px 0;
    padding-right: 1.25rem;
}

.crypto-tracker-price-value {
    color: #53225d;
    font-weight: 500;
}

.crypto-tracker-change-positive {
    color: #16a34a;
    font-weight: 500;
}

.crypto-tracker-change-negative {
    color: #dc2626;
    font-weight: 500;
}

.crypto-tracker-sentiment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: #ffc107;
    font-size: 1.125rem;
}

.crypto-tracker-loading td {
    text-align: center;
    padding: 2.5rem;
    color: #6b7280;
    background: #f9fafb !important;
    border-radius: 10px;
}

.crypto-tracker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.crypto-tracker-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #53225d;
    color: #53225d;
}

.crypto-tracker-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.crypto-tracker-btn-view {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.crypto-tracker-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.crypto-tracker-page-info {
    font-size: 0.875rem;
    color: #6b7280;
}

/* —— Detail mode —— */
.crypto-back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9375rem;
}

.crypto-back-link:hover {
    color: #53225d;
}

.crypto-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.crypto-detail-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111;
}

.crypto-detail-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.375rem;
}

.crypto-stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.crypto-stat-card {
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.crypto-stat-label {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.crypto-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
}

.crypto-stat-price .crypto-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #53225d;
}

.crypto-range-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.crypto-range-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.crypto-range-btn:hover {
    border-color: #53225d;
    color: #53225d;
}

.crypto-range-btn.active {
    background: #53225d;
    border-color: #53225d;
    color: #fff;
}

.crypto-chart-container {
    position: relative;
    width: 100%;
    height: 450px;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.crypto-chart-container canvas {
    max-height: 100%;
}

/* Hide list-only elements in detail mode */
.crypto-tracker-mode-detail .crypto-tracker-search,
.crypto-tracker-mode-detail .crypto-tracker-table-wrap,
.crypto-tracker-mode-detail .crypto-tracker-pagination {
    display: none;
}

/* Hide detail-only elements in list mode */
.crypto-tracker-mode-list .crypto-back-link,
.crypto-tracker-mode-list .crypto-detail-header,
.crypto-tracker-mode-list .crypto-stat-cards,
.crypto-tracker-mode-list .crypto-range-buttons,
.crypto-tracker-mode-list .crypto-chart-container {
    display: none;
}

/* Responsive */
@media (max-width: 640px) {
    .crypto-tracker-col-volume {
        display: none !important;
    }

    .crypto-tracker-table td.crypto-tracker-col-volume,
    .crypto-tracker-table th.crypto-tracker-col-volume {
        display: none !important;
    }

    .crypto-stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .crypto-chart-container {
        height: 350px;
    }
}