:root {
    color-scheme: light dark;
}

.bg-header {
    background-color: var(--background-color) !important;
}
.navbar-light .navbar-nav .nav-link {
    color: var(--detail-text-color) !important
}
.navbar-brand {
    color: var(--detail-text-color) !important
}
.navbar-toggler-icon {
    background-color: var(--detail-text-color) !important
}
.navbar-brand-image {
    height: 60px
}
.img-thumbnail {
    background-color: unset;
    border: unset;
}

body {
    padding-bottom: 60px;
}

.vaadin-content-wrapper {
    padding-bottom: 40px;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 60px;
    }
    .vaadin-content-wrapper {
        padding-bottom: 40px;
    }
}

.footer-link {
    color: var(--detail-text-color) !important
}

.footer-clock {
    white-space: nowrap;
}

.footer {
    color: var(--detail-text-color) !important;
    background-color: var(--background-color) !important;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;

    /* Optional: Add a shadow so it separates from the content visually */
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}
.tech {
    font-size: 60% !important;
    font-weight: 100 !important;
}

.datepicker td, .datepicker th {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.85rem;
}

.datepicker-date {
    font-size: large;
}

.occupation {
    border: 1px solid black;
}

.occupationhour {
    width: 10px;
    height: 27px;
}

.reservation {
    background-color: #357043 !important;
}

.room {
    border: 1px black;
    border-style: groove;
    border-radius: 16px;
}

/* 1. Map your variables to Vaadin's internal variables inside the header */
.bg-header {
    /* Overrides the default Blue color for Vaadin components */
    --lumo-primary-text-color: var(--detail-text-color);

    /* Overrides the default Dark Grey color for text/icons */
    --lumo-body-text-color: var(--detail-text-color);

    /* Overrides the Hamburger Menu (DrawerToggle) color */
    --lumo-contrast-80pct: var(--detail-text-color);
}

/* 2. SPECIFIC FIX: Force the "Administratie" (MenuBar) buttons to be white */
/* The !important is needed to override the default "Tertiary Blue" style */
.bg-header vaadin-menu-bar vaadin-menu-bar-button {
    color: var(--detail-text-color) !important;
}

/* 3. Ensure the overflow button (the '...' on mobile) is also white */
.bg-header vaadin-menu-bar::part(overflow-button) {
    color: var(--detail-text-color) !important;
}


/* Timeline view */
.schedule-grid {
    display: grid;
    grid-template-columns: 150px 1fr; /* Name column | Timeline */
    gap: 1px;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    overflow-x: auto;
}

/* Header */
/* Container */
.schedule-grid {
    display: grid;
    grid-template-columns: 140px 1fr; /* Name | Timeline */
    gap: 1px;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    position: relative;
    overflow-y: hidden;
    min-width: 600px; /* Ensure timeline doesn't get squished */
    /* Remove fixed height so it fits inside the Tab content */
}

@media (max-width: 768px) {
    .schedule-grid {
        grid-template-columns: 110px 1fr; /* Smaller name column on mobile */
        min-width: 700px; /* Allow enough space for all hours so horizontal scroll activates */
    }
}

/* Header - COMPACT */
.time-header-row {
    grid-column: 2;
    display: flex;
    background: white;
    border-bottom: 2px solid #ccc;
    position: sticky;
    top: 0;
    z-index: 30;
    height: 25px; /* Compact header */
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Rows - COMPACT SIZE */
.table-name-cell {
    position: sticky;
    left:0;
    z-index: 25;
    background: white;
    border-right: 1px solid #ccc;

    padding: 0 8px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    height: 35px; /* Smaller height (was 50px) */
    font-size: 0.85rem; /* Smaller font */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-lane {
    background: white;
    position: relative;
    height: 35px; /* Match name cell height */
    border-bottom: 1px solid #eee;
}

/* Reservation Block */
.reservation-block {
    position: absolute;
    top: 4px;    /* Tighter spacing */
    bottom: 4px;
    background-color: var(--lumo-error-color);
    color: white;
    border: 2px solid white;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 0.75rem; /* Smaller font */
    line-height: 27px; /* Vertically center text */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.15);
    z-index: 1;
}
.reservation-block:hover {
    z-index: 5;
    filter: brightness(1.1);
}

.closure-block,
.closure-legend {
    background: repeating-linear-gradient(45deg, #ddd, #ddd 6px, #bbb 6px, #bbb 12px);
    color: #333;
}
.closure-block {
    cursor: default;
    z-index: 0;
}

/* ... existing styles ... */

.current-time-line {
    grid-column: 2;        /* Restrict to the timeline column */
    grid-row: 1 / span 1000;      /* Span from the very top header to the very bottom */
    position: absolute;    /* Float over the content */
    top: 0;
    bottom: 0;
    width: 2px;            /* Thickness of the line */
    background-color: red;
    z-index: 20;           /* On top of everything */
    pointer-events: none;  /* Allow clicking through to reservations behind it */
    opacity: 0.6;
}

/* Optional: Add a small circle at the top */
.current-time-line::after {
    content: '';
    position: absolute;
    top: 25px; /* Adjust based on your header height to sit just below it */
    left: -4px; /* Center on the 2px line */
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
}

/* Desktop vs Mobile Navigation */
.mobile-toggle {
    display: none !important;
}
@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }
    .mobile-toggle {
        display: flex !important;
    }
    .hide-on-mobile {
        display: none !important;
    }
}
@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
}

