/**
 * CXAA Member Hub - Unified Modern Dashboard Design System
 * Completely rebuilt from scratch for Light Mode and Dark Mode.
 */

/* ==========================================================================
   1. Design Tokens & CSS Custom Properties
   ========================================================================== */
:root {
    /* Brand Accent Colors */
    --hub-primary: #2563EB;
    --hub-primary-hover: #1D4ED8;
    --hub-primary-active: #1E40AF;
    --hub-primary-subtle: rgba(37, 99, 235, 0.08);
    --hub-primary-glow: rgba(37, 99, 235, 0.22);

    /* Light Theme Palette */
    --hub-bg: #F8FAFC;
    --hub-card-bg: #FFFFFF;
    --hub-sidebar-bg: #FFFFFF;
    --hub-header-bg: rgba(255, 255, 255, 0.88);
    --hub-dropdown-bg: #FFFFFF;
    --hub-modal-bg: #FFFFFF;

    /* Borders */
    --hub-border: #E2E8F0;
    --hub-border-subtle: #F1F5F9;
    --hub-border-focus: #2563EB;

    /* Text Colors */
    --hub-text-main: #0F172A;
    --hub-text-secondary: #475569;
    --hub-text-muted: #94A3B8;
    --hub-text-inverse: #FFFFFF;

    /* Form Inputs */
    --hub-input-bg: #FFFFFF;
    --hub-input-border: #CBD5E1;
    --hub-input-focus-bg: #FFFFFF;

    /* Semantic Accents */
    --hub-success: #10B981;
    --hub-success-subtle: rgba(16, 185, 129, 0.1);
    --hub-warning: #F59E0B;
    --hub-warning-subtle: rgba(245, 158, 11, 0.1);
    --hub-danger: #EF4444;
    --hub-danger-subtle: rgba(239, 68, 68, 0.1);
    --hub-info: #06B6D4;
    --hub-info-subtle: rgba(6, 182, 212, 0.1);

    /* Shadows */
    --hub-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --hub-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --hub-shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --hub-shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);

    /* Radii */
    --hub-radius-sm: 8px;
    --hub-radius-md: 12px;
    --hub-radius-lg: 16px;
    --hub-radius-xl: 20px;
    --hub-radius-pill: 9999px;

    /* Typography */
    --hub-font: 'Inter', 'Noto Sans Armenian', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --hub-font-heading: 'Outfit', 'Inter', 'Noto Sans Armenian', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Layout Dimensions */
    --hub-sidebar-width: 250px;
    --hub-sidebar-collapsed-width: 72px;
    --hub-header-height: 64px;
    --hub-zoom: 1;

    /* Transitions */
    --hub-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   2. Dark Theme Palette
   ========================================================================== */
[data-theme="dark"] {
    --hub-primary: #3B82F6;
    --hub-primary-hover: #60A5FA;
    --hub-primary-active: #93C5FD;
    --hub-primary-subtle: rgba(59, 130, 246, 0.14);
    --hub-primary-glow: rgba(59, 130, 246, 0.3);

    --hub-bg: #090D16;
    --hub-card-bg: #111827;
    --hub-sidebar-bg: #0E1424;
    --hub-header-bg: rgba(14, 20, 36, 0.88);
    --hub-dropdown-bg: #131C2E;
    --hub-modal-bg: #111827;

    --hub-border: #1E293B;
    --hub-border-subtle: #172033;
    --hub-border-focus: #3B82F6;

    --hub-text-main: #F8FAFC;
    --hub-text-secondary: #94A3B8;
    --hub-text-muted: #64748B;
    --hub-text-inverse: #0F172A;

    --hub-input-bg: #162032;
    --hub-input-border: #26354D;
    --hub-input-focus-bg: #1A263D;

    --hub-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --hub-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --hub-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --hub-shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   3. Global Reset & Base Setup
   ========================================================================== */
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--hub-font) !important;
    background-color: var(--hub-bg) !important;
    color: var(--hub-text-main) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: calc(100vh / var(--hub-zoom, 1));
    min-height: calc(100dvh / var(--hub-zoom, 1));
}

body.hub-body {
    display: flex;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--hub-font-heading) !important;
    color: var(--hub-text-main);
    font-weight: 700;
    letter-spacing: -0.015em;
}

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

