/*!
 * Copyright (C) 2023 StApps
 * This program is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, version 3.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */

$header-height: 50px;
$hours-width: 40px;

.day-labels {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  ion-button {
    width: 100%;
    height: 100%;

    ion-label {
      overflow: visible !important;
    }
  }
}

.header {
  position: relative;
  height: $header-height;
  background-color: var(--ion-color-light);

  .left-button,
  .right-button {
    --padding-start: 0;
    --padding-end: 0;

    position: absolute;
    z-index: 99;

    height: 100%;
    margin: 0;

    color: var(--ion-color-medium-shade);
  }

  .left-button {
    left: 0;
    padding: 0 var(--spacing-sm);
  }

  .right-button {
    right: 0;
    padding: 0 var(--spacing-sm);
  }

  .day-labels {
    ion-button {
      overflow: visible !important;
      width: unset;
      color: var(--ion-color-light-contrast);
    }
  }

  .header-swiper {
    background-color: var(--ion-color-light);
  }
}

.full-height {
  height: 100%;
}

ion-content {
  overflow-y: auto;
}

.schedule-wrapper {
  display: grid;
  grid-template-columns: 40px calc(100% - 40px); // swiper.js can't calculate width when using 1fr instead of 100%
  height: 100%;

  .hours-wrapper {
    z-index: 100;
    background-color: var(--ion-background-color);

    .hour-lines {
      position: absolute;
      top: 0;

      width: 40px;
      height: 70px;

      font-weight: var(--font-weight-bold);
      text-align: center;

      background-color: var(--ion-background-color);
      border-right: 1px solid var(--ion-item-border-color);
    }
  }

  .infinite-swiper-wrapper {
    width: 100%;
  }
}

.date-header {
  height: fit-content;
  padding: var(--spacing-sm) auto;

  font-weight: var(--font-weight-bold);
  text-align: center;
  text-transform: uppercase;

  border-bottom: 1px solid var(--ion-item-border-color);
}

.day-labels > ion-button[disabled] {
  opacity: 1;
}

div {
  height: 100%;
}
