/* token.css */
body.token-page {
    padding: 0;
    background: #f4f6fb;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 12px rgba(102,126,234,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    height: 60px;
}
.nav-logo {
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.nav-logo span { letter-spacing: 0.5px; }
.nav-links {
    display: flex;
    gap: 6px;
}
.nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}
.nav-search {
    flex: 1;
    max-width: 360px;
    margin-left: auto;
    position: relative;
    display: flex;
    gap: 6px;
}
.nav-search input {
    flex: 1;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    background: rgba(255,255,255,0.15);
    color: white;
    outline: none;
    transition: background 0.2s;
}
.nav-search input::placeholder { color: rgba(255,255,255,0.6); }
.nav-search input:focus { background: rgba(255,255,255,0.25); }
.nav-search button {
    padding: 8px 16px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-search button:hover { background: #f0f2ff; }
.nav-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 60px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 200;
}
.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    transition: background 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.suggestion-item small { color: #10b981; font-size: 0.75rem; }
.suggestion-item:hover { background: #f0f2ff; color: #667eea; }

/* Token container */
.token-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 28px 20px;
}

.token-placeholder {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}
.placeholder-icon { font-size: 4rem; margin-bottom: 16px; }
.token-placeholder h2 { font-size: 1.8rem; color: #333; margin-bottom: 8px; }
.token-placeholder p { font-size: 1rem; color: #888; margin-bottom: 24px; }
.quick-examples { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.quick-examples span { color: #888; font-size: 0.9rem; }
.example-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
    text-decoration: none;
}
.example-tag:hover { opacity: 0.8; }

.token-loading, .token-error {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}
.token-loading .spinner {
    width: 48px; height: 48px;
    border: 5px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.token-error div { font-size: 3rem; margin-bottom: 12px; }
.token-error p { font-size: 1.1rem; color: #888; }

/* Token Hero */
.token-hero {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.hero-left { flex: 1; min-width: 0; }
.hero-symbol {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 6px;
}
.hero-name { font-size: 1.2rem; color: #333; font-weight: 600; margin-bottom: 4px; }
.hero-meta { font-size: 0.85rem; color: #888; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cache-chip {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}
.hero-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}
.hero-chip.spam { background: #fee2e2; color: #991b1b; }
.hero-chip.risk-critical { background: #fee2e2; color: #991b1b; }
.hero-chip.risk-high { background: #fef3c7; color: #92400e; }
.hero-chip.risk-medium { background: #ede9fe; color: #5b21b6; }
.hero-chip.risk-low { background: #d1fae5; color: #065f46; }
.hero-chip.neutral { background: #f0f2ff; color: #667eea; }
.hero-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.risk-circle {
    width: 110px; height: 110px;
    border-radius: 50%;
    border: 8px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.risk-circle:hover {
    transform: scale(1.05);
}
.risk-pct { font-size: 1.5rem; font-weight: 900; line-height: 1; }
.risk-lbl { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #888; margin-top: 2px; }
.risk-rec {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    text-align: center;
    max-width: 200px;
    line-height: 1.4;
}

.token-desc {
    background: white;
    border-radius: 12px;
    padding: 16px 24px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-left: 4px solid #667eea;
}

/* Quick stats bar */
.quick-stats {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    flex-wrap: wrap;
}
.qs-item {
    flex: 1;
    min-width: 100px;
    padding: 16px 20px;
    text-align: center;
    border-right: 1px solid #f0f0f0;
}
.qs-item:last-child { border-right: none; }
.qs-val { font-size: 1.1rem; font-weight: 700; color: #333; }
.qs-lbl { font-size: 0.72rem; color: #888; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Two column layout */
.profile-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.profile-col { display: flex; flex-direction: column; gap: 20px; }

/* Sections */
.p-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.p-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2ff;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Profile grid cards */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}
.profile-card {
    background: #ffffff;
    border: 1px solid #eaecf8;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}
.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.1);
}
.pc-label { font-size: 0.72rem; color: #888; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.pc-value { font-size: 0.9rem; font-weight: 600; color: #333; word-break: break-word; }
.pc-value a { color: #667eea; text-decoration: none; }
.pc-value a:hover { text-decoration: underline; }
.mono { font-family: monospace; font-size: 0.8rem; }
.badge-tag { padding: 2px 8px; border-radius: 4px; font-size: 0.82em; font-weight: 600; }

/* Holders table */
.formula-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    overflow-x: auto;
}
.formula-title {
    font-weight: 700;
    font-size: 13px;
    color: #374151;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.formula-eq {
    font-size: 12px;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-family: monospace;
    line-height: 1.6;
}
.formula-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    font-size: 12px;
}
.formula-table thead tr {
    background: #f1f5f9;
}
.formula-table th {
    padding: 6px 10px;
    text-align: left;
    color: #64748b;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}
.formula-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.formula-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    font-family: monospace;
}
.formula-total-row td {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    padding: 8px 10px;
}
.holders-table-wrap { overflow-x: auto; margin-top: 12px; }
.holders-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.holders-table th { background: #f0f2ff; color: #555; padding: 8px 10px; text-align: left; border-bottom: 2px solid #dde1ff; }
.holders-table td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.holders-table tr:hover { background: #fafbff; }

/* Exchanges */
.exchanges-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.exchange-tag { background: #f0f2ff; color: #667eea; padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; border: 1px solid #dde1ff; }

/* Flags */
.flag-list { border-radius: 8px; padding: 10px 14px; margin-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; line-height: 1.4; }
.flag-list.critical { background: #fff5f5; border: 1px solid #fecaca; color: #991b1b; }
.flag-list.warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.flag-list.positive { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.scam-summary { background: #f8f9ff; border-left: 4px solid #667eea; padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 0.9rem; color: #333; margin: 10px 0; }

/* Sources grid */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 4px;
}
.source-card {
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: 2px solid;
    text-align: center;
    transition: transform 0.2s;
}
.source-card:hover { transform: translateY(-2px); }
.source-active { background: #f0fdf4; border-color: #bbf7d0; }
.source-inactive { background: #fff5f5; border-color: #fecaca; }
.source-link { background: #f0f2ff; border-color: #c7d2fe; }
.source-icon { font-size: 1.6rem; }
.source-name { font-size: 0.8rem; font-weight: 700; color: #333; }
.source-active .source-status { font-size: 0.78rem; color: #166534; font-weight: 600; }
.source-inactive .source-status { font-size: 0.78rem; color: #991b1b; font-weight: 600; }
.source-link .source-status { font-size: 0.78rem; color: #667eea; font-weight: 600; text-decoration: none; }
.source-link .source-status:hover { text-decoration: underline; }

/* Per-Chain expand */
.per-chain-list { display: flex; flex-direction: column; gap: 10px; }
.chain-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.chain-card:hover { box-shadow: 0 4px 14px rgba(102,126,234,0.1); }
.chain-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9ff;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.chain-card-header:hover { background: #f0f2ff; }
.chain-card-left { display: flex; align-items: center; gap: 10px; }
.chain-card-right { display: flex; align-items: center; gap: 10px; }
.chain-network-badge {
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: white;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.chain-hard-skip {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}
.chain-mini-stat {
    font-size: 0.78rem;
    color: #555;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 2px 8px;
    border-radius: 5px;
}
.chain-mini-stat.verdict-low_risk, .chain-mini-stat.verdict-safe { background:#f0fdf4;border-color:#bbf7d0;color:#166534; }
.chain-mini-stat.verdict-high_risk, .chain-mini-stat.verdict-scam { background:#fff5f5;border-color:#fecaca;color:#991b1b; }
.chain-mini-stat.verdict-medium_risk, .chain-mini-stat.verdict-moderate { background:#fffbeb;border-color:#fde68a;color:#92400e; }
.chain-expand-btn {
    background: none;
    border: 1.5px solid #c7d2fe;
    border-radius: 6px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #667eea;
    flex-shrink: 0;
}
.chain-expand-btn:hover { background: #667eea; color: white; border-color: #667eea; }
.expand-arrow { font-size: 0.7rem; display: inline-block; transition: transform 0.25s; }
.chain-expand-btn.open .expand-arrow { transform: rotate(180deg); }
.chain-details {
    display: none;
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: none;
    flex-direction: column;
    gap: 14px;
}
.chain-details.open { display: flex; }
.chain-detail-section { padding-bottom: 12px; border-bottom: 1px dashed #e5e7eb; }
.chain-detail-section:last-child { border-bottom: none; padding-bottom: 0; }
.chain-detail-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.chain-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 7px;
    margin-bottom: 8px;
}

/* Actions */
.token-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
    margin-bottom: 40px;
}
.btn-action {
    padding: 12px 22px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    min-width: 140px;
}
.btn-action.gate { background: #1a56db; color: white; }
.btn-action.cmc { background: #3861fb; color: white; }
.btn-action.gecko { background: #8dc63f; color: white; }
.btn-action.explorer { background: #6b7280; color: white; }
.btn-action:hover { opacity: 0.85; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.btn-clear-cache {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #fff;
    color: #667eea;
    border: 1.5px solid #667eea;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: middle;
    line-height: 1.4;
}
.btn-clear-cache:hover:not(:disabled) {
    background: #667eea;
    color: white;
}
.btn-clear-cache:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .profile-cols { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .quick-stats { overflow-x: auto; flex-wrap: nowrap; }
    .qs-item { min-width: 90px; }
}
@media (max-width: 600px) {
    .nav-inner { padding: 10px 12px; gap: 10px; flex-wrap: wrap; height: auto; }
    .nav-logo { width: 100%; justify-content: center; margin-bottom: 5px; }
    .nav-search { max-width: 100%; width: 100%; margin-left: 0; }
    .nav-search input { width: 100%; }
    .token-container { padding: 14px 10px; }
    .token-hero { padding: 18px 16px; gap: 16px; flex-direction: column; text-align: center; }
    .hero-badges { justify-content: center; }
    .hero-symbol { font-size: 2.2rem; }
    .risk-circle { width: 90px; height: 90px; margin: 0 auto; }
    .risk-pct { font-size: 1.3rem; }
    .profile-grid { grid-template-columns: repeat(2, 1fr); }
    .token-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex-direction: unset; }
    .btn-action { min-width: unset; padding: 10px; font-size: 0.85rem; }
}