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

:root {
    --primary: #8b5cf6;
    --primary-rgb: 139, 92, 246;
    --secondary: #d946ef;
    --accent: #06b6d4;
    --bg-dark: #030712;
    --card-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    /* Lighter slate for better contrast */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --nav-width: 280px;
}

/* Base */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    background-attachment: fixed;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(6, 182, 212, 0.15) 0%, transparent 50%);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
    /* Ensure headings are white */
}

p,
span,
div,
li,
a {
    color: var(--text-main);
    /* Default to white */
}

.text-muted {
    color: var(--text-muted) !important;
    /* Force override bootstrap */
}

.text-white {
    color: #fff !important;
}

a {
    text-decoration: none;
    transition: all 0.2s ease;
    color: var(--accent);
    /* Make links pop */
}

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

/* Components */
.card-glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.card-glass:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
    color: white;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.form-control {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: white;
    padding: 12px 16px;
    transition: all 0.2s;
}

.form-control:focus {
    background: rgba(17, 24, 39, 0.9);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
    color: white;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Sidebar */
.sidebar {
    width: var(--nav-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5rem;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 2rem 1.5rem;
    display: block;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-md);
    margin: 4px 12px;
    transition: all 0.2s;
}

.nav-link i {
    font-size: 1.25rem;
    margin-right: 12px;
    transition: transform 0.2s;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover i {
    transform: translateX(4px);
    color: var(--primary);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), transparent);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-left: 0;
}

/* Layout */
.main-content {
    margin-left: var(--nav-width);
    padding: 2rem;
    min-height: 100vh;
}

.navbar-top {
    display: none;
    /* Desktop */
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.table-glass {
    width: 100%;
    color: var(--text-muted);
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-glass th {
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

.table-glass td {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 24px;
}

.table-glass tr td:first-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.table-glass tr td:last-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* Responsive Table Fix */
@media (max-width: 768px) {
    .table-glass thead {
        display: none;
    }

    .table-glass,
    .table-glass tbody,
    .table-glass tr,
    .table-glass td {
        display: block;
        width: 100%;
    }

    .table-glass tr {
        margin-bottom: 1.5rem;
        background: rgba(255, 255, 255, 0.03);
        border-radius: var(--radius-md);
        padding: 8px;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .table-glass td {
        background: transparent !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        text-align: right;
        min-height: 50px;
    }

    .table-glass td:last-child {
        border-bottom: none;
    }

    .table-glass td:before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: var(--primary);
        opacity: 0.8;
        letter-spacing: 0.05em;
        text-align: left;
        margin-right: 15px;
    }

    .table-glass .d-flex {
        justify-content: flex-end;
    }
}

.table-responsive-glass {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive-glass::-webkit-scrollbar {
    height: 4px;
}

.table-responsive-glass::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.table-responsive-glass::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        border-right: none;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-top: 5rem;
    }

    .navbar-top {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: rgba(3, 7, 18, 0.8);
        backdrop-filter: blur(10px);
        z-index: 900;
        align-items: center;
        padding: 0 1.5rem;
        border-bottom: 1px solid var(--glass-border);
    }
}

/* Recent Payouts Table (Integrated Design) */
.payout-section-title {
    font-size: 2.25rem;
    font-weight: 800;
    text-align: center;
    margin: 3rem 0 2rem;
    background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.payout-table-container {
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: var(--radius-lg);
}

.payout-table .reward-cell {
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.payout-table tr {
    transition: all 0.3s ease;
}

.payout-table tr:hover {
    transform: scale(1.005);
    z-index: 10;
}

.payout-table tr:hover td {
    background: rgba(255, 255, 255, 0.05) !important;
}

@media (max-width: 768px) {
    .payout-section-title {
        font-size: 1.5rem;
        margin: 2rem 0 1rem;
    }

    .payout-table .reward-cell {
        font-size: 1rem;
        color: var(--accent);
    }

    .card-glass.overflow-hidden {
        border-radius: var(--radius-md);
    }
}
/* Dark scrollbars and pagination */
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.35) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.35); border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.pagination .page-link:hover { background: rgba(255,255,255,0.08) !important; color: #fff; }
.pagination .page-item.active .page-link { background: var(--primary, #8b5cf6) !important; border-color: transparent !important; }
.pagination .page-item.disabled .page-link { opacity: .45; }

/* Readonly / disabled fields: Bootstrap forces a light background on them, which hid our white text */
.form-control[readonly],
.form-control:disabled,
.form-select:disabled,
.form-control[readonly]:focus {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.85) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.85);
    border-color: var(--glass-border);
    opacity: 1;
}
.form-control:disabled::placeholder { color: rgba(255, 255, 255, 0.3); }
.form-control::selection { background: #8b5cf6; color: #fff; }

/* Bootstrap 5.3 has no bg-opacity-5 / bg-opacity-20: without these the "bg-white bg-opacity-5" boxes rendered solid white */
.bg-opacity-5  { --bs-bg-opacity: 0.05 !important; }
.bg-opacity-20 { --bs-bg-opacity: 0.2 !important; }

/* Readable helper text and dark dropdowns */
.form-text { color: rgba(255, 255, 255, 0.62) !important; }
.form-select {
    background-color: rgba(17, 24, 39, 0.6);
    color: #fff;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat !important;
    background-position: right 0.85rem center !important;
    background-size: 14px 10px !important;
    padding-right: 2.5rem;
}
.form-select:focus { background-color: rgba(17, 24, 39, 0.9); color: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2); }
.form-select option { background: #111827; color: #fff; }

/* Withdrawal currency cards */
.coin-option {
    display: block; cursor: pointer; color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px; transition: all .2s;
}
.coin-option:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(139, 92, 246, 0.6); }
.btn-check:checked + .coin-option {
    background: rgba(139, 92, 246, 0.18);
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.btn-check:focus-visible + .coin-option { box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.45); }
