:root {
  --bg-color: #1ef090;
  --bg-active-color: #18c173;
  --bg-hover-color: #21d983;
  --color: #2b2b2b;
  --border-color: #fff;
  --warning-color: #b02a37;
  --warning-hover-color: #a02632;
  --warning-active-color: #8a212b;
  --warning-bg-color: #f8d7da;
  --warning-border-color: #f1aeb5;
  --wrest-day-color: #f00;
  --bg-days-list: #fff;
  --correct-color: #146c43;
}

.leftPanel {
  display: none !important;
}

.centralpanel {
  width: 85% !important;
}

.main-plan-container {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  width: 100%;
  column-gap: 1rem;
}

.school-year-settings ::selection {
  background-color: var(--color);
  color: var(--bg-color);
}

.school-year-settings * {
  color: var(--color);
  font-weight: bold;
}

.school-year-settings * {
  font-size: 1rem;
}

.school-year-settings {
  position: relative;
  display: inline-block;
  padding: 1rem;
  box-sizing: border-box;
  background-color: var(--bg-color);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  border-radius: .3rem;
  width: 20rem;
}

.plan-panel {
  position: relative;
  display: inline-block;
}

.school-year-settings details {
  margin-bottom: 1rem;
}

summary,
.button-add {
  cursor: pointer;
  margin-bottom: 0.5rem;
  border: 1px var(--border-color) solid;
  border-radius: .3rem;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25);
  list-style: none;
  padding: .5rem;
  white-space: nowrap;
  text-align: center;
  width: 100%;
  font-size: revert !important;
  box-sizing: border-box;
}

.button-add {
  background-color: var(--bg-color);
}

.school-year-settings summary:hover,
.button-add:hover {
  background-color: var(--bg-hover-color);
}

.structure {
  display: grid;
  grid-template-columns: auto auto;
  row-gap: .3rem;
  column-gap: 1rem;
  text-align: center;
  margin-bottom: 1rem;
  justify-items: center;
}

.structure>* {
  font-size: 1.1rem;
}

.structure h2 {
  grid-column: 1/3;
  text-align: center;
  margin: 1rem 0 0 0;
}

.structure .buttons-menu {
  position: relative;
  display: flex;
  justify-content: center;
  grid-column: 1/3;
  gap: 1rem;
  margin: 1rem 0;
}

.structure input[type="date"] {
  padding: .2rem;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25);
  width: fit-content;
  box-sizing: border-box;
}

.school-year-settings details ul {
  text-align: left;
  padding: 0;
  list-style: none;
  margin: 0;
}

.holidays-list li {
  display: grid;
  grid-template-columns: auto auto 1fr;
}

.school-holidays .button {
  cursor: pointer;
  border: none;
  border-radius: .3rem;
  background-color: var(--bg-color);
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25);
  list-style: none;
  padding: .5rem;
  text-align: center;
}

.school-holidays .button:hover {
  background-color: var(--bg-hover-color);
}

.school-holidays .button>svg {
  position: relative;
  display: block;
}

.school-holidays li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .5rem;
  margin: .5rem 0;
}

.warning {
  position: relative;
  padding: 1rem;
  color: var(--warning-color);
  background-color: var(--warning-bg-color);
  border: 1px var(--warning-border-color) solid;
  border-radius: .3rem;
  text-align: left;
  margin-top: .5rem;
}

.warning::selection {
  background-color: var(--warning-color);
  color: var(--warning-bg-color);
}

.school-year-settings summary:active,
.button-add:active,
.school-holidays .button:active {
  background-color: var(--bg-active-color);
}

.checkbox-item {
  text-align: left;
}

/* .wrest-days {
  background-color: var(--bg-days-list);
  padding: 1rem !important;
  border-radius: .3rem;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25);
}

.wrest-days input[type="checkbox"]:checked+label::before {
  background-color: var(--wrest-day-color);
  border-color: var(--wrest-day-color);
}

.wrest-days input[type="checkbox"]:checked+label {
  color: var(--wrest-day-color);
}

.wrest-days input[type="checkbox"]:checked+label::selection {
  color: var(--bg-days-list);
  background-color: var(--wrest-day-color);
} 

.school-year-settings input[type="color"] {
  display: none;
}

.school-year-settings input[type="color"]+label {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
}

.school-year-settings input[type="color"]+label::before {
  content: '';
  position: relative;
  width: 1.2rem;
  height: .8rem;
  border: 1px #000 solid;
  border-radius: 2px;
  margin-right: .5rem;
  cursor: pointer;
  box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.25);
  background-color: var(--_pickedColor, #fff);
}*/

