:root {
    /* Logo Colors */
    --clr-magenta: #da1c5c;
    --clr-orange: #f5821f;
    --clr-lime: #b4d435;
    --clr-cyan: #4dc2e5;

    --primary: var(--clr-cyan);
    --secondary: var(--clr-magenta);
    --accent: var(--clr-lime);
    --bg-dark: #0a0a0f;
    --card-bg: rgba(20, 20, 30, 0.7);
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --border: rgba(255, 255, 255, 0.1);

    --up: var(--clr-lime);
    --down: var(--clr-magenta);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
}

.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    filter: blur(80px);
    opacity: 0.15;
    border-radius: 50%;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--clr-magenta);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--clr-cyan);
    bottom: -100px;
    right: -100px;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--clr-lime);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-content {
    display: grid;
    grid-template-areas:
        "balance chart"
        "distribution chart"
        "activity info";
    grid-template-columns: 1fr 1.5fr;
    grid-template-rows: auto auto 1fr;
    gap: 20px;
    flex: 1;
}

#balance-section {
    grid-area: balance;
}

#distribution-section {
    grid-area: distribution;
}

#activity-section {
    grid-area: activity;
}

#chart-section {
    grid-area: chart;
}

#info-section {
    grid-area: info;
}

.header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-container {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #000;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(77, 194, 229, 0.3);
    flex-shrink: 0;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.5);
    /* Higher zoom to completely hide white background corners */
    display: block;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, var(--clr-cyan), var(--clr-lime));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.wallet-info {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}


.header-actions {
    display: flex;
    align-items: stretch;
    /* All buttons same height */
    gap: 12px;
    margin-top: 4px;
}

/* ... existing button styles ... */


.chart-link-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(77, 194, 229, 0.1);
    border: 1px solid rgba(77, 194, 229, 0.3);
    border-radius: 20px;
    color: var(--clr-cyan);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chart-link-btn:hover {
    background: rgba(77, 194, 229, 0.2);
    border-color: var(--clr-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 194, 229, 0.2);
}

.btn-icon {
    font-size: 0.9rem;
}

.buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    background: var(--clr-lime);
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.8rem;
    /* Adjusted for better alignment with the chart button */
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(180, 212, 53, 0.3);
}

.buy-btn:hover {
    background: #c5e53e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(180, 212, 53, 0.4);
}

.wallet-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wallet-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--clr-orange);
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.chart-section {
    position: relative;
    overflow: hidden;
}

.chart-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--clr-cyan), var(--clr-lime), var(--clr-orange), var(--clr-magenta));
}

/* Main Content Sections */
.balance-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.total-supply-info {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-dim);
}

.supply-label {
    font-weight: 500;
}

#totalSupplyValue {
    color: var(--clr-orange);
    font-weight: 700;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--clr-magenta), var(--clr-orange), var(--clr-lime), var(--clr-cyan));
}

.balance-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.balance-value {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 5px 0;
    color: var(--text-main);
}

.token-symbol {
    font-size: 1rem;
    color: var(--clr-cyan);
    margin-left: 4px;
}

.balance-percentage {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 600;
}

/* Trends Section */
.trends-section .section-title {
    font-size: 1rem;
    margin-bottom: 10px;
}

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

.trend-card {
    padding: 10px;
    text-align: center;
}

.trend-timeframe {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.trend-arrow {
    font-size: 1.2rem;
    margin: 2px 0;
}

.trend-change {
    font-size: 0.9rem;
    font-weight: 600;
}

.trend-percent {
    font-size: 0.8rem;
}

.trend-card.up {
    border-left: 3px solid var(--down);
    color: var(--down);
}

.trend-card.down {
    border-left: 3px solid var(--up);
    color: var(--up);
}

.trend-card.neutral {
    border-left: 3px solid var(--text-dim);
}

/* Distribution Stats Section */
.distribution-stats {
    position: relative;
    overflow: hidden;
}

.distribution-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--clr-lime), var(--clr-cyan));
}

.dist-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dist-stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(180, 212, 53, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--clr-lime);
    transition: all 0.2s ease;
}

.dist-stat-item:hover {
    background: rgba(180, 212, 53, 0.1);
    transform: translateX(3px);
}

.dist-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.dist-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.dist-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dist-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--clr-lime);
}

/* Distribution Progress Bar */
.dist-progress-container {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(180, 212, 53, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
    margin-left: 47px; /* Aligns with dist-content text (icon 32px + gap 15px) */
}

.dist-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--clr-lime), var(--clr-cyan));
    border-radius: 4px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 8px rgba(180, 212, 53, 0.4);
}

/* Animated shimmer effect */
.dist-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.dist-progress-label {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-main);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
    pointer-events: none;
}

/* Enhanced hover effect for stat item with progress */
.dist-stat-item:has(.dist-progress-container):hover {
    background: rgba(180, 212, 53, 0.12);
}

/* Distribution Processing Info */
.dist-processing-info {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 6px;
    margin-left: 47px; /* Align with progress bar */
    margin-bottom: 2px;
}

.dist-processing-info span {
    color: var(--text-main);
    font-weight: 600;
}