a:hover {
    color: var(--hub-primary-hover);
}

/* ==========================================================================
   4. Sidebar (Collapsible & Persistent)
   ========================================================================== */
#sidebar {
    width: var(--hub-sidebar-width);
    min-width: var(--hub-sidebar-width);
    height: 100vh;
    height: calc(100vh / var(--hub-zoom, 1));
    height: calc(100dvh / var(--hub-zoom, 1));
    position: sticky;
    top: 0;
    left: 0;
    background: var(--hub-sidebar-bg);
    border-right: 1px solid var(--hub-border);
    display: flex;
    flex-direction: column;
    z-index: 1010;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    overflow-y: auto;
}

/* Custom scrollbar for sidebar */
#sidebar::-webkit-scrollbar {
    width: 4px;
}
#sidebar::-webkit-scrollbar-thumb {
    background: var(--hub-border);
    border-radius: 4px;
}

.sidebar-header {
    height: var(--hub-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--hub-border);
    flex-shrink: 0;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    background: var(--hub-primary);
    color: #FFFFFF;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px var(--hub-primary-glow);
}

.sidebar-brand-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--hub-text-main);
    letter-spacing: -0.01em;
    transition: opacity 0.15s ease;
}

.hub-sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--hub-border);
    border-radius: 8px;
    color: var(--hub-text-secondary);
    cursor: pointer;
    transition: var(--hub-transition);
    padding: 0;
}

.hub-sidebar-toggle-btn:hover {
    background: var(--hub-border-subtle);
    color: var(--hub-text-main);
}

.sidebar-menu {
    padding: 12px 0 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.sidebar-category {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hub-text-muted);
    padding: 18px 18px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}

/* Nav Links inside Sidebar */
#sidebar .nav-link-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 2px 10px;
    border-radius: 10px;
    color: var(--hub-text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--hub-transition);
    white-space: nowrap;
}

#sidebar .nav-link-modern i,
#sidebar .nav-link-modern svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: inherit;
    stroke-width: 2px;
}

#sidebar .nav-link-modern:hover {
    background: var(--hub-border-subtle);
    color: var(--hub-text-main);
}

#sidebar .nav-link-modern.active {
    background: var(--hub-primary-subtle);
    color: var(--hub-primary);
    font-weight: 600;
}

#sidebar .nav-link-modern.text-danger:hover {
    background: var(--hub-danger-subtle);
    color: var(--hub-danger) !important;
}

/* ==========================================================================
   5. Collapsed Sidebar Mode (Desktop)
   ========================================================================== */
@media (min-width: 992px) {
    html.hub-sidebar-collapsed #sidebar {
        width: var(--hub-sidebar-collapsed-width) !important;
        min-width: var(--hub-sidebar-collapsed-width) !important;
    }

    html.hub-sidebar-collapsed #sidebar .sidebar-brand-text {
        display: none !important;
    }

    html.hub-sidebar-collapsed #sidebar .sidebar-category {
        font-size: 0 !important;
        height: 1px !important;
        padding: 0 !important;
        margin: 12px 14px !important;
        background: var(--hub-border) !important;
        overflow: hidden !important;
    }

    html.hub-sidebar-collapsed #sidebar .nav-link-modern {
        justify-content: center !important;
        padding: 10px 0 !important;
        margin: 4px 10px !important;
        gap: 0 !important;
    }

    html.hub-sidebar-collapsed #sidebar .nav-link-modern .nav-link-text {
        display: none !important;
    }

    html.hub-sidebar-collapsed #sidebar #sidebarCollapseBtn {
        display: none !important;
    }
}

/* ==========================================================================
   6. Mobile Sidebar Drawer & Overlay
   ========================================================================== */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: var(--hub-shadow-lg);
        z-index: 10050;
    }

    #sidebar.mobile-open {
        transform: translateX(0);
    }

    #sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 10040;
    }

    #sidebar-overlay.active {
        display: block;
    }
}

/* ==========================================================================
   7. Page Content Shell & Sticky Header
   ========================================================================== */
#content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--hub-bg);
}

