/* ============================================
   HOME PAGE / TOKENS PAGE STYLES
   ============================================ */

.logo { text-decoration: none; }

/* Home Dashboard */
.home-dashboard {
    max-width: 1200px;
}

.home-hero {
    text-align: center;
    padding: 32px 0 24px;
}

.home-hero-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.home-hero-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.home-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

@media (max-width: 768px) {
    .home-grid-2 { grid-template-columns: 1fr; }
}

/* Quick Links */
.home-quick-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.home-quick-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.home-quick-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--card-glow);
}

.home-quick-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.home-quick-desc {
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .home-quick-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .home-quick-links { grid-template-columns: 1fr; }
}

/* Tokens Page */
.home-content {
    max-width: 1400px;
}

/* Refresh Controls Container */
.refresh-controls-container {
    margin-bottom: var(--space-md);
}

/* Search Wrapper */
.search-wrapper {
    position: relative;
    flex: 1;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}

.search-results.visible { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-item:last-child { border-bottom: none; }

.search-result-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-primary);
}

.search-result-info { flex: 1; }
.search-result-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.search-result-symbol { font-size: 12px; color: var(--accent); }
.search-result-price { text-align: right; font-size: 13px; color: var(--text-secondary); }

/* Main Tabs */
.main-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.main-tab {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.main-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.main-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Tab Panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Section */
.section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.refresh-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-sm);
    color: var(--accent-light);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.refresh-btn:hover {
    background: var(--btn-bg-hover);
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.loading-indicator .spinner {
    width: 24px;
    height: 24px;
}

/* Error Message */
.error-message {
    padding: var(--space-lg);
    text-align: center;
    color: var(--negative);
    background: rgba(var(--negative-rgb), 0.08);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

/* Tokens Table */
.tokens-table {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.tokens-header {
    display: grid;
    grid-template-columns: 50px 2fr 1fr 1fr 1fr 1fr;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tokens-header.pumpfun-header {
    grid-template-columns: 50px 2fr 1fr 1fr 1fr;
}

.tokens-body {
    max-height: 600px;
    overflow-y: auto;
}

.token-row {
    display: grid;
    grid-template-columns: 50px 2fr 1fr 1fr 1fr 1fr;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    transition: var(--transition);
    cursor: pointer;
    align-items: center;
}

.token-row:hover { background: var(--bg-card-hover); }
.token-row:last-child { border-bottom: none; }

.pumpfun-header + .tokens-body .token-row {
    grid-template-columns: 50px 2fr 1fr 1fr 1fr;
}

.token-rank { color: var(--text-muted); font-weight: 600; }
.token-info { display: flex; align-items: center; gap: var(--space-sm); }
.token-logo { width: 32px; height: 32px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg-secondary); }
.token-names { display: flex; flex-direction: column; }
.token-name { font-weight: 600; color: var(--text-primary); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.token-symbol { font-size: 11px; color: var(--accent); }
.token-price { font-weight: 500; color: var(--text-primary); }
.token-change { font-weight: 600; }
.token-change.positive { color: var(--positive); }
.token-change.negative { color: var(--negative); }
.token-volume, .token-mcap { color: var(--text-secondary); }
.token-time { color: var(--text-muted); font-size: 12px; }

/* Progress Bar for Bonding */
.progress-bar { width: 100%; height: 6px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-blue)); border-radius: 3px; transition: width 0.5s ease; }
.progress-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.circular-progress { position: relative; width: 48px; height: 48px; }
.circular-progress svg { transform: rotate(-90deg); }
.circular-progress .progress-ring { fill: transparent; stroke: var(--bg-secondary); stroke-width: 4; }
.circular-progress .progress-value { fill: transparent; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.circular-progress .progress-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 10px; font-weight: 600; color: var(--text-primary); }

/* Analytics Charts */
.analytics-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    max-height: 500px;
}

.analytics-chart-container {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    height: 200px;
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.analytics-chart-container.full-width { grid-column: 1 / -1; height: 250px; max-height: 250px; }
.analytics-chart-container canvas { max-height: 100% !important; width: 100% !important; }

.chart-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

/* DexScreener */
.dexscreener-controls { display: flex; align-items: center; gap: var(--space-md); }
.timeframe-selector { display: flex; gap: var(--space-xs); background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px; }
.timeframe-btn { padding: var(--space-sm) var(--space-md); background: transparent; border: none; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--transition); min-height: 32px; min-width: 40px; }
.timeframe-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.timeframe-btn.active { background: var(--accent); color: #fff; }

.dexscreener-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); margin-top: var(--space-lg); }
.dexscreener-section { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); }
.dexscreener-section-title { font-size: 13px; font-weight: 600; color: var(--text-heading); margin-bottom: var(--space-md); text-transform: uppercase; letter-spacing: 0.5px; }

