@import "light.css";
@import "dark.css";
@import "host-layout.css";
@import "host-dashboard.css";
@import "host-visitors.css";
@import "host-dashboard-charts.css";
@import "host-party.css";
@import "host-access-transaction.css";
@import "responsive-dialogs.css";

:root {
    /* ↓ Scale down font sizes */
    --lumo-font-size-m: 0.85rem; /* default 1rem → smaller */

    /* ↓ Optionally reduce spacing for a tighter layout */
    --lumo-space-m: 0.6rem;

    /* ↓ Compact field heights (buttons, text fields, combo boxes, etc.) */
    --lumo-size-m: 2rem;
}


html {
    --vaadin-app-layout-drawer-width: 19em;
}

/* Make the root view truly fill and allow children to shrink */
:host(.host-dashboard) {
    height: 100%;
    min-height: 0; /* critical for nested flex layouts */
}

/* The charts row must allow its children to shrink instead of overflowing */
:host(.host-dashboard) .charts-row {
    min-height: 0; /* prevents vertical overflow */
    min-width: 0; /* prevents horizontal overflow */
    overflow: hidden; /* avoid accidental scrollbars from borders/padding */
}

/* Card should be a flex column and allow its content to shrink */
:host(.host-dashboard) .chart-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* Any direct child of the card (your chart component) expands but can shrink */
:host(.host-dashboard) .chart-card > * {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden; /* keep charts from adding scrollbars inside */
}

vaadin-app-layout::part(drawer) {
    overflow-y: hidden !important; /* hides vertical scrollbar */
}

.CrudFormMainLayout {
    overflow-y: auto !important;
    height: 100% !important;
    align-content: center;

    .CrudFormMainViewContainer {
        border-top-right-radius: 5px !important;
        border-top-left-radius: 5px !important;
        background: #fafafa !important;
        height: 100% !important;
        overflow-y: auto !important;
        margin-left: auto;
        margin-right: auto;
        padding: 25px 12px;

        .CrudFormTabMenuLayout {
            border-bottom: 1px solid rgba(125, 125, 125, 0.2);;

            .CrudFormTabMenuButton {
                padding-bottom: 25px !important;
                padding-top: 25px !important;
                border-radius: 0px !important;
                background: inherit !important;
                border: none !important;
                border-right: 1px solid rgba(125, 125, 125, 0.2);;
                box-shadow: none !important;
                padding-left: 22px !important;
                padding-right: 22px !important;
            }

            .CrudFormActiveTabButton {
                background: #F2F2F2 !important;
                border-top: 2px solid #BD1918 !important;
            }
        }

        .CrudFormFieldMainContainer {
            padding-bottom: 10px !important;

            .CrudFormFieldContainer {
                padding: 5px 25px !important;

                .v-caption-CrudFormField {
                    .v-captiontext > img {
                        margin-left: 10px !important;
                    }
                }

                .CrudFormField {
                    background: inherit !important;
                }

                .v-label-CrudFormField {
                    white-space: normal !important;
                }
            }
        }

        .CrudFormButtonContainer {
            text-align: center !important;
            padding: 15px 25px !important;

            .CrudFormSaveButton {
                background: #BD1918 !important;
                border: 1px solid #BD1918 !important;
                box-shadow: none !important;
                color: #ffffff !important;
                font-size: 16px !important;
                padding-left: 40px !important;
                padding-right: 40px !important;
                height: 45px !important;
                margin-right: 10px !important;
                font-weight: bold !important;
                margin-top: 18px;
            }

            .CrudFormDeleteButton {
                background: #BD1918 !important;
                border: 1px solid #BD1918 !important;
                box-shadow: none !important;
                color: #ffffff !important;
                font-size: 16px !important;
                padding-left: 40px !important;
                padding-right: 40px !important;
                height: 45px !important;
                margin-right: 10px !important;
                font-weight: bold !important;
                margin-top: 18px;
            }

            .CrudFormCancelButton {
                background: inherit !important;
                border: 1px solid rgba(125, 125, 125, 0.2);
                color: #474747 !important;
                font-size: 16px !important;
                padding-left: 40px !important;
                padding-right: 40px !important;
                height: 45px !important;
                border-radius: 20px !important;
                margin-left: 10px !important;
                font-weight: bold !important;
                margin-top: 18px;
            }

            .CrudFormButton {
                background: rgba(216, 216, 216, 0.49019607843137253) !important;
                border: 1px solid rgba(216, 216, 216, 0.49019607843137253) !important;
                color: #474747 !important;
                font-size: 16px !important;
                padding-left: 40px !important;
                padding-right: 40px !important;
                height: 45px !important;
                margin-left: 10px !important;
                box-shadow: none !important;
                font-weight: bold !important;
                margin-top: 18px;
            }
        }

    }

    .CrudFormMainViewContainer, .first {
        border-top-left-radius: 5px !important;
    }

    .CrudFormMainViewContainer.Registration {
        max-width: 500px !important;
        margin-top: 100px !important;
        border: 1px solid lightgray !important;
        background: #fafafa !important;
        box-shadow: 0 4px 30px -2px rgba(125, 125, 125, 0.2) !important;
        height: auto !important;
    }
}