.hub-header-v2 {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: var(--hub-header-height);
    background: var(--hub-header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hub-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

@media (min-width: 992px) {
    .hub-header-v2 {
        padding: 0 32px;
    }
}

.hub-hamburger {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--hub-card-bg);
    border: 1px solid var(--hub-border);
    border-radius: 10px;
    color: var(--hub-text-secondary);
    cursor: pointer;
    transition: var(--hub-transition);
    padding: 0;
}

.hub-hamburger:hover {
    background: var(--hub-border-subtle);
    color: var(--hub-primary);
    border-color: var(--hub-primary);
}

/* Search Container in Header */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 240px;
}

.search-container .search-icon {
    position: absolute;
    left: 12px;
    width: 15px;
    height: 15px;
    color: var(--hub-text-muted);
    pointer-events: none;
}

.search-container .search-input {
    width: 100%;
    height: 38px !important;
    min-height: 38px !important;
    padding-left: 36px !important;
    padding-right: 12px !important;
    font-size: 13.5px !important;
    border-radius: 999px !important;
}

/* Indicator Pills (Notifications, Globe) */
.indicator-pill {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--hub-card-bg);
    border: 1px solid var(--hub-border);
    border-radius: 10px;
    color: var(--hub-text-secondary);
    cursor: pointer;
    transition: var(--hub-transition);
}

.indicator-pill:hover {
    background: var(--hub-border-subtle);
    color: var(--hub-primary);
}

.indicator-pill--lang {
    width: auto !important;
    padding: 0 12px !important;
    gap: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* Theme Switcher Pill */
.theme-switch-pill {
    width: 68px;
    height: 36px;
    background: var(--hub-card-bg);
    border: 1px solid var(--hub-border);
    border-radius: 999px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 3px;
    cursor: pointer;
    transition: var(--hub-transition);
}

.theme-switch-pill .indicator {
    position: absolute;
    width: 28px;
    height: 28px;
    background: var(--hub-primary);
    border-radius: 50%;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

[data-theme="dark"] .theme-switch-pill .indicator {
    transform: translateX(32px);
}

.theme-switch-pill .icon-wrapper {
    width: 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.theme-switch-pill svg,
.theme-switch-pill i {
    width: 15px;
    height: 15px;
    transition: color 0.2s ease;
}

.theme-switch-pill .theme-icon-light {
    color: #FFFFFF;
}

.theme-switch-pill .theme-icon-dark {
    color: var(--hub-text-muted);
}

[data-theme="dark"] .theme-switch-pill .theme-icon-light {
    color: var(--hub-text-muted);
}

[data-theme="dark"] .theme-switch-pill .theme-icon-dark {
    color: #FFFFFF;
}

/* Profile Pill in Header */
.profile-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    background: var(--hub-card-bg);
    border: 1px solid var(--hub-border);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--hub-transition);
}

.profile-pill:hover {
    border-color: var(--hub-primary);
}

/* ==========================================================================
   8. Dropdown Menus (Unified, Left-to-Right Aligned)
   ========================================================================== */
.hub-dropdown {
    background: var(--hub-dropdown-bg) !important;
    border: 1px solid var(--hub-border) !important;
    border-radius: var(--hub-radius-md) !important;
    box-shadow: var(--hub-shadow-lg) !important;
    padding: 6px !important;
    margin-top: 8px !important;
}

.hub-dropdown .dropdown-item,
.hub-dropdown .dropdown-item.nav-link-modern {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    width: 100% !important;
    border-radius: var(--hub-radius-sm) !important;
    padding: 8px 12px !important;
    gap: 10px !important;
    color: var(--hub-text-main) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    background: transparent !important;
    transition: var(--hub-transition) !important;
    margin: 1px 0 !important;
}

.hub-dropdown .dropdown-item:hover,
.hub-dropdown .dropdown-item.nav-link-modern:hover {
    background: var(--hub-border-subtle) !important;
    color: var(--hub-primary) !important;
}

.hub-dropdown .dropdown-item.text-danger:hover {
    background: var(--hub-danger-subtle) !important;
    color: var(--hub-danger) !important;
}

.hub-dropdown .dropdown-divider {
    border-color: var(--hub-border) !important;
    margin: 4px 0 !important;
}

/* ==========================================================================
   9. Main Container & Cards
   ========================================================================== */
#hub-main-content {
    flex: 1;
    padding: 24px 20px;
    transition: opacity 0.14s ease, transform 0.14s ease;
}

