:root {
    --bg-light: #ffffff;
    --bg-dark: #1a1c23;
    --card-bg: #f5f5f5;
    --card-bg-dark: #2a2c35;
    --text-primary: #1a1c23;
    --text-secondary: #6b7280;
    --accent: #3b82f6;
    --green: #10b981;
    --red: #ef4444;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 10px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

body.dark {
    background: var(--bg-dark);
    color: #ffffff;
}

/* Navbar Styles */
.navbar {
    background: var(--card-bg);
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.dark .navbar {
    background: var(--card-bg-dark);
    border-bottom: 1px solid #4b5563;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.navbar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

body.dark .navbar-title {
    color: #ffffff;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.navbar-menu li {
    display: inline-block;
}

.navbar-menu a,
.navbar-menu button {
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark .navbar-menu a,
body.dark .navbar-menu button {
    color: #ffffff;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--accent);
}

body.dark .navbar-menu a.active {
    color: var(--accent);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

body.dark .navbar-toggle {
    color: #ffffff;
}

@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
        background: var(--card-bg);
        padding: 1rem 0;
        position: absolute;
        top: 100%;
        left: 0;
        border-top: 1px solid #e5e7eb;
    }

    body.dark .navbar-menu {
        background: var(--card-bg-dark);
        border-top: 1px solid #4b5563;
    }

    .navbar-menu.active {
        display: flex;
    }

    .navbar-container {
        flex-wrap: wrap;
    }
}

/* General Page Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding-left: 2px;
        padding-right: 2px;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

.section {
    margin-bottom: 3rem;
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Coin List Styles */
.coin-list {
    list-style: none;
    padding: 0;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

body.dark .coin-list {
    background: var(--card-bg-dark);
}

.coin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

body.dark .coin-item {
    border-bottom: 1px solid #4b5563;
}

.coin-item:last-child {
    border-bottom: none;
}

.coin-item:hover {
    background: #e5e7eb;
}

body.dark .coin-item:hover {
    background: #4b5563;
}

.coin-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.coin-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.coin-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.coin-stats {
    display: flex;
    gap: 1.5rem;
    text-align: right;
}

.coin-stat {
    font-size: 0.875rem;
}

.coin-stat span {
    display: block;
    color: var(--text-secondary);
}

body.dark .coin-stat span {
    color: #d1d5db;
}

.percent-up {
    color: var(--green);
}

.percent-down {
    color: var(--red);
}

.alert {
    background: #fef2f2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2rem;
}

body.dark .alert {
    background: #7f1d1d;
    color: #f87171;
}

/* Chain Page Specific Styles */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chain-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.page-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Coin Page Specific Styles */
.coin-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.verified-tick {
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.coin-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.coin-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.coin-links a {
    color: var(--accent);
    text-decoration: none;
}

.coin-links a:hover {
    text-decoration: underline;
}

.contract-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contract-address {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

body.dark .contract-address {
    background: var(--card-bg-dark);
    color: #d1d5db;
}

.copy-button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.copy-button:hover {
    background: #2563eb;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
}

body.dark .stat-card {
    background: var(--card-bg-dark);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.fade-update {
    animation: fade 0.5s ease-in-out;
}

@keyframes fade {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.info-section {
    margin-top: 2rem;
}

.info-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.info-section p {
    font-size: 1rem;
    color: var(--text-secondary);
}

.chart-section {
    margin-top: 2rem;
}

.chart-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.chart-wrapper iframe {
    width: 100%;
    height: 435px;
    border: none;
}

.holders-bubble-map-section {
    margin-top: 2rem;
}

.holders-bubble-map-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.token-description-section {
    margin-top: 2rem;
}

.token-description-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.token-description-section img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.token-description-section p {
    font-size: 1rem;
    color: var(--text-secondary);
    white-space: pre-line;
}

.categories-section {
    margin-top: 2rem;
}

.categories-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: inherit;
}

.category-tag {
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    display: inline;
    border-radius: 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

body.dark .category-tag {
    background: var(--card-bg-dark);
    color: #ffffff;
}

.trading-stats-section {
    margin-top: 2rem;
}

.trading-stats-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Social Signals Section Styles */
.social-signals-section {
    margin-top: 2rem;
}

.social-signals-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.social-signals-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

body.dark .social-signals-section h3 {
    color: #ffffff;
}

.signals-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.signal-item {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--text-primary);
}

body.dark .signal-item {
    color: #d1d5db;
}

.signal-item strong {
    font-weight: 600;
    margin-right: 0.5rem;
}

.bullish-signal {
    background: #ccffcc; /* Light green for bullish in light mode */
}

body.dark .bullish-signal {
    background: #2a4d2a; /* Darker green for bullish in dark mode */
}

.bearish-signal {
    background: #ffcccc; /* Light red for bearish in light mode */
}

body.dark .bearish-signal {
    background: #4d2a2a; /* Darker red for bearish in dark mode */
}

/* Tab Styles */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

body.dark .tabs {
    border-bottom: 1px solid #4b5563;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s, border-bottom 0.3s;
    border-bottom: 2px solid transparent;
}

body.dark .tab-button {
    color: #d1d5db;
}

.tab-button:hover {
    color: var(--accent);
}

.tab-button.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.age-section {
    margin-top: 2rem;
}

.age-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.age-section p {
    font-size: 1rem;
    color: var(--text-secondary);
}

.holders-section {
    margin-top: 2rem;
}

.holders-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.holders-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

body.dark .holders-table {
    background: var(--card-bg-dark);
}

.holders-table th,
.holders-table td {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.875rem;
    border-bottom: 1px solid #e5e7eb;
}

body.dark .holders-table th,
body.dark .holders-table td {
    border-bottom: 1px solid #4b5563;
}

.holders-table th {
    background: #e5e7eb;
    font-weight: 600;
    color: var(--text-primary);
}

body.dark .holders-table th {
    background: #4b5563;
    color: #ffffff;
}

.holders-table td {
    color: var(--text-secondary);
}

body.dark .holders-table td {
    color: #d1d5db;
}

.holders-table tr:last-child td {
    border-bottom: none;
}

.error-message {
    color: var(--red);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.download-cta-section {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.2s ease, background 0.3s ease;
    box-shadow: var(--shadow);
}

body.dark .download-btn {
    background: var(--card-bg-dark);
    color: #ffffff;
}

.download-btn:hover {
    transform: scale(1.05);
    background: var(--accent);
    color: white;
}

.download-btn img {
    width: 20px;
    height: 20px;
}

.download-btn span {
    display: block;
    font-size: 1rem;
    font-weight: 600;
}

/* FAQ Section Styles */
.faq-section {
    margin-top: 2rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

body.dark .faq-section {
    background: var(--card-bg-dark);
}

.faq-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

body.dark .faq-section h2 {
    color: #ffffff;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

body.dark .faq-item {
    border-bottom: 1px solid #4b5563;
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.coin-header-description {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

body.dark .coin-header-description {
    color: #d1d5db;
}

body.dark .faq-item h3 {
    color: #ffffff;
}

.faq-item p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer Styles */
footer {
    background: var(--card-bg);
    padding: 3rem 0;
    border-top: 1px solid #e5e7eb;
}

body.dark footer {
    background: var(--card-bg-dark);
    border-top: 1px solid #4b5563;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    text-decoration: none;
}

.footer-logo img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.footer-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.footer-links h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.footer-social h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-right: 1rem;
}

.footer-social a {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.footer-social a:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid #e5e7eb;
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

body.dark .footer-bottom {
    border-top: 1px solid #4b5563;
}

/* Responsive styling for holders table */
.holders-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
}

body.dark .holders-table {
    background: var(--card-bg-dark);
}

.holders-table th,
.holders-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

body.dark .holders-table th,
body.dark .holders-table td {
    border-bottom: 1px solid #4b5563;
}

.holders-table th {
    background-color: #e5e7eb;
    font-weight: 600;
    color: var(--text-primary);
}

body.dark .holders-table th {
    background: #4b5563;
    color: #ffffff;
}

.holders-table td {
    color: var(--text-secondary);
    word-break: break-all;
}

body.dark .holders-table td {
    color: #d1d5db;
}

.holders-table tbody tr:hover {
    background-color: #e5e7eb;
}

body.dark .holders-table tbody tr:hover {
    background-color: #4b5563;
}

/* Make table responsive on smaller screens */
@media (max-width: 768px) {
    .holders-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .holders-table {
        min-width: 600px;
    }

    .holders-table th,
    .holders-table td {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .holders-table td {
        word-break: break-all;
    }

    .stat-card .stat-label {
        font-size: 0.9rem;
    }

    .stat-card .stat-value {
        font-size: 0.8rem;
    }

    .stat-card .copy-button {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .holders-table th,
    .holders-table td {
        font-size: 0.7rem;
        padding: 0.4rem;
    }

    .stat-card .stat-label {
        font-size: 0.8rem;
    }

    .stat-card .stat-value {
        font-size: 0.7rem;
    }

    .stat-card .copy-button {
        font-size: 0.7rem;
    }

    .stat-card .copy-button svg {
        width: 14px;
        height: 14px;
    }
}

/* Updated: Trending Now Section Styles */
.trending-now-section {
    position: relative;
    overflow: hidden;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

body.dark .trending-now-section {
    background: var(--card-bg-dark);
}

.trending-now-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    background: var(--card-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    position: relative;
    z-index: 3;
}

body.dark .trending-now-section h2 {
    background: var(--card-bg-dark);
}

.trending-now-section h2::before {
    content: '🔥';
    font-size: 1.2rem;
}

.trending-now-list {
    display: inline-flex;
    animation: scroll 20s linear infinite;
    white-space: nowrap;
    flex: 1;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 2;
}

.trending-now-item {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    background: #e5e7eb;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

body.dark .trending-now-item {
    background: #4b5563;
    color: #ffffff;
}

.trending-now-item:hover {
    background: var(--accent);
    color: white;
}

.trending-now-item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.trending-now-list:hover {
    animation-play-state: paused;
}

#holders-bubble-map-iframe {
    height: 400px;
}

/* Responsive adjustments for Trending Now */
@media (max-width: 768px) {
    .trending-now-section {
        gap: 0.75rem;
    }

    .trending-now-section h2 {
        font-size: 1rem;
    }

    .trending-now-item {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin-right: 0.75rem;
    }

    .trending-now-item img {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .trending-now-section h2 {
        font-size: 0.9rem;
    }

    .trending-now-item {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        margin-right: 0.5rem;
    }

    .trending-now-item img {
        width: 18px;
        height: 18px;
    }
}