/* The Vaadin AppLayout navbar is position: fixed with no height limit of its own,
   so an expanded mobile menu taller than the viewport gets clipped with no way to
   scroll to the rest. Bound the mobile nav's own height and let it scroll instead. */
@media (max-width: 768px) {
    .mobile-nav {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
}

/* Mobile sub-menu styling */
.mobile-submenu-links {
    background-color: white;
    border-radius: 4px;
}
.mobile-submenu-links a {
    color: black !important;
    text-decoration: none;
}
.mobile-details {
    color: var(--detail-text-color) !important;
    --lumo-contrast: var(--detail-text-color);
    --lumo-contrast-60pct: var(--detail-text-color);
    --lumo-contrast-80pct: var(--detail-text-color);
    width: 100%;
}
.mobile-details::part(summary) {
    color: var(--detail-text-color) !important;
}

/* Mobile Vertical Timeline */
.mobile-schedule-grid {
    display: flex;
    flex-direction: row;
    position: relative;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    min-width: 100%;
    width: max-content;

    /* overflow-x: auto removed so contentContainer handles all scrolling, fixing sticky headers */
}

.mobile-time-axis {
    width: 60px;
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    z-index: 30;
    background: white;
    border-right: 2px solid #ccc;
    flex-shrink: 0;
}

.mobile-time-label {
    position: absolute;
    width: 100%;
    text-align: right;
    padding-right: 5px;
    font-size: 0.7rem;
    color: #666;
    border-top: 1px solid #999;
}

.mobile-table-column {
    flex: 1;
    min-width: 120px;
    border-right: 1px solid #ccc;
    position: relative;
    background: white;
}

.mobile-table-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 35;
    background: white;
    border-bottom: 2px solid #ccc;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-reservation-block {
    position: absolute;
    left: 4px;
    right: 4px;
    background-color: var(--lumo-error-color);
    color: white;
    border: 2px solid white;
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 0.75rem;
    line-height: 1.2;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.15);
    z-index: 10;
}

.mobile-reservation-block:hover {
    z-index: 15;
    filter: brightness(1.1);
}

.mobile-current-time-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: red;
    z-index: 20;
    pointer-events: none;
    opacity: 0.6;
}
.mobile-current-time-line::after {
    content: '';
    position: absolute;
    left: -4px;
    top: -4px;
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
}

/* Off-Screen Indicators */
.offscreen-indicator {
    position: fixed;
    background: var(--lumo-primary-color);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    opacity: 0.8;
}

#indicator-top { top: 70px; left: 50%; transform: translateX(-50%); }
#indicator-bottom { bottom: 80px; left: 50%; transform: translateX(-50%); }
#indicator-left { left: 10px; top: 50%; transform: translateY(-50%); }
#indicator-right { right: 10px; top: 50%; transform: translateY(-50%); }


/* For longer loads, display a spinner in the center of the screen */
.v-loading-indicator.second::after,
.v-loading-indicator.third::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
    border: 6px solid rgba(0,0,0,0.1);
    border-top: 6px solid var(--lumo-primary-color);
    border-radius: 50%;
    animation: v-spinner-spin 1s linear infinite;
    z-index: 99999;
}

@keyframes v-spinner-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
