/* Diamond Protocol Dashboard Styles
 * Using official brand tokens
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Jura:wght@300;400;500&family=Geist+Mono&display=swap');

:root {
    /* Primary Backgrounds */
    --color-deep-space: #0A0E1A;
    --color-obsidian: #12182B;
    --color-midnight: #1A2444;

    /* Accent Colors - The Diamond Spectrum */
    --color-diamond-cyan: #00D4FF;
    --color-diamond-teal: #00B4D8;
    --color-facet-blue: #4F8FFF;

    /* Trust & Value */
    --color-trust-gold: #FFD700;
    --color-trust-amber: #F5A623;

    /* Status Colors */
    --color-success: #00E676;
    --color-warning: #FF9100;
    --color-error: #FF5252;

    /* Neutrals */
    --color-crystal-white: #F8FAFF;
    --color-silver: #A0AEC0;
    --color-slate: #64748B;

    /* Semantic aliases */
    --bg-primary: var(--color-deep-space);
    --bg-secondary: var(--color-obsidian);
    --bg-card: var(--color-obsidian);
    --border-color: var(--color-midnight);
    --text-primary: var(--color-crystal-white);
    --text-secondary: var(--color-silver);
    --text-muted: var(--color-slate);
    --accent-cyan: var(--color-diamond-cyan);
    --accent-teal: var(--color-diamond-teal);
    --accent-gold: var(--color-trust-gold);
    --accent-green: var(--color-success);
    --accent-red: var(--color-error);

    /* Typography */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-secondary: 'Jura', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Geist Mono', 'JetBrains Mono', monospace;

    /* Effects */
    --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);
    --glow-cyan-strong: 0 0 40px rgba(0, 212, 255, 0.5);
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
}

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

body {
    font-family: var(--font-secondary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-primary);
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--color-facet-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo img {
    height: 40px;
    width: auto;
}

.tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 300;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-green);
    font-weight: 600;
    font-size: 0.85rem;
}

.live-dot {
    width: 10px;
    height: 10px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.connection-status {
    padding: 6px 14px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-cyan);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px 40px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--glow-cyan);
}

.stat-card.diamond {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(79, 143, 255, 0.05) 100%);
    border-color: rgba(0, 212, 255, 0.3);
}

.stat-card.trust {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
    border-color: rgba(0, 230, 118, 0.3);
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
}

.stat-bar {
    height: 6px;
    background: var(--color-midnight);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--color-facet-blue));
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.stat-bar-fill.trust-bar {
    background: linear-gradient(90deg, var(--accent-green), var(--accent-teal));
}

/* Protocol Stats */
.protocol-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.protocol-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.protocol-card h3 {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.protocol-card.buyback {
    border-color: rgba(0, 212, 255, 0.2);
}

.protocol-card.guardian {
    border-color: rgba(0, 230, 118, 0.2);
}

.protocol-card.lottery {
    border-color: rgba(255, 215, 0, 0.2);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
}

.protocol-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.protocol-stat:last-child {
    border-bottom: none;
}

.protocol-stat span:first-child {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.protocol-stat .value {
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.protocol-stat .value.prize {
    color: var(--accent-gold);
    font-size: 1.2rem;
    text-shadow: var(--glow-gold);
}

.protocol-stat .status-healthy {
    color: var(--accent-green);
}

/* Two Column Layout */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Holders List */
.holders-list {
    max-height: 400px;
    overflow-y: auto;
}

.holder-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-bottom: 8px;
    align-items: center;
    transition: background 0.2s;
}

.holder-row:hover {
    background: rgba(0, 212, 255, 0.05);
}

.holder-wallet {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-cyan);
}

.holder-balance {
    font-weight: 600;
}

.holder-days {
    color: var(--text-secondary);
}

.holder-tier {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tier-tier2 {
    background: linear-gradient(135deg, var(--accent-cyan), var(--color-facet-blue));
    color: var(--color-deep-space);
}

.tier-tier1 {
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-cyan);
}

.tier-paper {
    background: rgba(255, 82, 82, 0.2);
    color: var(--accent-red);
}

.holder-trust {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--accent-green);
}

/* Trades List */
.trades-list {
    max-height: 400px;
    overflow-y: auto;
}

.trade-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-bottom: 8px;
}

.trade-row.buy {
    border-left: 3px solid var(--accent-green);
}

.trade-row.sell {
    border-left: 3px solid var(--accent-red);
}

.trade-type {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    min-width: 50px;
}

.trade-type.buy { color: var(--accent-green); }
.trade-type.sell { color: var(--accent-red); }

.trade-wallet {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.trade-amount {
    margin-left: auto;
    font-weight: 600;
}

.trade-sol {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Buybacks List */
.buybacks-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.buyback-item {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
}

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

.buyback-trigger {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    color: var(--accent-cyan);
}

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

.buyback-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.buyback-stat span:first-child {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.buyback-stat span:last-child {
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Footer */
.footer {
    padding: 20px 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .protocol-stats {
        grid-template-columns: 1fr;
    }
    .two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
        padding: 16px 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .main-content {
        padding: 20px;
    }
    .holder-row {
        grid-template-columns: 1fr 1fr;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--color-midnight);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-slate);
}
