﻿/* ============================================================
   20WICKT / BETHUB — ACCOUNT SIDEBAR / DRAWER
   Dark Navy Theme (20wickets.com inspired)
   ============================================================
   Slide-in panel from the right on desktop,
   slide-up from bottom on mobile.
   Background: #1a2c38 (dark navy)
   Text: #ffffff / #b0bec5 (white / muted blue-gray)
   Balance: #4caf50 (green)  |  Exposure: #dc3545 (red)
   Deposit: #4caf50 (green)  |  Withdraw: #dc3545 (red)
   ============================================================ */

/* ── Overlay ── */
.account-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.account-sidebar-overlay.open {
    display: block;
}

/* ── Sidebar Container (Desktop: slide from right) ── */
.account-sidebar {
    position: fixed;
    top: 0;
    right: -360px; /* Hidden by default */
    width: 340px;
    height: 100%;
    background-color: #1a2c38;
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.account-sidebar.open {
    right: 0;
}

/* ── Sidebar Header ── */
.account-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: #152232;
}

.account-sidebar-header .user-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
}

.account-sidebar-header .user-title i {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0bec5;
    font-size: 16px;
}

.account-sidebar-header .close-btn {
    cursor: pointer;
    font-size: 20px;
    color: #8899a6;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    border: none;
    background: rgba(255, 255, 255, 0.06);
}

.account-sidebar-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* ── Balance Section ── */
.account-balance-section {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.account-balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #8899a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-balance-header .refresh-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8899a6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.account-balance-header .refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Balance Grid */
.balance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.balance-item {
    font-size: 11px;
    color: #8899a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
    border-radius: 6px;
}

.balance-item .val {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin-top: 4px;
    display: block;
}

/* Balance colors */
.balance-item.balance-main .val {
    color: #4caf50;
    font-size: 20px;
}

.balance-item.exposure-main .val {
    color: #dc3545;
}

.balance-item.available-main .val {
    color: #4caf50;
}

/* ── Action Buttons (Deposit / Withdraw) ── */
.account-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-acc-action {
    padding: 12px;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-acc-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-acc-deposit {
    background: #4caf50;
}

.btn-acc-deposit:hover {
    background: #43a047;
}

.btn-acc-withdraw {
    background: #dc3545;
}

.btn-acc-withdraw:hover {
    background: #c82333;
}

/* ── Menu Groups ── */
.account-menu-group {
    padding: 14px 20px 6px;
    font-size: 10px;
    color: #546e7a;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ── Menu Items ── */
.account-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.account-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #b0bec5;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    gap: 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.account-menu-item i {
    width: 20px;
    text-align: center;
    color: #8899a6;
    font-size: 16px;
}

.account-menu-item:hover,
.account-menu-item.active {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: #ffc107;
    color: #ffffff;
}

.account-menu-item:hover i,
.account-menu-item.active i {
    color: #ffc107;
}

.account-menu-item.active {
    background: rgba(255, 193, 7, 0.06);
}

/* ── Settings Section ── */
.account-settings-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 4px;
}

.account-settings-section .account-menu-item {
    color: #8899a6;
}

.account-settings-section .account-menu-item:hover {
    color: #ffffff;
}

/* ── Logout Button ── */
.account-logout-btn {
    margin: 16px 20px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: #b0bec5;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    width: calc(100% - 40px);
}

.account-logout-btn:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

/* ── Scrollbar Styling ── */
.account-sidebar::-webkit-scrollbar {
    width: 4px;
}

.account-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.account-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.account-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Mobile Responsive ── */
@media (max-width: 576px) {
    .account-sidebar {
        width: 100% !important;
        max-width: 320px !important;
    }
}

/* ── Slide-up Animation on Mobile ── */
@media (max-width: 576px) {
    .account-sidebar {
        top: auto;
        bottom: -100%;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 75%;
        border-radius: 16px 16px 0 0;
        transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .account-sidebar.open {
        bottom: 0;
        right: 0;
    }

    .account-sidebar-header {
        border-radius: 16px 16px 0 0;
    }

    /* Compact balance grid on mobile */
    .balance-grid {
        gap: 8px;
    }

    .balance-item .val {
        font-size: 16px;
    }

    .balance-item.balance-main .val {
        font-size: 18px;
    }

    /* Compact action buttons */
    .btn-acc-action {
        padding: 10px;
        font-size: 13px;
    }

    /* Compact menu items */
    .account-menu-item {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ── Desktop Focus Styles (Accessibility) ── */
@media (min-width: 992px) {
    .account-sidebar .account-menu-item:focus-visible {
        outline: 2px solid #ffc107;
        outline-offset: -2px;
        border-radius: 2px;
    }

    .btn-acc-action:focus-visible {
        outline: 2px solid #ffc107;
        outline-offset: 2px;
    }
}
