:root {
    --bg-primary: #09090b;
    --bg-secondary: #0c0c0e;
    --bg-card: #111113;
    --bg-hover: #18181b;
    --border: #1f1f23;
    --border-hover: #2a2a2e;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --accent: #ffffff;
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
}

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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* ==================== CTO BANNER ==================== */
.cto-banner {
    position: relative;
    z-index: 100;
    background: linear-gradient(
        180deg,
        rgba(34, 197, 94, 0.12) 0%,
        rgba(34, 197, 94, 0.05) 50%,
        transparent 100%
    );
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
    padding: 32px 24px;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.cto-banner.dimmed {
    filter: grayscale(80%) brightness(0.5);
    opacity: 0.6;
}

.cto-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.cto-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 
        0 0 30px var(--success-glow),
        0 4px 20px rgba(34, 197, 94, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 
            0 0 30px var(--success-glow),
            0 4px 20px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 
            0 0 50px rgba(34, 197, 94, 0.4),
            0 4px 30px rgba(34, 197, 94, 0.4);
    }
}

.cto-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

.cto-text {
    flex: 1;
}

.cto-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff 0%, var(--success) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cto-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.cto-wallet {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.cto-wallet .wallet-address {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
    font-size: 0.8rem;
    color: var(--success);
}

.cto-wallet .copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.cto-wallet .copy-btn:hover {
    opacity: 1;
}

.cto-wallet .copy-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
}

/* CTO Fees Link */
.cto-fees-link {
    margin-bottom: 16px;
}

.cto-fees-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.cto-fees-link a:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    transform: translateX(4px);
}

/* CTO Note */
.cto-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ==================== TRACKER CONTENT ==================== */
.tracker-content {
    position: relative;
    filter: grayscale(80%) brightness(0.5);
    opacity: 0.6;
    transition: filter 0.4s ease, opacity 0.4s ease;
    cursor: pointer;
}

.tracker-content.active {
    filter: none;
    opacity: 1;
    cursor: default;
}

.tracker-content.active * {
    pointer-events: auto;
}

/* ==================== ORIGINAL TRACKER STYLES ==================== */

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.logo-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.pulse {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Container */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}

/* Wallet Info */
.wallet-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.wallet-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    position: relative;
}

.wallet-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.wallet-address-box {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    word-break: break-all;
    padding-right: 2rem;
}

.copy-btn-small {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.copy-btn-small svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-secondary);
}

.copy-btn-small:hover {
    opacity: 1;
}

.arrow {
    flex-shrink: 0;
    opacity: 0.3;
}

.arrow svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.stat-card.highlight {
    background: var(--text-primary);
    border-color: var(--text-primary);
}

.stat-card.highlight .stat-value {
    color: var(--bg-primary);
}

.stat-card.highlight .stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Price Info */
.price-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.price-value {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.price-divider {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

/* Amount USD in transactions */
.amount-usd {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

/* Transactions Section */
.transactions-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.refresh-btn svg {
    width: 12px;
    height: 12px;
}

.refresh-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Transactions List */
.transactions-list {
    display: flex;
    flex-direction: column;
}

.transaction-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

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

.transaction-item:hover {
    background: var(--bg-hover);
}

.transaction-item.highlighted {
    background: rgba(255, 255, 255, 0.02);
}

.transaction-item.highlighted:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tx-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.tx-signature {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-signature a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.tx-signature a:hover {
    color: var(--text-primary);
}

.tx-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.tx-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.type-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.type-badge.hkrf {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.type-badge.sol {
    background: transparent;
    color: var(--text-secondary);
}

.tx-amount {
    text-align: right;
    min-width: 100px;
}

.amount-value {
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.amount-token {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.no-transactions {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.error-message {
    text-align: center;
    padding: 1.5rem;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    margin: 1rem;
    font-size: 0.8125rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .cto-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .cto-wallet {
        width: 100%;
        justify-content: center;
    }
    
    .cto-fees-link a {
        width: 100%;
        justify-content: center;
    }
    
    .header {
        padding: 0.875rem 1rem;
    }
    
    .container {
        padding: 1.25rem 1rem;
    }
    
    .wallet-info {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .wallet-card {
        width: 100%;
    }
    
    .arrow {
        transform: rotate(90deg);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .transaction-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .tx-amount {
        text-align: left;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