@media (min-width: 768px) {
    #hub-main-content {
        padding: 28px 32px;
    }
}

.modern-card,
.hub-card {
    background: var(--hub-card-bg);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-lg);
    box-shadow: var(--hub-shadow-xs);
    padding: 24px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modern-card:hover,
.hub-card:hover {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: var(--hub-shadow-sm);
}

/* Stat Figures */
.stat-figure {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--hub-text-main);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Trend & Status Pills (Zero Emoji) */
.trend-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--hub-radius-pill);
}

.trend-up {
    background: var(--hub-success-subtle);
    color: var(--hub-success);
}

.trend-down {
    background: var(--hub-danger-subtle);
    color: var(--hub-danger);
}

/* ==========================================================================
   10. Form Controls (Uniform 42px Height & Custom Select)
   ========================================================================== */
.form-control,
.form-select,
.search-input {
    height: 42px !important;
    min-height: 42px !important;
    padding: 8px 14px !important;
    font-size: 14px !important;
    font-family: var(--hub-font) !important;
    color: var(--hub-text-main) !important;
    background-color: var(--hub-input-bg) !important;
    border: 1px solid var(--hub-input-border) !important;
    border-radius: var(--hub-radius-md) !important;
    box-shadow: var(--hub-shadow-xs) !important;
    box-sizing: border-box !important;
    transition: var(--hub-transition) !important;
}

textarea.form-control {
    height: auto !important;
    min-height: 78px !important;
    padding: 10px 14px !important;
}

/* Custom Vector SVG Line Arrow for Selects */
.form-select,
select.form-control {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding-right: 38px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px 16px !important;
    cursor: pointer !important;
}

[data-theme="dark"] .form-select,
[data-theme="dark"] select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.form-control:focus,
.form-select:focus,
.search-input:focus {
    border-color: var(--hub-primary) !important;
    box-shadow: 0 0 0 3px var(--hub-primary-glow) !important;
    outline: none !important;
}

/* ==========================================================================
   11. Buttons (Clean, Modern, Vector Icons)
   ========================================================================== */
.btn-modern,
.btn-primary,
.btn-light,
.btn-outline-primary {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--hub-radius-md);
    transition: var(--hub-transition);
    cursor: pointer;
    text-decoration: none;
}

.btn-modern-primary,
.btn-primary {
    background: var(--hub-primary) !important;
    border: 1px solid var(--hub-primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.btn-modern-primary:hover,
.btn-primary:hover {
    background: var(--hub-primary-hover) !important;
    border-color: var(--hub-primary-hover) !important;
    color: #FFFFFF !important;
    transform: translateY(-1px);
}

.btn-light {
    background: var(--hub-card-bg) !important;
    border: 1px solid var(--hub-border) !important;
    color: var(--hub-text-main) !important;
}

.btn-light:hover {
    background: var(--hub-border-subtle) !important;
    color: var(--hub-text-main) !important;
    border-color: var(--hub-border) !important;
}

.btn-outline-primary {
    background: transparent !important;
    border: 1px solid var(--hub-border) !important;
    color: var(--hub-primary) !important;
}

.btn-outline-primary:hover {
    background: var(--hub-primary-subtle) !important;
    border-color: var(--hub-primary) !important;
}

/* Small Button */
.btn-sm {
    height: 32px !important;
    padding: 0 12px !important;
    font-size: 12.5px !important;
}

/* ==========================================================================
   12. Tables (Clean SaaS Style)
   ========================================================================== */
.table {
    color: var(--hub-text-main) !important;
    border-color: var(--hub-border) !important;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    background-color: transparent !important;
    border-bottom-color: var(--hub-border) !important;
    padding: 14px 16px;
    vertical-align: middle;
}

.table thead th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hub-text-muted);
    border-bottom: 1px solid var(--hub-border) !important;
}

.table tbody tr:hover td {
    background-color: var(--hub-border-subtle) !important;
}

/* ==========================================================================
   13. Popups & Modals (Rule Compliant: Backdrop Blur Covers Header)
   ========================================================================== */
.modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: calc(100vw / var(--hub-zoom, 1)) !important;
    height: calc(100vh / var(--hub-zoom, 1)) !important;
    z-index: 10050 !important;
    background-color: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.modal-backdrop.show {
    opacity: 1 !important;
}

