@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-main: #0B0C10;
    --bg-card: #121318;
    --bg-card-hover: #16171D;
    --bg-sidebar: #0B0C10;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --text-primary: #F8FAFC;
    --text-muted: #8B949E;

    --brand-primary: #7C3AED;
    --brand-hover: #6D28D9;

    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

/* Auth / Login / Register */
.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at center top, #14161E 0%, var(--bg-main) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.logo {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.logo span {
    color: var(--brand-primary);
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    background: #000000;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 14px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.auth-switch {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.auth-switch a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}

.auth-switch a:hover {
    color: var(--brand-primary);
}

/* Buttons */
.btn {
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
}

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: var(--brand-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-sm {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 10px;
}

/* Dashboard Layout */
.dashboard-body {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-logo {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 40px;
    padding: 0 12px;
    letter-spacing: -0.5px;
}

.sidebar-logo span {
    color: var(--brand-primary);
}

.nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.nav-item i {
    font-size: 16px;
    opacity: 0.8;
    width: 20px;
}

.nav-item.active,
.nav-item:hover {
    color: var(--text-primary);
}

.nav-item.active {
    background: #14151A;
    border: 1px solid var(--border);
}

.badge {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    margin-left: auto;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.live {
    background: rgba(124, 58, 237, 0.15);
    color: #A78BFA;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 85px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar .left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-greeting {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-muted);
}

.user-greeting span {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar .right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar .balance-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
    color: var(--text-primary);
}

.topbar .balance-pill:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.topbar .balance-pill i {
    color: #F59E0B;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.avatar:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.content-grid {
    padding: 40px;
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.grid-full {
    grid-column: 1 / -1;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: var(--border-hover);
}

.card-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card h3 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 6px;
}

.card .desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Specific elements */
.stats-row {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.stat-box {
    background: #000000;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    flex: 1;
}

.stat-box.highlight {
    background: rgba(124, 58, 237, 0.05);
    border-color: rgba(124, 58, 237, 0.2);
}

.stat-box label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stat-box .val {
    font-size: 26px;
    font-weight: 700;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.status-table th {
    padding: 14px 16px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.status-table td {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    font-weight: 500;
}

.product-buy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-buy-card {
    background: #000000;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.2s;
}

.product-buy-card:hover {
    border-color: rgba(124, 58, 237, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(124, 58, 237, 0.15);
}

.product-buy-card .title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.product-buy-card .price {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.product-buy-card .price span {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
}

.product-buy-card .features {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    flex: 1;
}

.product-buy-card .features div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-buy-card .features div i {
    color: var(--success);
}

/* Animation Utils */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .dashboard-body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .sidebar-logo {
        margin-bottom: 0;
        width: 100%;
        border-bottom: 1px solid var(--border);
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-item {
        padding: 10px 14px;
    }

    .topbar {
        padding: 0 20px;
    }

    .content-grid {
        padding: 20px;
    }

    .stats-row {
        flex-direction: column;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: flex !important;
    /* to allow transition */
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.2s;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.modal-header .desc {
    font-size: 13px;
    color: var(--text-muted);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 5px;
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-close:hover {
    color: #fff;
}

.coin-options {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.coin-option {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coin-option:hover {
    border-color: rgba(124, 58, 237, 0.5);
}

.coin-option.active {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--brand-primary);
}

.summary-box {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
}

.flex-bw {
    display: flex;
    justify-content: space-between;
    align-items: center;
}