.input-dates-dialog::backdrop,
.remove-dates-dialog::backdrop,
.number-lessons-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.32);
}

.input-dates-dialog,
.remove-dates-dialog,
.number-lessons-dialog {
  border: none;
  border-radius: .5rem;
  box-shadow: none;
  width: 30%;
  padding: 0;
  overflow: hidden;
}

.dialog-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  color: var(--color);
  border-bottom: 1px #808080 solid;
  padding: 1rem;
  box-sizing: border-box;
}

.dialog-header>.close-dialog.x {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  box-sizing: border-box;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: .2rem;
}

.dialog-header>.close-dialog.x:hover {
  color: #7f2b2b;
}

.dialog-header>.close-dialog.x:active,
.dialog-header>.close-dialog.x:focus-visible {
  outline: 4px #c2fedb solid;
}

.dialog-header>.close-dialog.x>svg {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

.dialog-header>h2 {
  margin: 0;
}

.dialog-body {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  padding: 1rem;
  font-size: 110%;
  color: var(--color);
}

.dialog-body input[type="date"],
.dialog-body input[type="number"],
#initial-lesson-number {
  padding: .2rem;
  font-size: 110%;
  color: var(--color);
}

.dialog-body p.alert {
  display: none;
  grid-column: 1/3;
  text-align: center;
}


.dialog-body.error p.alert {
  display: block;
  color: var(--warning-color);
}

.dialog-body.correct input[type="date"] {
  border: 2px var(--bg-color) solid;
}

.dialog-body.error input[type="date"] {
  border: 2px var(--warning-color) solid;
}

.dialog-body.error input[type="date"]:focus-visible {
  border: 2px var(--warning-color) solid;
  outline: 1px var(--warning-bg-color) solid;
}

.dialog-footer {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-items: right;
  border-top: 1px #808080 solid;
  padding: 1rem;
  box-sizing: border-box;
  column-gap: 1rem;
}

.dialog-footer button,
.generate-button,
.save-plan-button,
.button {
  position: relative;
  width: fit-content;
  padding: .5rem 1rem;
  box-sizing: border-box;
  cursor: pointer;
  border: none;
  border-radius: .4rem;
  font-weight: bold;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25);
}

.dialog-close-button,
.reset-button {
  color: var(--border-color) !important;
  background-color: var(--color) !important;
  opacity: .6;
}

.dialog-close-button:hover,
.reset-button:hover {
  opacity: .8;
}

.dialog-close-button:active,
.reset-button:active {
  opacity: 1;
}

.dialog-save-button,
.generate-button,
.save-plan-button,
.button {
  color: var(--color);
  background-color: var(--bg-color);
}

.dialog-save-button:hover,
.generate-button:hover,
.save-plan-button:hover,
.download-button:hover {
  background-color: var(--bg-hover-color);
}

.dialog-save-button:active,
.generate-button:active,
.save-plan-button:active,
.download-button:active {
  background-color: var(--bg-active-color);
}

.generate-button,
.save-plan-button,
.download-button {
  display: block;
  /* margin: auto; */
}

.plan-container>div:has(.save-plan-button) {
  margin-top: 1rem;
}

.remove-dates-dialog .dialog-body>p {
  grid-column: 1/3;
}

.dialog-remove-button {
  color: var(--border-color);
  background-color: var(--warning-color);
}

.dialog-remove-button:hover {
  background-color: var(--warning-hover-color);
}

.dialog-remove-button:active {
  background-color: var(--warning-active-color);
}

.plan-panel {
  margin-top: .5rem;
  background-color: #fffc;
  padding-bottom: 1rem;
  box-sizing: border-box;
  /* border-bottom-left-radius: .3rem; */
  /* border-bottom-right-radius: .3rem; */
  border-radius: .3rem;
}

.checkbox-menu {
  grid-column: 1/3;
  position: relative;
  display: flex;
  justify-content: center;
}

