* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filters-section, .categories-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    color: #666;
}

.tab-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.st-toggle-btn {
    margin-left: auto;
    border-color: #fbbf24;
    color: #92400e;
}

.st-toggle-btn.active {
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    color: #78350f;
    border-color: #fbbf24;
}

.stat-card-st .stat-value {
    color: #d97706;
}

.tab-btn span {
    font-weight: normal;
    opacity: 0.8;
}

.filters-section h2, .categories-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.filter-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-badge {
    background: #f0f4ff;
    padding: 10px 20px;
    border-radius: 20px;
    color: #667eea;
    font-size: 0.95rem;
}

.filter-badge strong {
    color: #764ba2;
}

.count {
    color: #667eea;
    font-weight: normal;
    font-size: 1.2rem;
}

.search-box {
    margin-bottom: 25px;
}

#searchInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.category-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.tag-name {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.tag-pct {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.88;
    background: rgba(0,0,0,0.18);
    padding: 1px 6px;
    border-radius: 10px;
}
.tag-st {
    font-size: 0.68rem;
    font-weight: 700;
    color: #1e293b;
    background: linear-gradient(135deg, #fde68a, #fbbf24);
    padding: 1px 7px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}
.category-tag.is-st {
    box-shadow: 0 0 0 2px #fbbf24 inset, 0 2px 4px rgba(0,0,0,0.1);
}

.category-tag.trusted {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.category-tag.scam {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.category-tag.undefined {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.category-tag.hidden {
    display: none;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

.error {
    text-align: center;
    padding: 40px;
    color: #d32f2f;
    font-size: 1.1rem;
}

/* Cache Bar */
.cache-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.cache-badge {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}
.cache-badge.cached { background: #d1fae5; color: #065f46; }
.cache-badge.live { background: #dbeafe; color: #1e40af; }
.cache-stats { color: rgba(255,255,255,0.8); font-size: 0.85rem; }
.clear-cache-btn {
    margin-left: auto;
    padding: 7px 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.clear-cache-btn:hover { background: rgba(255,255,255,0.35); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.modal-container {
    position: relative; z-index: 1;
    background: #fff; border-radius: 16px;
    width: 92%; max-width: 780px; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    overflow: hidden;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
.modal-header h2 { font-size: 1.3rem; margin: 0; }
.modal-close {
    background: rgba(255,255,255,0.2); border: none;
    color: white; font-size: 1.2rem; width: 34px; height: 34px;
    border-radius: 50%; cursor: pointer; transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.35); }
.modal-body {
    overflow-y: auto; padding: 20px 24px;
    flex: 1;
}
.modal-loading {
    display: flex; flex-direction: column; align-items: center;
    padding: 60px 20px; color: #666;
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Profile Styles */
.profile-header {
    text-align: center; padding: 16px 0 20px;
    border-bottom: 1px solid #eee; margin-bottom: 16px;
}
.profile-symbol {
    font-size: 2.2rem; font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.profile-name { font-size: 1.1rem; color: #444; font-weight: 600; margin: 4px 0; }
.profile-network { font-size: 0.82rem; color: #888; margin-bottom: 8px; }
.profile-desc { font-size: 0.88rem; color: #555; max-width: 500px; margin: 0 auto 12px; line-height: 1.5; }
.risk-meter { margin-top: 12px; }
.risk-bar-bg { height: 10px; background: #eee; border-radius: 5px; overflow: hidden; max-width: 400px; margin: 0 auto 6px; }
.risk-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s; }
.risk-label { font-size: 0.88rem; font-weight: 600; }

.profile-section {
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.profile-section h3 {
    font-size: 1rem; color: #333; margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}
.profile-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.profile-card {
    background: #f8f9ff; border: 1px solid #eaecf8;
    border-radius: 8px; padding: 10px 12px;
}
.pc-label { font-size: 0.75rem; color: #888; margin-bottom: 4px; }
.pc-value { font-size: 0.9rem; font-weight: 600; color: #333; word-break: break-word; }
.pc-value a { color: #667eea; text-decoration: none; }
.mono { font-family: monospace; font-size: 0.8rem; }

.holders-table-wrap { overflow-x: auto; margin-top: 12px; }
.holders-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.85rem;
}
.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-list { display: flex; flex-wrap: wrap; gap: 8px; }
.exchange-tag {
    background: #f0f2ff; color: #667eea;
    padding: 4px 10px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 600;
    border: 1px solid #dde1ff;
}

.flag-list {
    border-radius: 8px; padding: 10px 14px;
    margin-top: 10px; display: flex; flex-direction: column; gap: 6px;
    font-size: 0.88rem;
}
.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;
}

.profile-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
    padding-top: 16px; margin-top: 4px;
}
.btn-action {
    padding: 10px 18px; border-radius: 8px;
    text-decoration: none; font-weight: 600; font-size: 0.9rem;
    transition: all 0.2s; flex: 1; text-align: center;
}
.btn-action.gate { background: #1a56db; color: white; }
.btn-action.cmc { background: #3861fb; color: white; }
.btn-action.gecko { background: #8dc63f; color: white; }
.btn-action:hover { opacity: 0.85; transform: translateY(-1px); }

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}