/**
 * Alliance Auth CSS Framework
 *
 * This provides some CSS classes together with a couple of Bootstrap fixes
 * to be used throughout Alliance Auth and its Community Apps
 */

/* General
------------------------------------------------------------------------------------- */
@media all {
    .navbar-toggler.collapsed {
        transform: rotate(180deg);
    }

    ul#nav-right:has(li) + ul#nav-right-character-control > li:first-child {
        display: list-item !important;
    }
}

@media all and (max-width: 991px) {
    ul#nav-left:has(li) + ul#nav-right + ul#nav-right-character-control > li:first-child {
        display: list-item !important;
    }
}

/* Bootstrap fixes
------------------------------------------------------------------------------------- */
@media all {
    .table {
        --bs-table-bg: transparent;
    }
}

/* Image overflow fix
------------------------------------------------------------------------------------- */
@media all {
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Side Navigation
------------------------------------------------------------------------------------- */
@media all {
    #sidebar > div {
        width: 325px;
    }

    /* Menu items in general */
    #sidebar-menu li > a,
    #sidebar-menu li > ul > li > a {
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        max-width: 210px;
    }

    /* Parent items with chevron and possible badge */
    #sidebar-menu li:has(span.badge) > a[data-bs-toggle="collapse"] {
        max-width: 180px;
    }

    /* Child items with possible badge */
    #sidebar-menu li > ul > li > a {
        max-width: 189px;
    }

    /* Chevron icons */
    #sidebar-menu span[data-bs-toggle="collapse"][aria-expanded="true"] > i.fa-chevron-down,
    #sidebar-menu span[data-bs-toggle="collapse"][aria-expanded="false"] > i.fa-chevron-right {
        display: block;
        width: 16px;
    }

    #sidebar-menu span[data-bs-toggle="collapse"][aria-expanded="true"] > i.fa-chevron-right,
    #sidebar-menu span[data-bs-toggle="collapse"][aria-expanded="false"] > i.fa-chevron-down {
        display: none;
    }
}

/* Cursor classes
------------------------------------------------------------------------------------- */
@media all {
    .cursor-auto {
        cursor: auto;
    }

    .cursor-default {
        cursor: default;
    }

    .cursor-pointer {
        cursor: pointer;
    }

    .cursor-wait {
        cursor: wait;
    }

    .cursor-text {
        cursor: text;
    }

    .cursor-move {
        cursor: move;
    }

    .cursor-help {
        cursor: help;
    }

    .cursor-not-allowed {
        cursor: not-allowed;
    }

    .cursor-inherit {
        cursor: inherit;
    }

    .cursor-zoom-in {
        cursor: zoom-in;
    }

    .cursor-zoom-out {
        cursor: zoom-out;
    }
}

/* Callouts
 *
 * Not quite alerts, but custom and helpful notes for folks.
 * Requires a base and modifier class.
------------------------------------------------------------------------------------- */
@media all {
    /* Common styles for all types */
    .aa-callout {
        border: 1px solid var(--bs-border-color);
        border-left-width: 0.25rem;
        border-radius: 0.25rem;
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .aa-callout.aa-callout-sm {
        padding: 0.5rem;
    }

    .aa-callout.aa-callout-lg {
        padding: 1.5rem;
    }

    /* Last item bottom margin should be 0 */
    .aa-callout :last-child {
        margin-bottom: 0;
    }

    /* Variations */
    .aa-callout.aa-callout-danger {
        border-left-color: var(--bs-danger);
    }

    .aa-callout.aa-callout-info {
        border-left-color: var(--bs-info);
    }

    .aa-callout.aa-callout-success {
        border-left-color: var(--bs-success);
    }

    .aa-callout.aa-callout-warning {
        border-left-color: var(--bs-warning);
    }
}
