/**
 * ==========================================================================
 * CARDS SETTINGS SIDEBAR — Layout & Overflow Fixes
 * ==========================================================================
 *
 * Fixes for the settings sidebar that appears on user settings pages.
 * Ensures the sidebar dropdown doesn't overflow onto adjacent content.
 *
 * Pure CSS — ZERO Bootstrap, ZERO Tailwind.
 *
 * @project    ContentFlows / HoloSuite Industries
 * @version    1.0.0
 */


/* ==========================================================================
   1. SIDEBAR CONTAINER
   ========================================================================== */

/**
 * Settings sidebar container.
 * Creates a stacking context so dropdowns stay within bounds.
 */
.grid-quarter,
.grid-half.grid-quarter-lg {
    position: relative;
    z-index: 1;
}

/**
 * Main content column should be above the settings sidebar.
 */
.grid-three-quarters,
.grid-two-thirds,
.grid-half.grid-three-quarters-lg,
.grid-content-lg {
    position: relative;
    z-index: 2;
}


/* ==========================================================================
   2. MENU EXPAND BUTTON
   ========================================================================== */

/**
 * The "Menu" button that toggles the settings dropdown.
 * Mobile-first: shown on small screens, hidden on desktop.
 */
.button-menu-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 8px;
    background: var(--color-primary, #e91e8c);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-menu-expand:hover {
    background: var(--color-primary-hover, #d41a7d);
}

.button-menu-expand i,
.menu-icon-spacing {
    margin-right: 0.5rem;
}

/**
 * Hide the menu button on large screens where sidebar is always visible.
 */
@media (min-width: 992px) {
    .button-menu-expand {
        display: none;
    }
    
    /**
     * Show the collapsible content by default on desktop.
     */
    #navbarUserHome.collapse {
        display: block !important;
    }
}


/* ==========================================================================
   3. COLLAPSIBLE CONTENT
   ========================================================================== */

/**
 * The nav-collapsible container holds the settings menu.
 */
.nav-collapsible.collapse {
    display: none;
}

.nav-collapsible.collapse.show {
    display: block;
}

/**
 * Ensure content doesn't overflow horizontally.
 */
#navbarUserHome {
    max-width: 100%;
    overflow-x: hidden;
}


/* ==========================================================================
   4. CARD SETTINGS PANELS
   ========================================================================== */

/**
 * Settings card panels.
 */
.card-settings {
    background: var(--color-bg-elevated, #12122a);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-settings .list-container {
    padding: 1rem;
}

.card-settings .text-uppercase {
    display: block;
    padding: 0 0 0.75rem 0;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--color-text-muted, #6e6e90);
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
}

/**
 * List items in settings cards.
 */
.card-settings .list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--color-text, #f0f0fa);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.04));
    transition: all 0.2s ease;
}

.card-settings .list-item:last-child {
    border-bottom: none;
}

.card-settings .list-item:hover {
    color: var(--color-primary, #e91e8c);
}

.card-settings .list-item.active {
    color: var(--color-primary, #e91e8c);
    font-weight: 600;
}

.card-settings .list-item > div:first-child {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-settings .list-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: 0.85;
}

.card-settings .list-item:hover i {
    opacity: 1;
}

/**
 * Icon spacing utility.
 */
.icon-spacing-right {
    margin-right: 0.75rem;
}


/* ==========================================================================
   5. BADGES
   ========================================================================== */

.card-settings .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    min-width: 18px;
    height: 18px;
}

.card-settings .badge-warning {
    background: var(--color-warning, #f59e0b);
    color: #ffffff;
}


/* ==========================================================================
   6. LIGHT THEME OVERRIDES
   ========================================================================== */

[data-theme="light"] .card-settings {
    background: var(--color-bg-elevated, #ffffff);
    border-color: var(--color-border, #e5e7eb);
}

[data-theme="light"] .card-settings .text-uppercase {
    color: var(--color-text-muted, #6b7280);
    border-bottom-color: var(--color-border, #e5e7eb);
}

[data-theme="light"] .card-settings .list-item {
    color: var(--color-text, #1f2937);
    border-bottom-color: var(--color-border, #f3f4f6);
}

[data-theme="light"] .card-settings .list-item:hover,
[data-theme="light"] .card-settings .list-item.active {
    color: var(--color-primary, #e91e8c);
}


/* ==========================================================================
   7. RESPONSIVE — Mobile First
   ========================================================================== */

@media (max-width: 991px) {
    /**
     * On mobile, the settings sidebar should be a full-width dropdown.
     */
    .grid-quarter,
    .grid-half.grid-quarter-lg {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /**
     * Position the dropdown content properly on mobile.
     */
    #navbarUserHome {
        position: relative;
        z-index: 10;
        background: var(--color-bg, #0c0c1e);
        border-radius: 8px;
        padding: 0.5rem;
        margin-bottom: 1rem;
    }
    
    [data-theme="light"] #navbarUserHome {
        background: var(--color-bg, #f9fafb);
    }
}


/* ==========================================================================
   END OF FILE
   ========================================================================== */