.checkbox-menu label {
  padding: .5rem 2rem !important;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: capitalize;
  color: var(--bg-color);
  background-color: var(--border-color);
  border: 1px var(--bg-color) solid;
}

.checkbox-menu label:first-of-type {
  border-top-left-radius: 1rem;
  border-bottom-left-radius: 1rem;
}

.checkbox-menu label:last-of-type {
  border-top-right-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

.checkbox-menu label::before {
  content: '' !important;
  display: none !important;
}

.checkbox-menu input[type="checkbox"]:checked+label {
  color: var(--border-color);
  background-color: var(--bg-color);
  /* border-color: var(--border-color); */
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25);
}

.select-menu {
  grid-column: 1/3;
  display: grid;
  margin-top: 1rem;
}

.select-menu>div {
  position: relative;
  display: flex;
  justify-content: center;
}

.select-menu>summary {
  justify-self: center;
  order: 2;
}

.select-menu[open]>summary {
  margin-top: 1rem;
}

.select-menu select {
  width: 5.5rem;
  padding: .5rem 0;
  font-size: 1rem;
  background-color: #fff;
  border: 1px #dee2e6 solid;
  border-radius: .3rem;
  color: #4b4e52;
  cursor: pointer;
  text-align: center;
}

.select-menu select:disabled {
  background-color: #dee2e6;
  cursor: default;
}

.number-lessons-dialog .dialog-body {
  grid-template-columns: auto 1fr;
  grid-template-rows: repeat(4, auto);
  gap: 1rem;
}

.number-lessons-dialog .dialog-body .row-el {
  grid-column: 1/3;
}

.dialog-body input[type="number"]::selection {
  background-color: #00D778;
  color: white;
}

.dialog-body input[type="number"],
#initial-lesson-number {
  border: 2px #ccc solid;
  border-radius: 0.2em;
}

.dialog-body input[type="number"]:focus-visible,
#initial-lesson-number:focus-visible {
  border: 2px #0c6 solid;
  outline: 1px #a6e2c5 solid;
  outline-offset: 2px;
  border-radius: 0.2em;
}

.dialog-body #every-week:not(:checked)+label+input.row-el,
.dialog-body #every-other-week:not(:checked)+label+div.row-el>input {
  pointer-events: none;
  background-color: #e9efec;
}

div.row-el {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* grid-template-rows: auto auto; */
  column-gap: 1rem;
}

.number-lessons-dialog .dialog-body.error input[type="radio"]+label {
  color: var(--warning-color);
}

.number-lessons-dialog .dialog-body.correct input[type="radio"] {
  accent-color: var(--correct-color);
}

.number-lessons-dialog .dialog-body.correct input[type="radio"]+label {
  color: var(--correct-color);
}

.number-lessons-dialog .dialog-body.error1 #every-week:checked~#custom-lessons-number,
.number-lessons-dialog .dialog-body.error3 #every-other-week:checked~.row-el>#odd-weeks-lessons-number,
.number-lessons-dialog .dialog-body.error4 #every-other-week:checked~.row-el>#even-weeks-lessons-number {
  border: 2px var(--warning-color) solid;
  margin-bottom: 1rem;
}

.number-lessons-dialog .dialog-body.error1 #every-week:checked~#custom-lessons-number+input+label::before,
.number-lessons-dialog .dialog-body.error3 #every-other-week:checked~.row-el>span:first-of-type::after,
.number-lessons-dialog .dialog-body.error4 #every-other-week:checked~.row-el>span:last-of-type::after {
  content: 'введіть кількість уроків';
  color: var(--warning-color);
  position: absolute;
  margin-top: calc(-1rem - 1em);
  font-size: 90%;
  left: 1rem;
}

.number-lessons-dialog .dialog-body.error3 #every-other-week:checked~.row-el>span:first-of-type::after,
.number-lessons-dialog .dialog-body.error4 #every-other-week:checked~.row-el>span:last-of-type::after {
  margin-top: calc(3rem + .3em);
}

.number-lessons-dialog .dialog-body.error4 #every-other-week:checked~.row-el>span:last-of-type::after {
  margin-top: calc(3rem + .3em);
  left: calc(50% + .5rem) !important;
}