/*App Layout*/
vaadin-side-nav-item {
    text-transform: capitalize;
}

.view-title {
    text-wrap: nowrap;
}

/*Form Dialog*/
.form-dialog::part(overlay) {
    width: 100%;
    max-width: 100%;
}


vaadin-button {
    cursor: pointer;
}

.custom-label {
    color: var(--vaadin-input-field-label-color);
}

.tc-background-green {
    background-color: green !important;
    color: white !important;
}

.tc-background-yellow {
    background-color: yellow !important;
}

.tc-background-red {
    background-color: red !important;
    color: white !important;
}

.tc-background-orange {
    background-color: darkorange !important;
}

.text-field-tfwb {
    border: none !important;
    background: white; /* Has shading image by default */
    -webkit-border-image: none !important;
    padding: 0 !important;
}

.tc-hiddenfield {
    visibility: hidden;
}

.tc-line-through {
    text-decoration: line-through;
}

.base-dialog::part(footer) {
    padding: 6px 10px;
}


vaadin-context-menu-item:focus {
    outline: none;
    box-shadow: none;
}

/* Hide time part when component has date-only-time-hidden class */
vaadin-date-time-picker.date-only-time-hidden vaadin-time-picker {
    display: none !important;
}

.avatar-border {
    border: 1px solid var(--lumo-contrast-5pct)
}

.avatar-camera-btn {
    position: absolute;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.sectioned-card {
    padding-left: 0;
    padding-right: 0;
    background: none;
}

.sectioned-card::part(header) {
    border-bottom: 2px solid var(--lumo-contrast-20pct);
    padding-bottom: var(--lumo-space-m);
    padding-left: var(--lumo-space-s);
    padding-right: var(--lumo-space-s);
}

.sectioned-card::part(content) {
    padding-left: var(--lumo-space-s);
    padding-right: var(--lumo-space-s);
}

.mobile-uploader {
    vaadin-upload-file-list {
        display: none;
    }
}

/* Width for larger screens */
@media (min-width: 600px) {
    .form-dialog::part(overlay) {
        width: 80%;
        max-width: 80%;
    }
}

/* Width for larger screens */
@media (min-width: 900px) {
    .form-dialog::part(overlay) {
        width: 70%;
        max-width: 70%;
    }
}

/* Width for smaller screens */
@media (min-width: 350px) {
    .medium-dialog::part(overlay) {
        width: 100%;
        max-width: 100%;
    }
    .host-header-site-name {
        align-items: center;
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .cam-btn-desktop {
        display: none;
    }

    .cam-btn-mobile {
        display: inline-flex;
    }

    .host-header-site-name {
        align-items: center;
        font-size: 1rem;
    }
}

/* Width for medium screens */
@media (min-width: 600px) {
    .medium-dialog::part(overlay) {
        width: 70%;
        max-width: 70%;
    }

    .cam-btn-desktop {
        display: inline-flex;
    }

    /* Mobile button: hidden on large screens */
    .cam-btn-mobile {
        display: none;
    }

    .host-header-site-name {
        align-items: center;
        font-size: 1.2rem;
    }

}

/* Width for larger screens */
@media (min-width: 900px) {
    .medium-dialog::part(overlay) {
        width: 60%;
        max-width: 60%;
    }
    .host-header-site-name {
        align-items: center;
        font-size: 1.3rem;
    }
}

@media (min-width: 1100px) {
    .host-header-site-name {
        align-items: center;
        font-size: 1.5rem;
    }
}


.visitor-history-item {
    display: grid;
    grid-template-columns:1fr auto;
    align-items: center;
    gap: var(--lumo-space-m);
    padding: var(--lumo-space-m);
    border-bottom: 1px solid var(--lumo-contrast-10pct);
}

.vh-left {
    min-width: 0;
    white-space: normal;
    word-break: break-word;
    font-weight: 600;
}

.vh-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.vh-date {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
}

.vh-by {
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-secondary-text-color);
}

@media (max-width: 900px) {
    .visitor-history-item {
        grid-template-columns:1fr;
    }

    .vh-right {
        align-items: flex-start;
    }
}