/* Right Column */
.right-col {
    grid-area: right;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chart-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chart-container {
    flex: 1;
    min-height: 200px;
}

.section-title {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Projections */
.projections-section .projections-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.projection-card {
    padding: 10px;
    text-align: center;
}

.projection-threshold {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--clr-cyan);
}

.projection-date {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.projection-zero .projection-threshold {
    color: var(--clr-magenta);
}

/* Loading & Error */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    gap: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--clr-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
}

.retry-btn {
    background: var(--clr-cyan);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
}

.footer {
    grid-area: footer;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.hidden {
    display: none !important;
}

/* Info & Support Section Styling */
.info-support-section {
    margin-top: 20px;
    padding: 15px;
    font-size: 0.9rem;
}

.disclaimer-text {
    color: var(--text-dim);
    line-height: 1.4;
    margin-bottom: 12px;
    font-style: italic;
    font-size: 0.8rem;
}

.support-links {
    margin-bottom: 15px;
}

.support-links {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--clr-cyan);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.social-link:hover {
    background: rgba(77, 194, 229, 0.1);
    border-color: rgba(77, 194, 229, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.social-icon-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    opacity: 0.9;
}

.profile-pic {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.donations-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.donation-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.donation-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--clr-orange);
    text-transform: uppercase;
}

.wallet-addr {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 8px;
    border-radius: 4px;
    word-break: break-all;
    color: var(--clr-cyan);
    user-select: all;
}

@media (max-width: 900px) {
    body {
        height: auto;
        padding: 20px 0;
        display: block;
    }

    .container {
        height: auto;
    }

    .main-content {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    #balance-section {
        order: 1;
    }

    #activity-section {
        order: 2;
    }

    #chart-section {
        order: 3;
    }

    #distribution-section {
        order: 4;
    }

    #info-section {
        order: 5;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .wallet-info {
        text-align: center;
    }

    .projections-section .projections-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .projection-zero {
        grid-column: span 2;
    }

    .chart-container {
        min-height: 300px;
    }

    /* Progress bar responsive adjustments */
    .dist-progress-container {
        margin-left: 0; /* Full width on mobile */
    }

    .dist-progress-label {
        font-size: 0.6rem;
        right: 4px;
    }

    .dist-processing-info {
        margin-left: 0; /* Full width on mobile */
        font-size: 0.65rem;
    }
}

/* Custom Dropdown Styling */
.custom-dropdown {
    position: relative;
    display: flex;
    /* Child fills height */
    z-index: 100;
    /* Ensure it stays on top */
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    /* Vertical centering handled by flex/height */
    height: 100%;
    width: 100px;
    justify-content: space-between;
    /* ... rest of styles ... */
    background: rgba(20, 20, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

.dropdown-trigger:hover,
.custom-dropdown.active .dropdown-trigger {
    border-color: var(--clr-cyan);
    background: rgba(77, 194, 229, 0.1);
    box-shadow: 0 4px 12px rgba(77, 194, 229, 0.1);
}

.dropdown-arrow-icon {
    transition: transform 0.3s ease;
}

.custom-dropdown.active .dropdown-arrow-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
}

.custom-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.dropdown-item:hover {
    background: rgba(77, 194, 229, 0.15);
    color: var(--clr-cyan);
}

/* Hide native select entirely if it still exists in cache */
.token-select {
    display: none;
}



/* Token Theme Colors */
.dropdown-trigger.theme-eft {
    color: var(--clr-magenta);
    border-color: rgba(218, 28, 92, 0.4);
    background: rgba(218, 28, 92, 0.1);
    width: 100px;
    /* Slightly wider for  */
}

.dropdown-trigger.theme-eft:hover,
.custom-dropdown.active .dropdown-trigger.theme-eft {
    border-color: var(--clr-magenta);
    box-shadow: 0 4px 12px rgba(218, 28, 92, 0.2);
}

.dropdown-trigger.theme-efb {
    color: var(--clr-orange);
    border-color: rgba(245, 130, 31, 0.4);
    background: rgba(245, 130, 31, 0.1);
    width: 100px;
}

.dropdown-trigger.theme-efb:hover,
.custom-dropdown.active .dropdown-trigger.theme-efb {
    border-color: var(--clr-orange);
    box-shadow: 0 4px 12px rgba(245, 130, 31, 0.2);
}

/* Dropdown Items Colors */
.dropdown-item[data-value='EFT']:hover {
    color: var(--clr-magenta);
    background: rgba(218, 28, 92, 0.1);
}

.dropdown-item[data-value='EFB']:hover {
    color: var(--clr-orange);
    background: rgba(245, 130, 31, 0.1);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    /* Higher than everything */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 450px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hidden .modal-card {
    transform: scale(0.9);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--text-main);
}

.modal-icon-wrapper {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--clr-orange), var(--clr-magenta));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-text {
    color: var(--text-dim);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-instruction {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.arrow-hint {
    font-size: 2rem;
    color: var(--clr-cyan);
    font-weight: bold;
}

.modal-action-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--clr-cyan), var(--clr-lime));
    color: #0a0a0f;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-action-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(77, 194, 229, 0.3);
}

/* Chart Controls */
.chart-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--clr-cyan);
    color: var(--clr-cyan);
}

.control-btn.active {
    background: var(--clr-cyan);
    border-color: var(--clr-cyan);
    color: var(--bg-dark);
    font-weight: 700;
}