/* Variables */
:root {
    --primary: #222;
    --secondary: #666;
    --white: #fff;
    --bg: #fff;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --radius: 8px;
    --gap: 1.5rem;
    --text-sm: 0.85rem;
    --text-md: 1rem;
    --text-lg: 1.5rem;
}

/* Dark Mode */
body.dark-mode {
    --primary: #e8e8e8;
    --secondary: #a0a0a0;
    --white: #1a1a1a;
    --bg: #0f0f0f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 1.5rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border: 2px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--primary);
    color: var(--bg);
}

body.dark-mode .theme-toggle {
    border-color: var(--primary);
}

/* Layout */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--gap);
}

/* Sections */
.treasury-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    min-height: 500px;
}

body.dark-mode .treasury-section {
    border-color: #333;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.treasury-section h2 {
    margin: 0.5rem 0 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    object-fit: cover;
}

/* Balance Display */
.balance-row {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0.8rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    word-break: break-word;
}

.price-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.4rem 0 0.8rem;
    font-size: 0.95rem;
}

.price {
    font-weight: 400;
    color: var(--primary);
}

.token-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
}

.total-value {
    display: none;
}

.asset-value {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--primary);
    margin: 0.4rem 0 1.5rem;
    text-align: center;
}

.balance-note {
    font-size: var(--text-sm);
    color: var(--secondary);
    margin: 1rem 0;
    background: linear-gradient(120deg, #fff3cd 0%, #ffe69c 100%);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.3s ease;
}

body.dark-mode .balance-note {
    background: linear-gradient(120deg, #4a4a1f 0%, #3a3a2a 100%);
    color: #d4af37;
}

/* Total Box */
.total-box {
    margin-top: auto;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
    border: 2px solid #bbb;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    width: 90%;
    max-width: 300px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .total-box {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border-color: #444;
}

/* Status */
.time, .update-text {
    font-size: var(--text-sm);
    color: var(--secondary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.error {
    color: #dc2626;
    font-weight: 500;
}

/* Burn Data */
.burn-today {
    background: rgba(220, 38, 38, 0.05);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    border-left: 3px solid #dc2626;
    font-size: var(--text-sm);
    transition: background 0.3s ease;
}

body.dark-mode .burn-today {
    background: rgba(220, 38, 38, 0.2);
}

.burn-today div {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.change-positive {
    color: #22c55e;
    font-weight: 600;
}

.change-negative {
    color: #dc2626;
    font-weight: 600;
}

.change-neutral {
    color: var(--secondary);
    font-weight: 600;
}

/* Recent Transactions */
.recent-txns {
    margin-top: 1.5rem;
    text-align: left;
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--radius);
    max-height: 250px;
    overflow-y: auto;
    font-size: var(--text-sm);
    transition: background 0.3s ease;
}

body.dark-mode .recent-txns {
    background: #2a2a2a;
}

.recent-txns h4 {
    margin: 0 0 1rem;
    text-align: center;
    color: var(--primary);
    font-size: 0.95rem;
}

.txn-item {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 0.5rem;
}

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

.txn-amount {
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

.txn-value {
    font-weight: 500;
    color: #22c55e;
    text-align: right;
    flex: 1;
}

.txn-time {
    color: var(--secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Social & Footer */
.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 1rem 0;
    flex-wrap: wrap;
}

.social-btn {
    padding: 0.6rem 1.2rem;
    background: #e5d4ff;
    color: var(--primary);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: background 0.2s;
}

.social-btn:hover {
    background: #d4c5ff;
}

body.dark-mode .social-btn {
    background: #333;
    border: 1px solid #555;
}

body.dark-mode .social-btn:hover {
    background: #444;
}

.follow-btn {
    display: block;
    margin: 0.5rem auto;
    padding: 0.4rem 0.8rem;
    background: transparent;
    color: #4DA2FF;
    text-decoration: none;
    border: 1px solid #4DA2FF;
    border-radius: 4px;
    font-size: var(--text-sm);
    font-weight: 700;
    transition: all 0.2s;
    width: fit-content;
}

.follow-btn:hover {
    background: #4DA2FF;
    color: #fff;
    text-decoration: none;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid #e5e7eb;
    transition: border-color 0.3s ease;
}

body.dark-mode footer {
    border-top-color: #333;
}

footer p {
    margin: 0 0 1rem;
    color: var(--secondary);
    font-size: 1rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

.profile-pic {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 0.5rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    :root {
        --gap: 1rem;
    }
    
    .container {
        grid-template-columns: 1fr;
    }
    
    .treasury-section {
        padding: 1.5rem 1rem;
        min-height: 450px;
    }
    
    .treasury-section h2 {
        font-size: 1.2rem;
    }
    
    .balance-row {
        font-size: 1.3rem;
    }
    
    .token-icon {
        width: 24px;
        height: 24px;
    }
    
    .total-box {
        font-size: 1.3rem;
        padding: 0.8rem 1.2rem;
    }
}

@media (max-width: 480px) {
    :root {
        --gap: 0.75rem;
    }
    
    body {
        padding: 1rem 0.75rem;
    }
    
    .container {
        gap: 0.75rem;
    }
    
    .treasury-section {
        padding: 1rem 0.75rem;
    }
    
    .treasury-section {
        min-height: 400px;
    }
    
    .treasury-section h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .balance-row {
        font-size: 1.1rem;
    }
    
    .logo {
        width: 56px;
        height: 56px;
    }
    
    .token-icon {
        width: 20px;
        height: 20px;
    }
    
    .price-info {
        font-size: 0.85rem;
        gap: 0.75rem;
    }
    
    .social-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .time, .update-text {
        font-size: 0.75rem;
    }
    
    .recent-txns {
        font-size: 0.8rem;
        padding: 0.75rem;
        max-height: 200px;
    }
    
    .total-box {
        font-size: 1.2rem;
        padding: 0.7rem 1rem;
    }
}
