/* ============================================================
   WalletHub – Global App Styles
   "Mud Mini" dark-first premium theme
   ============================================================ */

/* ---- Typography hierarchy ---- */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ---- Section card ---- */
/* Drop-in replacement for the inline Style="--mud-palette-surface:..." pattern */
.wh-card {
    border-radius: var(--mud-default-borderradius);
    padding: 1.25rem 1.5rem;
    background-color: var(--mud-palette-surface);
    box-shadow: var(--mud-elevation-2);
}

/* Card header row (title + optional actions on the right) */
.wh-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* ---- Page container ---- */
.wh-page {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

/* ---- KPI / summary card ---- */
.wh-kpi-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-radius: var(--mud-default-borderradius);
    background-color: var(--mud-palette-surface);
    box-shadow: var(--mud-elevation-2);
    text-align: center;
}

.wh-kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.15);
    margin-bottom: 0.25rem;
}

/* ---- Active nav link (desktop sidebar) ---- */
.mud-nav-link.active {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    color: var(--mud-palette-primary) !important;
    border-left: 3px solid var(--mud-palette-primary);
    font-weight: 600;
}

/* Remove left-border shift for non-active links */
.mud-nav-link:not(.active) {
    border-left: 3px solid transparent;
}

/* ---- AppBar branding ---- */
.wh-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    margin-left: 0.5rem;
    transition: opacity 0.2s ease;
}

.wh-brand-link:hover {
    opacity: 0.85;
}

.wh-brand-icon {
    font-size: 1.6rem !important;
    background: linear-gradient(135deg, var(--mud-palette-primary), var(--mud-palette-tertiary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.35));
}

.wh-brand-wallet {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--mud-palette-tertiary), var(--mud-palette-text-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wh-brand-hub {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--mud-palette-primary), var(--mud-palette-primary-lighten));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.25));
}

/* ---- Mobile bottom nav ---- */
@media (max-width: 959px) {
    /* Push body content above the fixed bottom nav */
    .wh-mobile-main {
        padding-bottom: 72px !important;
    }

    /* Hide sidebar on mobile */
    .wh-desktop-drawer {
        display: none !important;
    }
}

@media (min-width: 960px) {
    /* Hide bottom nav on desktop */
    .wh-bottom-nav {
        display: none !important;
    }
}

/* ---- No horizontal scroll at 1600px ---- */
html, body {
    overflow-x: hidden;
}

/* ---- Table tweaks ---- */
.td-right {
    text-align: right !important;
}

/* Tabular numbers for financial data */
.num {
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ---- Progress bar in dashboard table ---- */
.pct-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 180px;
}

.pct-bar {
    flex: 1 1 auto;
    height: 10px;
}

.pct-label {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    white-space: nowrap;
}

/* ---- Chart fill opacity (donut) ---- */
#chart path[fill] {
    fill-opacity: 0.40;
}

/* ---- Drawer (right-side instrument detail) ---- */
.wh-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.5rem;
    border-bottom: 1px solid var(--mud-palette-divider);
}

/* ---- Subtle section separator ---- */
.wh-section-divider {
    border: none;
    border-top: 1px solid var(--mud-palette-divider);
    margin: 1rem 0;
}

/* ---- Dialog styling ---- */
.mud-dialog .mud-dialog-title {
    font-weight: 700;
    font-size: 1.1rem;
}

/* ---- Responsive helpers ---- */
.wh-hide-mobile {
    display: block;
}

@media (max-width: 599px) {
    .wh-hide-mobile {
        display: none;
    }
}

/* ---- Auth / Account pages ---- */
.wh-auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem 1rem 3rem;
}

.wh-auth-card {
    width: 100%;
    max-width: 520px;
    padding: 2.5rem 2rem;
    border-radius: 16px !important;
}

/* Manage account sidebar layout */
.wh-manage-nav {
    border-right: 1px solid var(--mud-palette-divider);
    padding-right: 1.5rem;
}

@media (max-width: 959px) {
    .wh-auth-card {
        padding: 1.5rem 1rem;
    }
    .wh-manage-nav {
        border-right: none;
        border-bottom: 1px solid var(--mud-palette-divider);
        padding-right: 0;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
}