.modal {
    z-index: 10060 !important;
}

.modal-dialog {
    margin: 1.75rem auto;
}

.modal-content {
    background: var(--hub-modal-bg) !important;
    border: 1px solid var(--hub-border) !important;
    border-radius: var(--hub-radius-lg) !important;
    box-shadow: var(--hub-shadow-lg) !important;
    color: var(--hub-text-main) !important;
}

.modal-header,
.modal-footer {
    border-color: var(--hub-border) !important;
}

/* ==========================================================================
   14. Library & In-Browser Reader Specifics
   ========================================================================== */
.lib-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--hub-border);
    background: var(--hub-card-bg);
    color: var(--hub-text-secondary);
    transition: var(--hub-transition);
}

.lib-filter-pill:hover {
    border-color: var(--hub-primary);
    color: var(--hub-primary);
}

.lib-filter-pill.active {
    background: var(--hub-primary);
    border-color: var(--hub-primary);
    color: #FFFFFF;
}

.lib-resource-card {
    background: var(--hub-card-bg);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--hub-transition);
}

.lib-resource-card:hover {
    transform: translateY(-2px);
    border-color: var(--hub-primary);
    box-shadow: var(--hub-shadow-md);
}

.lib-cover-box {
    position: relative;
    height: 190px;
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lib-cover-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   15. Utilities & Animations
   ========================================================================== */
.letter-spacing-1 {
    letter-spacing: 0.05em;
}

.extra-small {
    font-size: 11px;
}

.border-light {
    border-color: var(--hub-border) !important;
}

.bg-light {
    background-color: var(--hub-border-subtle) !important;
}

.text-muted {
    color: var(--hub-text-muted) !important;
}

.animate-fade-up {
    animation: hubFadeUp 0.22s cubic-bezier(0.2, 0.9, 0.4, 1) both;
}

@keyframes hubFadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   16. Unified HiDPI-Aware Responsive Sizing (Member Hub)
   ========================================================================== */
/* 1. Standard / Low-DPI Displays (Windows Laptops & Standard Monitors < 1.75dppx) */
@media (min-width: 992px) and (max-width: 1279.98px) {
    :root { --hub-zoom: 0.70; }
    body.hub-body { zoom: var(--hub-zoom); }
}
@media (min-width: 1280px) and (max-width: 1439.98px) {
    :root { --hub-zoom: 0.72; }
    body.hub-body { zoom: var(--hub-zoom); }
}
@media (min-width: 1440px) and (max-width: 1679.98px) {
    :root { --hub-zoom: 0.75; }
    body.hub-body { zoom: var(--hub-zoom); }
}
@media (min-width: 1680px) and (max-width: 2199.98px) {
    :root { --hub-zoom: 0.80; }
    body.hub-body { zoom: var(--hub-zoom); }
}
@media (min-width: 2200px) {
    :root { --hub-zoom: 0.85; }
    body.hub-body { zoom: var(--hub-zoom); }
}
@media (min-width: 992px) and (max-width: 1599.98px) and (max-height: 900px) and (max-resolution: 167dpi) {
    :root { --hub-zoom: 0.70; }
    body.hub-body { zoom: var(--hub-zoom); }
}

/* 2. HiDPI & Apple Retina Displays (>= 1.75dppx / >= 168dpi) */
@media (-webkit-min-device-pixel-ratio: 1.75), (min-resolution: 168dpi) {
    @media (min-width: 992px) and (max-width: 1399.98px) {
        :root { --hub-zoom: 0.84; }
        body.hub-body { zoom: var(--hub-zoom); }
    }
    @media (min-width: 1400px) and (max-width: 1679.98px) {
        :root { --hub-zoom: 0.90; }
        body.hub-body { zoom: var(--hub-zoom); }
    }
    @media (min-width: 1680px) and (max-width: 2399.98px) {
        :root { --hub-zoom: 0.96; }
        body.hub-body { zoom: var(--hub-zoom); }
    }
    @media (min-width: 2400px) and (max-width: 2799.98px) {
        :root { --hub-zoom: 0.90; }
        body.hub-body { zoom: var(--hub-zoom); }
    }
    @media (min-width: 2800px) {
        :root { --hub-zoom: 0.96; }
        body.hub-body { zoom: var(--hub-zoom); }
    }
}
