:root {
    --cell-background-default: #E4DFDA;
    --cell-text-default: #222;
    --cell-background-header: #222;
    --cell-text-header: #FFF;
    --cell-background-confirmed: #70C2BF;
    --cell-background-provisional: #99C1D6;
    --cell-background-occupied: #D08B8F;
    --cell-description-default: #222;
    --tag-background-default: #FFF;
    --project-text-occupied: #333;
    --tag-background-occupied: #E7C5C7;
    --modal-greyout: rgba(0,0,0,0.4);
    --modal-button-background: #70C2BF;
}

body {
    font-family: system-ui, sans-serif;
    line-height: 1.2;
    margin: 0 auto;
    padding: 0;
}

h1 {
    font-size: 1rem;
    margin: 0;
}

#header {
    position: relative;
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    justify-content: space-between;
}

#header button {
    display: flex;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 32px;
    z-index: 10;

    background: var(--modal-button-background);
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: bold;
    height: 32px;
    justify-content: center;
    align-items: center;
}

#enter-id {
    padding: 0 0.5rem
}

/* Modal overlay styles */
#about {
    display: none;

    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;

    align-items: center;
    background: var(--modal-greyout);
    justify-content: center;
    line-height: 1.5;
}

.about-visible #about {
    display: flex;
}

#about > div {
    position: relative;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.2);
    margin: auto;
}

/* Modal close button styles */
.modal-close {
    align-items: baseline;
    display: flex;
    height: 30px;
    justify-content: center;
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;

    border-radius: 50%;
    background: var(--modal-button-background);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 26px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    background: #444;
}

.calendar-container {
    position: relative;
    overflow: auto;
    max-height: calc(100vh - 50px);
    margin: 0;
    padding: 0;
}

#calendar {
    position: relative;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 1px;
}

thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: white;
}

th {
    background: var(--cell-background-header);
    color: var(--cell-text-header);
    padding: 0.5rem;
    font-weight: bold;
    text-align: left;
}

th[scope="col"] {
    min-width: 160px;
}

th[scope="col"].small-slot {
    min-width: 80px;
}

th[scope="row"] {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: var(--cell-background-default);
    color: var(--cell-text-default);
    width: 150px;
}

/* Increase z-index for corner cell to appear above both sticky headers */
thead th[scope="col"]:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--cell-background-header);
    min-width: 100px;
}

td.booking {
    background-color: var(--cell-background-default);
    padding: 0.5rem;
    min-height: 80px;
    vertical-align: top;
}

td.booking.occupied {
    background: var(--cell-background-occupied);
}

td.booking.occupied .tag {
    background: var(--tag-background-occupied);
}

td.booking.visible[data-tags~="confirmed"] {
    background: var(--cell-background-confirmed);
}

td.booking.visible[data-tags~="provisional"] {
    background: var(--cell-background-provisional);
}

.project-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.occupied .project-name {
    color: var(--project-text-occupied);
}

.description {
    font-size: 0.9em;
    color: var(--cell-description-default);
}

.tags {
    margin-top: 0.5rem;
    font-size: 0.8em;
}

.tag {
    display: inline-block;
    background: var(--tag-background-default);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 3px;
    margin-right: 0.25rem;
}

form {
  margin: 2rem 0;
}

label {
  display: block;
  margin-bottom: 0.5rem;
}

input {
  padding: 0.5rem;
  font-size: 1rem;
  margin-right: 0.5rem;
}

button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background: var(--cell-background-default);
  border: none;
  cursor: pointer;
}

button:hover {
  background: #ddd;
}
