/* ============================================================
   AHGsm — Dashboard / Control Panel Glassmorphic 3D Layer
   Converts the panel shell, SPA views, service cards, tables,
   forms and modals into translucent glass floating over the
   persistent 3D world canvas (zone: panel).

   Scoped under body.panel-workspace (dashboard only) so it
   never affects landing/wallet/apps/login pages.
   ============================================================ */

/* ---------- root + shell: let the world show through ---------- */
body.panel-workspace {
    background: transparent;
}
body.panel-workspace .main-container,
body.panel-workspace #panel-root {
    background: transparent;
}

/* ---------- fallback: rich dark gradient if WebGL is unavailable ---------- */
html.no-webgl body.panel-workspace,
html.no-webgl body.login-page {
    background:
        radial-gradient(circle at 12% -6%, rgba(34, 211, 238, 0.16), transparent 34rem),
        radial-gradient(circle at 88% 4%, rgba(14, 116, 144, 0.14), transparent 32rem),
        radial-gradient(circle at 50% 100%, rgba(8, 145, 178, 0.10), transparent 40rem),
        #040a16;
}

/* ---------- desktop icon sidebar: dark glass rail ---------- */
body.panel-workspace .panel-desk-iconbar {
    background: rgba(6, 15, 26, 0.62);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-inline-end: 1px solid rgba(103, 232, 249, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset -1px 0 0 rgba(0, 0, 0, 0.4);
}
body.panel-workspace .sidebar-nav-item {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #9db4ca;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease, transform 0.2s cubic-bezier(0.22, 0.72, 0.2, 1);
}
body.panel-workspace .sidebar-nav-item:hover {
    background: rgba(103, 232, 249, 0.10);
    border-color: rgba(103, 232, 249, 0.26);
    color: #cffafe;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
body.panel-workspace .sidebar-nav-item.active {
    background: linear-gradient(160deg, rgba(14, 116, 144, 0.42), rgba(6, 16, 28, 0.5));
    border-color: rgba(34, 211, 238, 0.45);
    color: #e0f9ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 16px -6px rgba(34, 211, 238, 0.55);
}

/* ---------- top navbar: floating glass bar ---------- */
body.panel-workspace .top-navbar {
    background: rgba(7, 17, 29, 0.55);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(103, 232, 249, 0.14);
    box-shadow: 0 12px 30px -20px rgba(0, 0, 0, 0.9);
}
body.panel-workspace .top-navbar-search {
    background: rgba(5, 14, 24, 0.6);
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.panel-workspace .top-navbar-search input {
    color: #e8f1f9;
}
body.panel-workspace .top-navbar-search input::placeholder {
    color: #7d97ad;
}
body.panel-workspace .balance-display {
    background: linear-gradient(160deg, rgba(14, 116, 144, 0.36), rgba(6, 16, 28, 0.5));
    border: 1px solid rgba(103, 232, 249, 0.26);
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 0 18px -8px rgba(34, 211, 238, 0.5);
    color: #d9f7ff;
}

/* ---------- SPA view surfaces ---------- */
body.panel-workspace .app-view {
    background: rgba(6, 15, 26, 0.42);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border: 1px solid rgba(103, 232, 249, 0.12);
    border-radius: 20px;
    box-shadow:
        0 24px 54px -26px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* curved view headers get a glass sheen */
body.panel-workspace .curved-header,
body.panel-workspace .inner-header,
body.panel-workspace .svc-view-head {
    background: rgba(9, 24, 39, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(103, 232, 249, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.panel-workspace .panel-page-chip {
    background: rgba(103, 232, 249, 0.12);
    border: 1px solid rgba(103, 232, 249, 0.24);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ---------- service cards (svc-card family) ---------- */
body.panel-workspace .svc-card,
body.panel-workspace .svc-card-showcase,
body.panel-workspace .svc-card-row,
body.panel-workspace .svc-card-tile {
    position: relative;
    background: linear-gradient(165deg, rgba(14, 38, 60, 0.62), rgba(5, 13, 24, 0.56));
    backdrop-filter: blur(16px) saturate(155%);
    -webkit-backdrop-filter: blur(16px) saturate(155%);
    border: 1px solid rgba(103, 232, 249, 0.14);
    border-radius: 16px;
    box-shadow:
        0 18px 38px -20px rgba(0, 0, 0, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    transition: transform 0.25s cubic-bezier(0.22, 0.72, 0.2, 1),
                box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
body.panel-workspace .svc-card:hover,
body.panel-workspace .svc-card-showcase:hover,
body.panel-workspace .svc-card-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(103, 232, 249, 0.38);
    background: linear-gradient(165deg, rgba(18, 48, 74, 0.75), rgba(6, 16, 28, 0.66));
    box-shadow:
        0 28px 56px -22px rgba(0, 0, 0, 0.95),
        0 0 26px -12px rgba(34, 211, 238, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

/* card icon tile: embossed */
body.panel-workspace .svc-card .svc-ico,
body.panel-workspace .svc-card .cat-img,
body.panel-workspace .svc-card .ch-ico {
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -2px 3px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    background: rgba(9, 26, 42, 0.55);
}

/* card switch (view-mode toggle): glass radio group */
body.panel-workspace .svc-card-switch {
    background: rgba(6, 15, 26, 0.55);
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body.panel-workspace .svc-card-switch-btn {
    border-radius: 999px;
    color: #9db4ca;
    transition: background 0.2s ease, color 0.2s ease;
}
body.panel-workspace .svc-card-switch-btn.active,
body.panel-workspace .svc-card-switch-btn[aria-pressed="true"] {
    background: linear-gradient(160deg, rgba(34, 211, 238, 0.28), rgba(14, 116, 144, 0.34));
    color: #e0f9ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* ---------- topup / wallet shells ---------- */
body.panel-workspace .topup-shell,
body.panel-workspace .topup-wallet {
    background: linear-gradient(165deg, rgba(14, 40, 62, 0.62), rgba(5, 13, 24, 0.58));
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 20px;
    box-shadow:
        0 24px 54px -24px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}
body.panel-workspace .topup-wallet-head {
    background: rgba(9, 26, 42, 0.5);
    border-radius: 14px 14px 0 0;
}

/* ---------- membership cards ---------- */
body.panel-workspace .membership-card,
body.panel-workspace .membership-card-body {
    background: linear-gradient(165deg, rgba(14, 38, 60, 0.62), rgba(5, 13, 24, 0.56));
    backdrop-filter: blur(16px) saturate(155%);
    -webkit-backdrop-filter: blur(16px) saturate(155%);
    border: 1px solid rgba(103, 232, 249, 0.16);
    box-shadow:
        0 20px 44px -22px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* ---------- floating balance chip ---------- */
body.panel-workspace .floating-balance {
    background: linear-gradient(160deg, rgba(14, 116, 144, 0.42), rgba(6, 16, 28, 0.55));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(103, 232, 249, 0.3);
    box-shadow:
        0 14px 32px -16px rgba(0, 0, 0, 0.9),
        0 0 20px -8px rgba(34, 211, 238, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* ---------- Bootstrap cards & generic surfaces ---------- */
body.panel-workspace .card,
body.panel-workspace .modal-content {
    background: linear-gradient(165deg, rgba(13, 34, 52, 0.72), rgba(5, 13, 24, 0.66));
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(103, 232, 249, 0.18);
    border-radius: 18px;
    box-shadow:
        0 30px 70px -26px rgba(0, 0, 0, 0.92),
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        inset 0 -1px 0 rgba(0, 0, 0, 0.42);
    color: #e8f1f9;
}
body.panel-workspace .modal-content {
    border: 1px solid rgba(103, 232, 249, 0.24);
}
body.panel-workspace .modal-header,
body.panel-workspace .modal-body,
body.panel-workspace .modal-footer {
    background: transparent;
    border-color: rgba(103, 232, 249, 0.12);
}
body.panel-workspace .modal-backdrop.show {
    opacity: 0.55;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ---------- tables: glass rows ---------- */
body.panel-workspace .table {
    color: #dfeaf5;
    --bs-table-bg: transparent;
    --bs-table-color: #dfeaf5;
    --bs-table-striped-bg: rgba(9, 26, 42, 0.45);
    --bs-table-hover-bg: rgba(16, 42, 64, 0.6);
    --bs-table-border-color: rgba(103, 232, 249, 0.14);
}
body.panel-workspace .table thead th {
    color: #67e8f9;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(103, 232, 249, 0.2);
    background: rgba(9, 26, 42, 0.42);
}
body.panel-workspace .table tbody tr {
    background: rgba(9, 26, 42, 0.38);
    transition: background 0.2s ease;
}
body.panel-workspace .table tbody tr:hover {
    background: rgba(16, 42, 64, 0.6);
}
body.panel-workspace .table tbody td {
    border-color: rgba(255, 255, 255, 0.06);
    background: transparent;
}

/* ---------- form controls: glass inputs ---------- */
body.panel-workspace .form-control,
body.panel-workspace .form-select,
body.panel-workspace input.inp,
body.panel-workspace select.inp,
body.panel-workspace textarea,
body.panel-workspace .log-inp {
    color: #eef6fd;
    background: rgba(5, 14, 24, 0.6);
    border: 1px solid rgba(103, 232, 249, 0.18);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
body.panel-workspace .form-control::placeholder,
body.panel-workspace input.inp::placeholder,
body.panel-workspace .log-inp::placeholder {
    color: #7d97ad;
}
body.panel-workspace .form-control:focus,
body.panel-workspace .form-select:focus,
body.panel-workspace input.inp:focus,
body.panel-workspace select.inp:focus,
body.panel-workspace textarea:focus,
body.panel-workspace .log-inp:focus {
    color: #fff;
    background: rgba(7, 20, 34, 0.78);
    border-color: rgba(103, 232, 249, 0.62);
    box-shadow:
        0 0 0 3px rgba(34, 211, 238, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    outline: none;
}
body.panel-workspace .form-control:disabled,
body.panel-workspace .form-control[readonly] {
    background: rgba(5, 14, 24, 0.4);
    color: #8fa8bf;
}

/* ---------- buttons: glossy 3D ---------- */
body.panel-workspace .btn-primary,
body.panel-workspace .btn-fill,
body.panel-workspace .log-btn-login {
    border: 1px solid rgba(8, 40, 56, 0.85);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -2px 0 rgba(3, 22, 28, 0.5),
        0 3px 0 #072a38,
        0 12px 24px -12px rgba(34, 211, 238, 0.8);
    transition: transform 0.2s cubic-bezier(0.22, 0.72, 0.2, 1), box-shadow 0.2s ease;
}
body.panel-workspace .btn-primary:hover,
body.panel-workspace .btn-fill:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(3, 22, 28, 0.5),
        0 5px 0 #072a38,
        0 18px 32px -12px rgba(34, 211, 238, 1);
}
body.panel-workspace .btn-primary:active,
body.panel-workspace .btn-fill:active {
    transform: translateY(2px) scale(0.985);
    box-shadow:
        inset 0 2px 4px rgba(3, 22, 28, 0.6),
        0 1px 0 #072a38;
}
body.panel-workspace .btn-secondary,
body.panel-workspace .btn-ghost,
body.panel-workspace .btn-outline-light {
    background: rgba(103, 232, 249, 0.08);
    border: 1px solid rgba(103, 232, 249, 0.28);
    color: #cffafe;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 8px 20px -12px rgba(0, 0, 0, 0.7);
}
body.panel-workspace .btn-secondary:hover,
body.panel-workspace .btn-ghost:hover,
body.panel-workspace .btn-outline-light:hover {
    background: rgba(103, 232, 249, 0.16);
    border-color: rgba(103, 232, 249, 0.5);
    color: #fff;
    transform: translateY(-2px);
}

/* ---------- text contrast on glass ---------- */
body.panel-workspace h1,
body.panel-workspace h2,
body.panel-workspace h3,
body.panel-workspace h4,
body.panel-workspace h5,
body.panel-workspace .card-title,
body.panel-workspace .modal-title,
body.panel-workspace .fw-bold {
    color: #eaf3fb;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
body.panel-workspace .text-muted,
body.panel-workspace .form-label,
body.panel-workspace .form-text {
    color: #9db4ca;
}
body.panel-workspace a {
    color: #67e8f9;
}
body.panel-workspace .text-primary {
    color: #67e8f9 !important;
}

/* ---------- login page (same file, body.login-page) ---------- */
body.login-page {
    background: transparent;
}
body.login-page .login-box,
body.login-page .log-box,
body.login-page .box {
    background: linear-gradient(165deg, rgba(13, 34, 52, 0.78), rgba(5, 13, 24, 0.72));
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    border: 1px solid rgba(103, 232, 249, 0.2);
    border-radius: 22px;
    box-shadow:
        0 34px 80px -28px rgba(0, 0, 0, 0.95),
        0 0 50px -22px rgba(34, 211, 238, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.45);
    color: #e8f1f9;
}

/* ---------- low-end handhelds: shed blur cost ---------- */
@media (max-width: 620px) {
    body.panel-workspace .app-view,
    body.panel-workspace .svc-card,
    body.panel-workspace .svc-card-showcase,
    body.panel-workspace .svc-card-row,
    body.panel-workspace .svc-card-tile,
    body.panel-workspace .topup-shell,
    body.panel-workspace .topup-wallet,
    body.panel-workspace .card,
    body.panel-workspace .modal-content,
    body.panel-workspace .panel-desk-iconbar,
    body.panel-workspace .top-navbar,
    body.login-page .login-box,
    body.login-page .log-box,
    body.login-page .box {
        backdrop-filter: blur(10px) saturate(135%);
        -webkit-backdrop-filter: blur(10px) saturate(135%);
    }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    body.panel-workspace .svc-card,
    body.panel-workspace .svc-card-showcase,
    body.panel-workspace .svc-card-tile,
    body.panel-workspace .btn-primary,
    body.panel-workspace .btn-fill,
    body.panel-workspace .btn-secondary,
    body.panel-workspace .btn-ghost,
    body.panel-workspace .sidebar-nav-item {
        transition: none !important;
    }
}
