/* ========================================================================
   Scalesco Web3 — Dark Trading Dashboard Theme
   ======================================================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --border: #1e1e2e;
    --accent: #00d4aa;
    --accent-dim: rgba(0, 212, 170, 0.15);
    --text-primary: #e0e0e0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --green: #00d68f;
    --red: #ff3860;
    --yellow: #ffcc00;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========================================================================
   Layout
   ======================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================================================
   Navigation
   ======================================================================== */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.navbar-brand span { color: var(--accent); }

.navbar-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.navbar-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.navbar-links a:hover { color: var(--text-primary); text-decoration: none; }

/* ========================================================================
   Buttons
   ======================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover { background: #00e8bb; }

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-dim);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
}

/* ========================================================================
   Hero
   ======================================================================== */

.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero h1 span { color: var(--accent); }

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

/* ========================================================================
   Beta Banner
   ======================================================================== */

.beta-banner {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(0, 212, 170, 0.05));
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 12px;
    padding: 16px 24px;
    text-align: center;
    margin-bottom: 40px;
}

.beta-banner strong { color: var(--accent); }

/* ========================================================================
   Stats Grid
   ======================================================================== */

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.stat-card .value.positive { color: var(--green); }
.stat-card .value.negative { color: var(--red); }

/* ========================================================================
   Tier Cards
   ======================================================================== */

.tiers-section {
    padding: 40px 0;
}

.tiers-section h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.tiers-section .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .tier-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
}

.tier-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    transition: border-color 0.2s;
}

.tier-card:hover { border-color: var(--accent); }

.tier-card.featured {
    border-color: var(--accent);
    position: relative;
}

.tier-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}

.tier-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.tier-card .price {
    font-size: 2.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.tier-card .price-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.tier-card .founder-price {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.tier-card ul {
    list-style: none;
    text-align: left;
    margin-bottom: 24px;
}

.tier-card ul li {
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tier-card ul li::before {
    content: '\2713';
    color: var(--accent);
    margin-right: 8px;
    font-weight: 700;
}

/* ========================================================================
   Chart Container
   ======================================================================== */

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.chart-container h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.chart-container canvas {
    width: 100% !important;
    max-height: 300px;
}

/* ========================================================================
   Tables
   ======================================================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.data-table tr:hover { background: var(--bg-card-hover); }

/* ========================================================================
   Wallet / Account Section
   ======================================================================== */

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

.wallet-address {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 6px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active { background: rgba(0, 214, 143, 0.15); color: var(--green); }
.status-badge.expired { background: rgba(255, 56, 96, 0.15); color: var(--red); }
.status-badge.beta { background: var(--accent-dim); color: var(--accent); }
.status-badge.free { background: rgba(136, 136, 160, 0.15); color: var(--text-secondary); }

/* ========================================================================
   Dashboard Layout
   ======================================================================== */

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

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.position-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.position-card .symbol {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.position-card .side {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.position-card .side.long { color: var(--green); }
.position-card .side.short { color: var(--red); }

.position-card .pnl {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 8px;
}

/* ========================================================================
   Upgrade Prompt
   ======================================================================== */

.upgrade-prompt {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}

.upgrade-prompt h3 { margin-bottom: 8px; }
.upgrade-prompt p { color: var(--text-secondary); margin-bottom: 16px; }

/* ========================================================================
   Footer
   ======================================================================== */

.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 60px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================================================
   Utilities
   ======================================================================== */

.hidden { display: none !important; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.mono { font-family: var(--font-mono); }

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

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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