﻿/********************************************************************************************
    .ResourceWrapper: holds header + grid vertically
********************************************************************************************/

.ResourceWrapper {
    display: flex;
    flex-direction: column;
    /* Prevent body from gaining a scrollbar */
    height: 95vh;
    overflow: hidden; /* prevent the whole page from scrolling */
    min-height: 0; /* req'd so cards can shrink */

    flex: 1 1 500px; /* Let flex handle our width (same as CalendarWrapper) */
    min-width: 600px;
    box-sizing: border-box;
    margin: 0;
}

/********************************************************************************************
    .ResourceHeader: header right above the grid w/ title + Category filter
********************************************************************************************/

.ResourceHeader {
    display: flex;
    flex: 0 0 auto; /* only as much space as needed */
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.45rem 0.5rem;
    margin-bottom: 15px;
    justify-content: space-between; /* left text vs. right dropdown */
    align-items: center;
    text-align: center;
    font-size: 14px;
    font-weight: normal;
    background-color: #fff;
    box-shadow: 4px 4px 5px 0 rgba(115, 99, 87, 0.75);
}

    .ResourceHeader .HeaderLeft {
        display: flex;
        margin: 0.3rem 0 0 0.1rem;
        flex-direction: column;
        align-items: flex-start;
        font-weight: bold;
    }

        .ResourceHeader .HeaderLeft:has(img.FacilityLogo) {
            margin: 0 !important;
        }

            .ResourceHeader .HeaderLeft:has(img.FacilityLogo) .HeaderBranding span {
                font-size: 1rem;
                margin-left: 2px;
            }

        .ResourceHeader .HeaderLeft .HeaderBranding {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 0.5rem;
        }

            .ResourceHeader .HeaderLeft .HeaderBranding img {
                width: 48px;
                height: auto;
            }

        .ResourceHeader .HeaderLeft .HeaderButtonsBottom {
            margin-top: 16px;
            display: flex;
            align-items: center;
        }

            .ResourceHeader .HeaderLeft .HeaderButtonsBottom a.imgLink {
                margin-left: 9px;
            }

            .ResourceHeader .HeaderLeft .HeaderButtonsBottom button.imgButton label {
                cursor: pointer; /* Enable click-in cursor on button labels too */
                font-size: 12px;
            }

    /* Stack search and category vertically on the right */
    .ResourceHeader .HeaderRight {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

        .ResourceHeader .HeaderRight select {
            margin-left: 0.5rem;
            font-size: 14px;
        }

    .ResourceHeader .HeaderSearch {
        margin-bottom: 0.5rem;
    }

        .ResourceHeader .HeaderSearch #txtHeaderSearch {
            width: 24ch;
        }

    .ResourceHeader #dd_Category {
        margin-left: 0.5rem;
        font-size: 14px;
        width: 25ch;
    }

/********************************************************************************************
    .ResourceGrid: master wrapper for both Panels and the DayPilot container
      Size, dressing, positioning
********************************************************************************************/

.ResourceGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem; /* between cards */
    box-sizing: border-box;
    /* Also make it flexible in the .MainWrapper */
    flex: 1 1 auto;
    overflow-y: auto;
    min-width: 300px;
    min-height: 0; /* prevent grid from forcing extra height */
    /* Prevent cards from stretching vertically when there aren't enough to fill view height */
    align-items: start;
    align-content: start;
}

    .ResourceGrid .ResourceCard:last-child {
        margin-bottom: 10px; /* Make sure we do not clip into the card drop shadows at the end of the scrollable grid */
    }

/********************************************************************************************
    Single SKU card
********************************************************************************************/

.ResourceCard {
    position: relative; /* StatusIcon needs to be anchored w/ position:absolute; inside the cards */
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.75rem;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 4px 4px 7px 0 rgba(115, 99, 87, 0.75);
    transition: background-color 0.075s linear;
    cursor: pointer;
    /* Disable selecting text (happens when Shift-Clicking cards) */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

    .ResourceCard.InUse {
        background-color: #c2c2c2;
    }

    .ResourceCard[data-selected] {
        background-color: #aaff9d;
    }

    .ResourceCard::after { /* pseudo-element covering card -- used for hover effects */
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: transparent;
        border-radius: inherit;
        transition: background-color 0.075s linear;
        pointer-events: none;
    }

    .ResourceCard:hover::after {
        background-color: rgba(204, 204, 204, 0.35); /* On hover, apply a semi-transparent overlay */
    }

    .ResourceCard .ResourceCardStatusIcon {
        position: absolute;
        top: 8px;
        left: 8px;
        width: 16px;
        height: auto;
    }

    .ResourceCard .ResourceCardImage {
        max-width: 64px;
        height: 64px; /* keep aspect ratio */
        margin: 0.3rem 0.7rem 0.7rem 0.7rem;
    }

    .ResourceCard .RecourceCardTitle {
        font-weight: bold;
        font-size: 1rem;
        margin-bottom: 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
    }

    .ResourceCard .ResourceCardSubtitle {
        color: #000;
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
    }

        .ResourceCard .ResourceCardSubtitle.Status {
            position: relative;
            padding: 0.25rem 0.5rem; /* padding so SKU color indicator is visible */
            z-index: 1; /* place text above pseudo-element */
            border: 1px solid #777;
            border-radius: 4px;
            color: var(--psColorResourceText, #777); /* fallback to gray if not set/missing */
            background-color: #fff;
        }

        .ResourceCard.InUse .ResourceCardSubtitle.Status {
            background-color: #ddd;
        }

    .ResourceCard:not([data-selected]) .ResourceCardSubtitle.Status {
        color: #000; /* Set status text to black when unselected */
        transition: color 0.075s linear;
    }

    .ResourceCard[data-selected] .ResourceCardSubtitle.Status::before { /* SKU color indicator behind the status text */
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%; /* fill entire width of subtitle */
        height: 100%; /* fill entire height of subtitle */
        z-index: -1; /* move behind text */

        background-color: var(--psColorResource, rgba(255,255,255,0.0)); /* fallback to transparent if not set/missing */
        transition: background-color 0.075s linear;
        border-radius: 4px;
    }
