/* DexScreener Token Tracker - Frontend Styles */

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --grid-bg-color: #2a2a2a;
    --positive-color: #4CAF50;
    --negative-color: #f44336;
    --chart-button-color: #2196F3;
}

/* Token List Container */
.dst-token-list {
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 20px;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Controls & Filters */
.dst-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.dst-sort-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dst-sort-control label {
    font-weight: 600;
    font-size: 14px;
}

.dst-sort-btn {
    padding: 8px 16px;
    background-color: var(--grid-bg-color);
    border: 2px solid transparent;
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.dst-sort-btn:hover {
    border-color: var(--primary-color);
}

.dst-sort-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.dst-toggle-filters {
    padding: 8px 16px;
    background-color: var(--secondary-color);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s;
}

.dst-toggle-filters:hover {
    opacity: 0.9;
}

.dst-filter-icon {
    font-size: 16px;
}

.dst-filters {
    background-color: var(--grid-bg-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.dst-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.dst-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dst-filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.dst-filter-input {
    padding: 8px 12px;
    background-color: var(--background-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
}

.dst-filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dst-filter-actions {
    display: flex;
    gap: 10px;
}

.dst-apply-filters,
.dst-reset-filters {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.dst-apply-filters {
    background-color: var(--primary-color);
    color: white;
}

.dst-reset-filters {
    background-color: var(--grid-bg-color);
    color: var(--text-color);
}

.dst-apply-filters:hover,
.dst-reset-filters:hover {
    opacity: 0.9;
}

/* User Token Search */
.dst-user-search {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--grid-bg-color);
    border-radius: 8px;
}

.dst-search-wrapper {
    position: relative;
    max-width: 100%;
}

.dst-search-input {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--background-color);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 15px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.dst-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dst-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.dst-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background-color: var(--background-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dst-search-loading {
    padding: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.dst-search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dst-search-result-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dst-search-result-item:last-child {
    border-bottom: none;
}

.dst-search-result-item.dst-already-added {
    opacity: 0.6;
    cursor: not-allowed;
}

.dst-search-result-item.dst-already-added:hover {
    background-color: transparent;
}

.dst-search-result-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.dst-search-result-info {
    flex: 1;
}

.dst-search-result-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.dst-search-result-details {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.dst-search-result-chain {
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--primary-color);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.dst-search-no-results {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Hidden rows */
.dst-token-row.hidden,
.dst-token-card.hidden {
    display: none !important;
}

/* Table Layout */
.dst-table-container {
    overflow-x: auto;
    border-radius: 8px;
    width: 100%;
}

.dst-token-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--grid-bg-color);
}

.dst-token-table thead {
    background-color: rgba(255, 255, 255, 0.05);
}

.dst-token-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--primary-color);
}

.dst-token-table td {
    padding: 15px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dst-token-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.dst-chain {
    display: inline-block;
    padding: 4px 8px;
    background-color: var(--primary-color);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.dst-token-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dst-token-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.dst-token-name {
    font-weight: 500;
}

.dst-ticker {
    color: var(--primary-color);
}

.dst-change.positive {
    color: var(--positive-color);
}

.dst-change.negative {
    color: var(--negative-color);
}

/* Grid Layout */
.dst-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.dst-token-card {
    background-color: var(--grid-bg-color);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dst-token-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.dst-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dst-card-number {
    font-weight: 600;
    color: var(--secondary-color);
}

.dst-card-chain {
    padding: 4px 8px;
    background-color: var(--primary-color);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.dst-card-token {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.dst-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.dst-card-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.dst-card-ticker {
    color: var(--primary-color);
    font-size: 14px;
}

.dst-card-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dst-card-price-section .dst-price {
    font-size: 24px;
    font-weight: 700;
}

.dst-card-price-section .dst-change {
    font-size: 18px;
    font-weight: 600;
}

.dst-card-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dst-card-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dst-stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* Single Token View */
.dst-single-token {
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 20px;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Desktop view - horizontal layout */
.dst-single-desktop {
    display: block;
}

.dst-single-horizontal-card {
    background-color: var(--grid-bg-color);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.dst-single-token-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dst-single-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.dst-single-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.dst-single-ticker {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}

.dst-single-chain-badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--primary-color);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.dst-single-metrics-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    margin-top: 0;
}

.dst-single-metric-item {
    background-color: var(--grid-bg-color);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.dst-single-metric-item:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 12px;
}

.dst-single-metric-item:last-child {
    border-bottom-right-radius: 12px;
}

.dst-single-metric-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.dst-single-metric-value {
    font-size: 20px;
    font-weight: 700;
}

/* Mobile view - hidden by default */
.dst-single-mobile {
    display: none;
    background-color: var(--grid-bg-color);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile card styling - matches grid cards */
.dst-single-card-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.dst-single-card-token {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.dst-single-card-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.dst-single-card-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.dst-single-card-ticker {
    color: var(--primary-color);
    font-size: 14px;
}

.dst-single-card-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dst-single-card-price-section .dst-price {
    font-size: 24px;
    font-weight: 700;
}

.dst-single-card-price-section .dst-change {
    font-size: 18px;
    font-weight: 600;
}

.dst-single-card-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dst-single-card-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dst-single-stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Toggle & Container */
.dst-chart-toggle-container {
    margin-top: 20px;
    text-align: center;
}

.dst-chart-toggle-btn {
    background-color: var(--chart-button-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s, transform 0.2s;
}

.dst-chart-toggle-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.dst-chart-toggle-btn:active {
    transform: translateY(0);
}

.dst-chart-btn-icon {
    transition: transform 0.3s;
    display: inline-block;
}

.dst-chart-toggle-btn[data-chart-visible="true"] .dst-chart-btn-icon {
    transform: rotate(180deg);
}

.dst-chart-container {
    margin-top: 20px;
}

.dst-chart-container.dst-chart-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.dst-chart-container.dst-chart-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    animation: slideDown 0.3s ease-out;
    position: relative !important;
    z-index: 1 !important;
}

/* Extra specificity to override any theme styles */
.dst-single-token .dst-chart-container.dst-chart-visible,
.dst-single-desktop .dst-chart-container.dst-chart-visible,
.dst-single-mobile .dst-chart-container.dst-chart-visible {
    display: block !important;
    visibility: visible !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dexscreener-embed {
    position: relative;
    width: 100%;
    padding-bottom: 125%;
    background-color: var(--grid-bg-color);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 1400px) {
    .dexscreener-embed {
        padding-bottom: 65%;
    }
}

.dexscreener-embed iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border: 0;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.dst-updating {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes priceUp {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(76, 175, 80, 0.3);
    }
}

@keyframes priceDown {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(244, 67, 54, 0.3);
    }
}

.dst-price.price-up {
    animation: priceUp 1s ease-in-out;
}

.dst-price.price-down {
    animation: priceDown 1s ease-in-out;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .dst-table-container {
        font-size: 14px;
    }
    
    .dst-token-table th,
    .dst-token-table td {
        padding: 10px 8px;
    }
    
    .dst-grid-container {
        grid-template-columns: 1fr;
    }
    
    /* Single token - swap views */
    .dst-single-token {
        padding: 0;
        background-color: transparent;
    }
    
    .dst-single-desktop {
        display: none;
    }
    
    .dst-single-mobile {
        display: block;
    }
}