@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700&display=swap");

:root {
  --blue: #26293a;
  --light-blue: #2f3349;
  --black: #242424;
  --white: #bbbdcc;
  --whitest: #ffffff;
  --gray: #bbbbbb;
  --grayer: #bbbbbbaa;
  --highlight: #ffb548;
  --light-highlight: #ffcc7f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /*disable user selection*/
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

body {
  background-color: var(--light-blue);
  color: var(--white);
  font-family: "Poppins", serif;
  overflow: hidden;
}

.container {
  max-width: 800px;
  margin: auto;
  margin-top: 20px;
  background: var(--blue);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  transform-origin: top;
}

#activitiesList {
  overflow-y: auto;
  overflow-x: hidden;
}

#activitiesList .grid {
  width: 96%;
}

.titleContainer {
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
}

.mainDescription {
  font-size: 14px;
  text-align: justify;
}

.brandPolicy {
  margin-bottom: 10px;
  font-size: 10px;
  text-align: right;
}

h1 {
  color: white;
  display: inline-block;
}

#logo,
#logo_print {
  width: 160px;
  margin: 0 auto;
  display: inline-block;
  vertical-align: sub;
}

#logo_print {
  display: none;
}

.item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-top: 1px solid #dddddd11;
}

.item div.image {
  display: flex;
  align-items: center;
  /*show item at the top*/
  align-self: flex-start;
}

.item img {
  width: 115px;
  height: 115px;
  margin-right: 15px;
}

.item .info {
  flex: 1;
  align-self: self-start;
  padding-top: 5px;
}

.item h3 {
  margin: 0;
  font-size: 18px;
  color: var(--light-highlight);
  /*height: 20px;*/
  padding-bottom: 0px;
}

.item span {
  margin: 0px;
  color: var(--grayer);
  font-size: 12px;
  font-style: italic;
  /*capitalize first letter*/
  text-transform: capitalize;
}

.item p {
  margin: 5px 0;
  color: var(--gray);
  font-size: 15px;
}

summary {
  cursor: pointer;
  color: var(--grayer);
  font-size: 14px;
  font-style: italic;
}

details li {
  margin-top: 7px;
  margin-left: 13px;
  font-size: 14px;
  color: var(--grayer);
}

details ul {
  margin-left: 7px;
}

details ul li ul li {
  margin-top: 3px;
}

b {
  color: var(--gray);
  font-weight: 500;
}

.palette {
  display: inline-block;
}

.color {
  width: 20px;
  height: 20px;
  display: inline-block;
  margin: 2px;
  border-radius: 100%;
  vertical-align: text-bottom;
}

.color.selected {
  border: 2px solid var(--white);
}

.button {
  display: inline-block;
  padding: 3px 5px;
  background: var(--light-blue);
  color: var(--white);
  border: none;
  border-radius: 5px;
}

.emptyMessage {
  text-align: center;
  font-size: 16px;
  color: var(--light-highlight);
  margin-top: 50px;
}

.print,
.printParams {
  position: absolute;
  top: 10px;
  right: 60px;
  width: 40px;
  height: 40px;
  background: var(--blue);
  cursor: pointer;
  font-size: 30px;
  text-align: center;
  border-radius: 3px;
  opacity: 0.6;
  z-index: 9999;
}

.printParams {
  right: 10px;
}

.print:hover,
.printParams:hover {
  opacity: 1;
}

::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  background-color: var(--light-blue);
}

::-webkit-scrollbar {
  width: 12px;
  background-color: var(--light-blue);
}

::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  background-color: var(--light-highlight);
}

#backButton {
  cursor: pointer;
  display: none;
}

.selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--blue);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  justify-content: center;
  align-items: flex-end;
}

.selectors select {
  font-family: "Poppins", serif;
  font-size: 15px;
  font-weight: 300;
  appearance: none;
  background-color: var(--light-blue);
  color: var(--white);
  border: 1px solid var(--gray);
  border-radius: 6px;
  padding: 8px 12px;
  width: 180px;
  height: 42px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 🔸 Quando qualcosa è selezionato e non è l'opzione vuota iniziale */
.selectors select:valid {
  color: var(--highlight);
  font-weight: 500;
}

.selectors select#schoolSelect {
  width: 210px; /* 🔒 Fissa larghezza */
}

.selectors select#classSelect {
  width: 150px; /* 🔒 Fissa larghezza */
}

.selectors select#subjectSelect {
  width: 250px; /* 🔒 Fissa larghezza */
}

.selectors select:focus {
  outline: none;
  border-color: var(--whitest);
  background-color: var(--blue);
}

.selectors select:focus {
  background-color: var(--blue);
  border-color: var(--highlight);
  color: var(--highlight);
  outline: none;
}

.subject-card {
  text-align: center;
  cursor: pointer;
}

.subject-card .image-wrapper {
  position: relative;
  display: inline-block;
}

.subject-card img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  margin-bottom: 8px;
}

.subject-card .badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background-color: #ffb548bb;
  color: var(--blue);
  font-size: 11px;
  font-weight: bold;
  padding: 3px;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  width: 22px;
  height: 22px;
}

.subject-card .label {
  font-size: 14px;
  color: var(--gray);
}

h {
  color: var(--light-highlight) !important;
}

a {
  color: var(--light-highlight);
}

@page {
  size: auto; /* auto is the initial value */
  margin: 10mm 10mm 10mm 10mm; /* this affects the margin in the printer settings */
}

/* media query for smartphones */
@media (max-width: 600px) {
  #logo {
    width: 80%;
  }
  h1#activitiesTitle {
    font-size: 1.5em !important;
    margin-bottom: 5px;
  }
  .container {
    width: 100%;
    margin-top: 0px;
    padding: 10px;
  }
  .item {
    padding-left: 5px;
    padding-right: 5px;
  }
  .image img {
    width: 80px;
    height: 80px;
  }
  .print,
  .printParams {
    display: none;
  }

  #activitiesDescription {
    margin-bottom: 5px;
  }

  .selectors {
    padding: 3px;
  }

  .selectors select {
    font-size: 12px;
    height: 35px;
  }

  .selectors select#schoolSelect {
    width: 33% !important; /* 🔒 Fissa larghezza */
  }

  .selectors select#classSelect {
    width: 20% !important; /* 🔒 Fissa larghezza */
  }

  .selectors select#subjectSelect {
    width: 39% !important; /* 🔒 Fissa larghezza */
  }
}

@media print {
  * {
    color: black !important;
  }

  body {
    background: white;
    color: black !important;
    font-family: "Poppins", serif;
  }

  .print {
    display: none;
  }

  .printParams {
    display: none;
  }

  .mainDescription {
    text-align: justify;
    font-size: 16px;
  }

  .button {
    background-color: rgb(221, 221, 221);
  }

  .container {
    page-break-before: always;
    background: white;
    color: black !important;
    transform: scale(1) !important;
    box-shadow: none !important;
    height: auto !important;
  }

  .selectors {
    background-color: white;
  }

  .selectors select {
    background-color: white;
    color: black !important;
    border: 1px solid var(--gray);
  }

  #logo {
    display: none;
  }

  #logo_print {
    display: inline-block;
  }

  .image img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
  }

  .item {
    border-top: 1px solid gray;
    /*don't break when printing*/
    page-break-inside: avoid;
  }

  .item h3 {
    margin-top: -8px;
  }

  summary {
    display: none;
  }

  body.printWithParameters details {
    display: block;
  }

  body.printWithParameters .item {
    page-break-inside: auto;
  }

  h {
    color: black !important;
    font-weight: bold;
  }

  #activitiesList{
    height: auto !important;
  }
}
