/* ========== Top Loading Bar ========== */
.km-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    z-index: 999999;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}
.km-loader.active {
    animation: kmLoaderGrow 1.8s ease-in-out forwards;
}
.km-loader.done {
    width: 100% !important;
    transition: width 0.2s ease;
    opacity: 1;
}
.km-loader.fade {
    opacity: 0;
    transition: opacity 0.4s ease;
}
@keyframes kmLoaderGrow {
    0% { width: 0; }
    20% { width: 30%; }
    50% { width: 60%; }
    80% { width: 85%; }
    100% { width: 92%; }
}

/* ========== Mobile / Tablet Block ========== */
.mobile-block {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #0a0e1a;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    font-family: 'Quicksand', sans-serif;
}
.mobile-block .block-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}
.mobile-block .block-icon svg {
    color: #f59e0b;
}
.mobile-block h1 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 12px;
    font-weight: 700;
}
.mobile-block p {
    font-size: 15px;
    color: #94a3b8;
    max-width: 340px;
    line-height: 1.6;
    margin-bottom: 8px;
}
.mobile-block .block-hint {
    font-size: 12px;
    color: #475569;
    margin-top: 20px;
}

@media (max-width: 1024px) {
    .mobile-block {
        display: flex !important;
    }
    .mobile-block ~ * {
        display: none !important;
    }
}

/* ========== Block scroll on number inputs ========== */
input[type="number"] {
    -moz-appearance: textfield;
}

/* ========== Hide number input spinners ========== */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

/* ========== Dark Mode ========== */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-thumb {
        background: #475569;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #64748b;
    }
    * {
        scrollbar-color: #475569 transparent;
    }

    body {
        background: #0f172a !important;
        color: #e2e8f0;
    }

    .navbar {
        background: #020617 !important;
        border-bottom: 1px solid #1e293b;
    }

    .card, .stat-card {
        background: #1e293b !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    }

    .card h2, .stat-card .value, .section-title {
        color: #f1f5f9 !important;
    }

    .stat-card .label, .section-sub {
        color: #94a3b8 !important;
    }

    .stat-card .value.money {
        color: #4ade80 !important;
    }

    /* Tables */
    th {
        color: #94a3b8 !important;
        border-bottom-color: #334155 !important;
    }

    td {
        color: #cbd5e1 !important;
        border-bottom-color: #1e293b !important;
    }

    /* Forms */
    .form-group input, input[type="text"], input[type="password"], input[type="number"] {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
    }

    .form-group input:focus, input:focus, select:focus {
        border-color: #f59e0b !important;
    }

    select {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
    }

    .form-group input::placeholder, input::placeholder {
        color: #64748b !important;
    }

    .form-group label {
        color: #94a3b8 !important;
    }

    .form-group .hint {
        color: #64748b !important;
    }

    /* Tabs */
    .tabs button {
        background: #1e293b !important;
        border-color: #334155 !important;
        color: #94a3b8 !important;
    }

    .tabs button.active {
        border-color: #f59e0b !important;
        color: #f59e0b !important;
        background: #292524 !important;
    }

    /* Balance card - already dark, minor tweaks */
    .balance-card {
        background: linear-gradient(135deg, #020617, #0f172a) !important;
    }

    /* Alerts */
    .alert-info {
        background: #1e293b !important;
        color: #60a5fa !important;
        border-color: #334155 !important;
    }

    /* Webhook info */
    .webhook-info {
        background: #020617 !important;
    }

    /* Badges */
    .badge-success { background: #052e16 !important; color: #4ade80 !important; }
    .badge-fail { background: #450a0a !important; color: #f87171 !important; }
    .badge-pending { background: #451a03 !important; color: #fbbf24 !important; }
    .badge-process { background: #172554 !important; color: #60a5fa !important; }
    .badge-admin { background: #451a03 !important; color: #fbbf24 !important; }
    .badge-user { background: #172554 !important; color: #60a5fa !important; }

    /* Messages */
    .msg-ok { background: #052e16 !important; color: #4ade80 !important; }
    .msg-err { background: #450a0a !important; color: #f87171 !important; }

    /* Empty state */
    .empty { color: #64748b !important; }

    /* Divider */
    .divider {
        background: #334155 !important;
    }

    /* Modal */
    .modal {
        background: #1e293b !important;
    }

    .modal h3 {
        color: #f1f5f9 !important;
    }

    /* Login card */
    .login-card {
        background: #1e293b !important;
    }

    .login-card h1 {
        color: #f1f5f9 !important;
    }

    .login-card p.sub {
        color: #94a3b8 !important;
    }

    .error-msg {
        color: #f87171 !important;
    }

    /* Test deposit left panel */
    .left-panel {
        background: #1e293b !important;
        border-right-color: #334155 !important;
    }

    .step-text {
        color: #94a3b8 !important;
    }

    .step-num {
        background: #334155 !important;
        color: #94a3b8 !important;
    }

    .step-num.active {
        background: #f59e0b !important;
        color: #fff !important;
    }

    .step-num.done {
        background: #16a34a !important;
        color: #fff !important;
    }

    .btn:disabled {
        background: #334155 !important;
        color: #64748b !important;
    }

    /* Password eye button */
    .eye-btn {
        color: #64748b !important;
    }

    .eye-btn:hover {
        color: #cbd5e1 !important;
    }

    /* Strength bar */
    .strength-bar {
        background: #334155 !important;
    }

    /* Code elements */
    code {
        color: #f59e0b !important;
    }
}
