/* ==========================================================================
   NimbusToolbox — Standalone toolbox widget
   ==========================================================================
   nimbus-toolbox.css

   Self-contained styles for the NimbusToolbox jQuery plugin.
   Includes view-switcher layout overrides (icon / table / card)
   and custom context menu (no Kendo dependency).
   Does NOT redefine base .toolboxItem or .fa-glow-* styles — those come
   from the host application's toolbox.css.
   ========================================================================== */

/* ── Context Menu ─────────────────────────────────────────────────────── */
.ntb-context-menu {
    display: none;
    position: fixed;
    z-index: 10000;
    min-width: 150px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    padding: 4px 0;
    font-size: 0.9rem;
}

    .ntb-context-menu.ntb-context-menu-visible {
        display: block;
    }

    .ntb-context-menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .ntb-context-menu li {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 7px 14px;
        cursor: pointer;
        color: #333;
        white-space: nowrap;
    }

        .ntb-context-menu li:hover {
            background-color: #337ab7;
            color: #fff;
        }

        .ntb-context-menu li i {
            width: 1.1em;
            text-align: center;
        }

/* ── View-Switcher Dropdown (in search bar) ───────────────────────────── */
.ntb-view-dropdown .dropdown-toggle {
    border-right: 1px solid #ccc;
}

.ntb-view-dropdown .dropdown-menu {
    min-width: 140px;
}

    .ntb-view-dropdown .dropdown-menu > li > a {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 6px 14px;
        color: #333;
    }

    .ntb-view-dropdown .dropdown-menu > li.active > a,
    .ntb-view-dropdown .dropdown-menu > li.active > a:hover {
        background-color: #337ab7;
        color: #fff;
    }

    .ntb-view-dropdown .dropdown-menu > li > a:hover {
        background-color: #f5f5f5;
    }

/* ── Pinned section ───────────────────────────────────────────────────── */
.ntb-pinned {
    min-height: 1em;
    background: #f9fafe;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

    .ntb-pinned:empty {
        display: none;
    }

/* ── Icon View (default) ──────────────────────────────────────────────── */
/* No overrides — uses base .toolboxItem inline-block layout.             */

/* ── Table / List View ────────────────────────────────────────────────── */
.ntb-view-table [data-type="toolboxItem"] {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    width: 100%;
    text-align: left;
    margin: 0;
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid #eee;
    gap: 0.75rem;
}

    .ntb-view-table [data-type="toolboxItem"]:last-child {
        border-bottom: none;
    }

    /* Constrain icons to a fixed square so glow classes cannot distort them */
    .ntb-view-table [data-type="toolboxItem"] > i {
        font-size: 1.4rem !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        line-height: 28px !important;
        padding: 4px !important;
        margin: 0 !important;
        flex-shrink: 0;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        box-shadow: none !important;
        border-width: 2px !important;
        border-radius: 20% !important;
        text-align: center;
    }

    .ntb-view-table [data-type="toolboxItem"] .subtext {
        display: flex;
        flex-direction: column;
        text-align: left;
        flex: 1;
        min-width: 0;
    }

    /* Reveal the sr-only description in table view */
    .ntb-view-table [data-type="toolboxItem"] [data-type="toolboxItemMetaData"] {
        position: static !important;
        width: auto !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        clip: auto !important;
        clip-path: none !important;
        white-space: normal !important;
        border: 0 !important;
        font-size: 0.8rem;
        color: #595959;
    }

    .ntb-view-table [data-type="toolboxItem"] [data-type="toolboxItemTitle"] {
        font-weight: 600;
        font-size: 0.9rem;
        color: #333;
    }

/* ── Card View ────────────────────────────────────────────────────────── */
.ntb-view-card {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

    .ntb-view-card [data-type="toolboxItem"] {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        width: 130px;
        text-align: center;
        margin: 0;
        padding: 0.75rem 0.5rem;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: #fff;
        transition: box-shadow 0.2s, border-color 0.2s;
    }

        .ntb-view-card [data-type="toolboxItem"]:hover {
            border-color: #337ab7;
            box-shadow: 0 2px 8px rgba(51,122,183,0.15);
        }

        /* Constrain icons to a fixed square for consistent card layout */
        .ntb-view-card [data-type="toolboxItem"] > i {
            font-size: 1.75rem !important;
            width: 48px !important;
            height: 48px !important;
            min-width: 48px !important;
            line-height: 40px !important;
            padding: 4px !important;
            margin: 0 0 0.35rem 0 !important;
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            box-shadow: none !important;
            border-width: 2px !important;
            border-radius: 20% !important;
        }

        .ntb-view-card [data-type="toolboxItem"] .subtext {
            display: flex;
            flex-direction: column;
            text-align: center;
            width: 100%;
        }

        /* Reveal the sr-only description in card view */
        .ntb-view-card [data-type="toolboxItem"] [data-type="toolboxItemMetaData"] {
            position: static !important;
            width: auto !important;
            height: auto !important;
            padding: 0 !important;
            margin: 0.2rem 0 0 0 !important;
            overflow: visible !important;
            clip: auto !important;
            clip-path: none !important;
            white-space: normal !important;
            border: 0 !important;
            font-size: 0.75rem;
            color: #595959;
        }

        .ntb-view-card [data-type="toolboxItem"] [data-type="toolboxItemTitle"] {
            font-weight: 600;
            font-size: 0.85rem;
            color: #333;
            word-break: break-word;
        }