.tokens-table.compact { border: none; }
.tokens-table.compact .tokens-body { max-height: 350px; }

.dexscreener-header { grid-template-columns: 40px 2fr 1fr 1fr 1fr !important; }
.dexscreener-row { grid-template-columns: 40px 2fr 1fr 1fr 1fr !important; }
.dexscreener-row .token-name { max-width: 100px; font-size: 12px; }
.dexscreener-row .token-symbol { font-size: 10px; }
.dexscreener-row .token-logo { width: 24px; height: 24px; }
.dexscreener-row .token-price, .dexscreener-row .token-change, .dexscreener-row .token-volume, .dexscreener-row .token-time { font-size: 12px; }

/* Quick Links */
.quick-links { display: flex; gap: var(--space-md); margin-top: var(--space-lg); flex-wrap: wrap; }
.quick-link { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: var(--transition); }
.quick-link:hover { border-color: var(--accent); color: var(--accent); }

/* Empty State */
.empty-state { text-align: center; padding: var(--space-2xl); color: var(--text-muted); }
.empty-hint { font-size: 13px; margin-top: 8px; }

/* Responsive */
@media (max-width: 1024px) {
    .tokens-header, .token-row { grid-template-columns: 40px 2fr 1fr 1fr; }
    .tokens-header span:nth-child(5), .tokens-header span:nth-child(6), .token-row > *:nth-child(5), .token-row > *:nth-child(6) { display: none; }
    .tokens-header.pumpfun-header, .pumpfun-header + .tokens-body .token-row { grid-template-columns: 40px 2fr 1fr 1fr; }
    .tokens-header.pumpfun-header span:nth-child(5), .pumpfun-header + .tokens-body .token-row > *:nth-child(5) { display: none; }
    .dexscreener-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .main-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: var(--space-sm); scrollbar-width: none; }
    .main-tabs::-webkit-scrollbar { display: none; }
    .main-tab { white-space: nowrap; flex-shrink: 0; padding: var(--space-sm) var(--space-md); font-size: 12px; }
    .tokens-header, .token-row { grid-template-columns: 30px 2fr 1fr; }
    .tokens-header span:nth-child(4), .token-row > *:nth-child(4) { display: none; }
    .token-name { max-width: 100px; }
    .analytics-charts { grid-template-columns: 1fr; }
    .dexscreener-controls { flex-direction: column; align-items: stretch; gap: var(--space-sm); }
    .timeframe-selector { justify-content: center; }
}

@media (max-width: 640px) {
    .tokens-header, .dexscreener-header { display: none; }
    .token-row { display: block; position: relative; padding: var(--space-md); border-radius: var(--radius-md); margin-bottom: var(--space-sm); }
    .token-row .token-rank { position: absolute; top: var(--space-sm); right: var(--space-sm); background: var(--bg-secondary); padding: 2px 6px; border-radius: var(--radius-sm); font-size: 10px; }
    .token-row .token-info { margin-bottom: var(--space-sm); }
    .token-row .token-price { display: block; font-size: 18px; font-weight: 700; margin: var(--space-sm) 0; }
    .token-row .token-change { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12px; }
    .token-row .token-change.positive { background: rgba(var(--positive-rgb), 0.1); }
    .token-row .token-change.negative { background: rgba(var(--negative-rgb), 0.1); }
    .token-row .token-volume, .token-row .token-mcap { display: none; }
    .dexscreener-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); padding: var(--space-sm); }
    .dexscreener-row .token-rank { position: absolute; right: var(--space-xs); top: var(--space-xs); background: var(--bg-secondary); padding: 2px 6px; border-radius: var(--radius-sm); font-size: 9px; }
    .dexscreener-row .token-info { width: 100%; }
    .dexscreener-row .token-price { font-weight: 600; }
    .quick-links { flex-direction: column; }
    .quick-link { width: 100%; justify-content: center; }
    .home-hero-title { font-size: 22px; }
}
