:root {
    /* Theme Colors: "Professional Deep Tech" */
    --bg-dark: #050511;
    /* Deeper, almost black blue */
    --bg-card: rgba(18, 20, 35, 0.7);
    --bg-card-hover: rgba(25, 28, 45, 0.9);

    /* Accents - More refined, less "neon" */
    --primary: #5c2eff;
    /* Deep Royal Purple/Blue */
    --primary-hover: #4a25cc;
    --secondary: #00d2ff;
    /* Cyan remains but slightly muted in usage */
    --accent: #ff005c;
    /* Sharp Pink/Red for highlights */
    --success: #00e676;
    --danger: #ff1744;

    /* Text */
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    /* Cool gray for better readability */
    --text-dim: #64748b;

    /* Borders & Glass */
    --border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    --backdrop-blur: blur(12px);

    /* Spacing & Layout */
    --container-width: 1200px;
    --gap-sm: 12px;
    --gap-md: 24px;
    --gap-lg: 48px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    /* Subtle mesh gradient background */
    background-image:
        radial-gradient(circle at 15% 50%, rgba(92, 46, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 210, 255, 0.08) 0%, transparent 25%);
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    background: linear-gradient(180deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gap-md);
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    align-items: start;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border-radius: 50px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(92, 46, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(92, 46, 255, 0.35);
}

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    background: var(--glass-bg);
}

/* Cards & Glassmorphism */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--gap-md);
    backdrop-filter: var(--backdrop-blur);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header & Nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.logo span {
    color: var(--text-main);
}

/* Mono logo looks more pro */

.nav-links {
    display: flex;
    gap: 5px;
}

.nav-links .btn {
    background: transparent;
    color: var(--text-muted);
    box-shadow: none;
    border: none;
}

.nav-links .btn:hover,
.nav-links .btn.active {
    color: var(--text-main);
    background: var(--glass-bg);
}

/* Global Stats Bar */
.global-stats {
    background: #02020a;
    padding: 8px 0;
    font-size: 0.75rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.global-stats .container {
    display: flex;
    justify-content: flex-start;
    gap: 30px;
    overflow-x: auto;
    white-space: nowrap;
}

.stat-item span {
    color: var(--text-main);
    margin-left: 6px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 16px;
    text-align: left;
}

.data-table td {
    padding: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-main);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Inputs */
.form-input,
.form-select {
    width: 100%;
    padding: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group {
    margin-bottom: 24px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #121423 25%, #1a1d30 50%, #121423 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    color: transparent !important;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Landing Specifics */
.ticker-wrap {
    background: #02020a;
    border-bottom: 1px solid var(--border);
    width: 100%;
    overflow: hidden;
    padding: 10px 0;
    white-space: nowrap;
    position: relative;
    z-index: 10;
}

.ticker {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.ticker-item span.up {
    color: var(--success);
}

.ticker-item span.down {
    color: var(--danger);
}

.trending-grid {
    gap: 20px;
}

.coin-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.coin-chip:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    border-color: var(--primary);
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    margin-top: 80px;
    padding: 40px 0;
    text-align: center;
    color: var(--text-dim);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    :root {
        --gap-md: 16px;
        --gap-lg: 32px;
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .hero {
        padding: 60px 20px;
    }

    /* Scrollable Nav */
    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 15px 0;
    }

    .logo {
        margin-bottom: 5px;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
        /* Space for scrollbar */
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
        gap: 8px;
        mask-image: linear-gradient(to right, black 90%, transparent 100%);
    }

    .nav-links .btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 0.85rem;
        background: rgba(255, 255, 255, 0.05);
        /* Slight BG for clarity */
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links .btn.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    /* Stack Grids */
    .features-grid,
    .trending-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Global Stats Scroll */
    .global-stats .container {
        padding-right: 16px;
    }

    /* Forms */
    .add-coin-form {
        grid-template-columns: 1fr;
    }

    /* Adjust Tables */
    .data-table th,
    .data-table td {
        padding: 12px;
        font-size: 0.85rem;
    }
}