body {
    position: relative;
}

.calendar-container {
    position: relative;
    width: 100%;
}

.row {
    display: flex;
    border-bottom: 1px solid #ccc;
    position: relative;
}

.cell {
    flex: 1;
    text-align: center;
    border-right: 1px solid #ccc;
    position: relative;
}

.time-slot {
    width: 100px;
    background: #f9f9f9;
    font-weight: bold;
}

.hall {
    position: relative; 
    min-height: 60px;
}

.event {
    position: absolute;
    width: 90%;  
    max-width: none; 
    min-width: auto;
    left: 5%;
    background-color: rgba(0, 123, 255, 0.85);
    color: white;
    padding: 2px 5px; 
    border-radius: 5px;
    font-size: 12px;
    text-align: center;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    white-space: normal;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box; 
}
#loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8); 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    visibility: hidden; 
}

.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #ccc;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
#controls {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5em;
    margin-bottom: 20px;
}

#date-controls {
    flex: 0 1 680px;
}
#header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5em;
    flex-wrap: wrap;
    margin-bottom: 1em;
}

#title-block {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    flex: 1 1 40%;
    min-width: 260px;
}

#date-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
}

#date-controls .date-buttons {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

#calendar-float {
    flex: 1 1 50%;
    max-width: 100%;
    box-sizing: border-box;
    background: #f9f9f9;
    border: 1px solid #ccc;
    padding: 1em;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#calendar-checkboxes {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 1em;
}

#calendar-checkboxes label {
    display: inline-block;
    white-space: nowrap;
}

#calendar-checkboxes #limit-warning,
#calendar-checkboxes .info-text {
    flex-basis: 100%;
    margin-top: 0.5em;
    font-style: italic;
}

#calendar-checkboxes #limit-warning {
    color: red;
}

#calendar-checkboxes button {
    margin-top: 0.5em;
    align-self: flex-start;
}