.row-el>input {
  height: fit-content;
}

.select-menu p {
  text-align: left;
  width: clamp(20%, 65%, 100%);
  display: flex;
  column-gap: 1rem;
}

.structure label[for="start-date"].error::after,
.structure label[for="end-date"].error::after {
  content: 'введіть початкову дату';
  color: var(--warning-color);
  position: absolute;
  margin-top: calc(3rem + .3em);
  font-size: 90%;
  left: 0;
  white-space: nowrap;
  text-align: center;
  width: 100%;
}

.structure label[for="end-date"].error::after {
  content: 'введіть кінцеву дату';
  left: auto;
  right: 0;
}

.structure label.error {
  position: relative;
  width: 100%;
}

.structure label[for="start-date"].error~#start-date,
.structure label[for="end-date"].error~#end-date,
#initial-lesson-number.error,
#start-date.error,
#end-date.error {
  border: 2px var(--warning-color) solid;
}

.structure h2.error {
  position: relative;
  margin-bottom: 1.2rem;
}

.structure h2.error::after {
  content: 'виберіть день тижня ';
  color: var(--warning-color);
  position: absolute;
  margin-top: calc(1rem + .3em);
  font-size: 90%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.structure h2.error1 {
  position: relative;
  margin-top: 1.2rem;
}

.structure h2.error1::before {
  content: 'введіть правильний діапазон дат';
  color: var(--warning-color);
  position: absolute;
  margin-top: calc(-1rem - .1em);
  font-size: 90%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.plan-container {
  display: grid;
  grid-template-columns: 4rem 50% 4rem;
  margin-top: 1rem;
}

.plan-container>table {
  border-collapse: collapse;
  text-align: center;
}

.plan-container>table th,
.plan-container>table td {
  border: 1px #dee6e2 solid;
  padding: .5rem;
}

.plan-container>table tr:nth-of-type(odd) {
  background-color: #f8f9f7;
}

.plan-container>table tr:nth-of-type(even) {
  background-color: #fff;
}

.structure+div,
.plan-container>div {
  position: relative;
  display: flex;
  justify-content: center;
  column-gap: 2rem;
}

.plan-container>div {
  grid-column: 1/4;
  margin-top: 1rem;
}

.download-button {
  white-space: nowrap;
}

@media screen and (max-width: 768px) {
  .centerPanel {
    width: 100vw !important;
    padding: 0;
  }

  .school-year-settings {
    min-height: calc(100vh - 32px - 12rem);
  }

  .school-year-settings * {
    font-size: .8rem;
  }

  .school-year-settings:not(.show) {
    width: 2rem;
    padding: 2px;
    overflow: hidden;
    cursor: pointer;
  }

  .school-year-settings:not(.show) * {
    display: none;
  }

  .right-block {
    position: absolute;
    display: block !important;
    right: 0;
    top: 0;
    width: 2rem;
    height: 100%;
    border-radius: .3rem;
    box-sizing: border-box;
    cursor: pointer;
  }

  .school-year-settings.show .right-block {
    right: 1rem;
    top: 1rem;
    height: calc(100% - 2rem);
    border: 1px var(--border-color) solid;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.25);
  }

  .school-year-settings.show {
    padding-right: 4rem;
  }

  .school-year-settings .right-block::before {
    content: '';
    position: relative;
    transform: rotate(-90deg) translateX(-50%);
    white-space: nowrap;
    display: block;
    top: 50%;
    color: var(--color);
    font-weight: bold;
    letter-spacing: .5rem;
  }

  .school-year-settings:not(.show) .right-block::before {
    content: 'Параметри';
  }

  .school-year-settings.show .right-block::before {
    content: 'Згорнути';
  }

  /* .main-plan-container {
    width: 98vw;
  } */

  .main-plan-container:has(.show) {
    grid-template-columns: 1fr;
  }

  .input-dates-dialog,
  .remove-dates-dialog,
  .number-lessons-dialog {
    width: 98%;
  }

  input[type="checkbox"]+label::before {
    width: 30px;
    height: 30px;
    font-size: 28px !important;
    line-height: 26px !important;
  }

  input[type="checkbox"]+label {
    line-height: 2rem;
    vertical-align: middle;
    display: inline-block;
    padding-left: 40px;
  }
}