:root {
  --user-color-1: #ff7070;
  --user-color-2: #b1ffb1;
  --user-color-3: #b6d9ff;
  --user-color-4: #dcb2ff;
  --user-color-5: #fff7b8;
}

body {
  display: flex;
  flex-direction: column;
  background: url("../img/nsp_background.svg");
  background-size: cover;
  background-attachment: fixed;
  color: white;
  min-height: 100vh;

  font-family: 'Google Sans', sans-serif;
}

body:has(.modal-overlay.show) {
  overflow: hidden;
}

header {

  position: sticky;
  top: 0;
  z-index: 999;

  padding: 0 60px;
  margin: 0;
  margin-bottom: 10px;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;

  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border-bottom: white 2px solid;
  color: black;

  display: flex;
  justify-content: space-between;

  .logosection {
    display: flex;
    margin: 10px 0;

    background-color: black;

    user-select: none;

    text-decoration: none;

    svg {
      background-color: #000000;
      width: 58px;
      height: 58px;
      margin-right: 10px;
      color: #ffffff;
    }

  }

  h1 {
    background-color: #000000;
    color: white;
    padding: 5px 10px 5px 0;
    font-weight: bolder;
    margin: 0;
  }

  @media (hover: hover) {
    .logosection:hover {
      cursor: pointer;
    }
  }
  .logosection:active {
    cursor: pointer;
  }

  span.header_actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  a.button, button {
    display: flex;
    flex-direction: row;
    align-self: center;
    align-items: center;
    justify-content: center;

    p {
      padding: 0;
      margin: 0;
    }

    img {
      width: 16px;
      height: auto;
      margin-right: 5px;
    }
  }

  .share_button {
    display: none;
  }

  .active-admin-btn {
    background-color: white !important;
    color: black !important;
    img {
      filter: invert(1);
    }
  }
}

header.header_style_1 {
  h1 {
    color: var(--user-color-1);
  }

  .logosection svg {
    color: var(--user-color-1);
  }
}

header.header_style_2 {
  h1 {
    color: var(--user-color-2);
  }

  .logosection svg {
    color: var(--user-color-2);
  }
}

header.header_style_3 {
  h1 {
    color: var(--user-color-3);
  }

  .logosection svg {
    color: var(--user-color-3);
  }
}

header.header_style_4 {
  h1 {
    color: var(--user-color-4);
  }

  .logosection svg {
    color: var(--user-color-4);
  }
}

header.header_style_5 {
  h1 {
    color: var(--user-color-5);
  }

  .logosection svg {
    color: var(--user-color-5);
  }
}

div.apk_header {
  display: none !important;
}

.download_button {
  display: none !important;
}

.back_to_family_selection {
  margin-top: 20px;
}

main {
  padding: 20px 60px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;

  .card_container {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    min-height: 100%;

    .family_card_container {
      display: flex;
      flex-direction: column;
      border: solid 2px #3f3f3f;
      border-radius: 1rem;
      padding: 10px;
      background-color: #111111;

      .family_actions {
        margin-top: 10px;
        margin-left: 10px;
        margin-right: 10px;
        display: flex;

        gap: 20px;

        button {
          flex-grow: 1;
        }
      }
    }

    .category_card {
      border: solid 2px white;
      border-radius: 2rem;
      text-decoration: none;
      flex-grow: 1;
      display: flex;
      align-items: end;
      justify-content: center;

      container-type: inline-size;
      h1 {
        color: white;
        font-size: 15cqw;
        font-weight: bolder;
        text-align: center;
      }
      transition: transform 0.3s ease;

      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
    }

    @media (hover: hover) {
      .category_card:hover {
        cursor: pointer;
        transform: translateY(-10px);
      }
    }
    .category_card:active {
      cursor: pointer;
      transform: translateY(-10px);
      min-height: 11vh;
    }

    #cat_card_1 {
      background-image: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.8) 100%), url("../img/stepan.jpg");
    }
    #cat_card_2 {
      background-image: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.8) 100%), url("../img/andy.jpg");
    }
    #cat_card_3 {
      background-image: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.8) 100%), url("../img/maminka.jpg");
    }
    #cat_card_4 {
      background-image: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.8) 100%), url("../img/anezka.jpg");
    }
    #cat_card_5 {
      background-image: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.8) 100%), url("../img/babicka.jpg");
    }
  }
}

p.error, span.error {
  color: #ff5555;
  font-weight: bold;
  text-align: left;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Slightly lighter so blur is visible */
  backdrop-filter: blur(30px);
  z-index: 1000;
  display: flex; /* Always flex now */
  align-items: center;
  justify-content: center;

  /* Hide it using opacity and visibility instead of display */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* We will add this class via JavaScript to trigger the animation */
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  padding: 30px;
  border-radius: 1rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);

  border: solid 1px #616161;
  background-color: rgb(255 255 255 / 0.1);

  /* Start the card slightly smaller and lower */
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s;

  h2 {
    color: black;
    background-color: white;
    font-weight: bolder;
  }

  p.error {
    margin: 0;
  }

  a.button {
    margin-bottom: 20px;
  }

}

/* When the overlay has the 'show' class, move the card to its final position */
.modal-overlay.show .modal-card {
  transform: translateY(0) scale(1);
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.gifts {

  display: flex;
  flex-direction: column;

  .panel {
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 1rem;
    margin-bottom: 20px;

    form {
      display: flex;
      gap: 30px;

      .group {
        display: flex;
        gap: 10px;
        align-items: center;
        justify-content: center;
      }
    }
  }

  .gifts_list {


    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;

    padding-top: 10px;

    .item_card {
      padding: 20px;
      border: solid 1px #616161;
      border-radius: 2rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      min-height: 45vh;
      background-color: rgb(255 255 255 / 0.1);
      backdrop-filter: blur(10px);

      text-decoration: none;
      color: white;

      transition: transform 0.3s ease;

      img {
        border: solid 1px white;
        width: 100%;
        height: 25vh;
        object-fit: cover;
        border-radius: 1rem;
      }

      .popis {
        display: flex;
        flex-direction: column;
        align-items: center;

        h1 {
          color: black;
          background-color: white;
          font-weight: bold;
          font-size: 2rem;
          border-radius: 1rem;
          padding: 5px 10px;
          margin-top: 20px;
        }

        p {
          font-size: 26px;
          margin: 0;
        }
      }

      button {
        margin-top: 10px;
      }

      p.error {
        margin-top: 10px;
        margin-bottom: 0;
        text-align: center;
      }
    }

    @media (hover: hover) {
      .item_card:hover {
        cursor: pointer;
        transform: translateY(-10px);
      }
    }
    .item_card:active {
      cursor: pointer;
      transform: translateY(-10px);
    }
  }
}

.login {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
  align-items: center;
  margin-bottom: 20vh;

  form {
    background-color: rgba(255, 255, 255, 0.1);
    border: solid 1px #616161;
    backdrop-filter: blur(10px);
    padding: 50px;
    border-radius: 1.5rem;

    .form_name {
      display: flex;
      flex-direction: column;
      margin-bottom: 10px;
    }

    .buttons {
      display: flex;
      justify-content: space-between;
      margin-top: 30px;
    }

    p {
      margin-bottom: 0;
      margin-top: 10px;
      a {
        color: hotpink;
      }
    }
  }
}

form {
  label {
    font-weight: bold;
  }
  input {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    color: white;
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    border: none;
  }

  select {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    color: white;
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    border: none;
  }

  option {
    color: black;
  }

  input[type=file] {
    border-radius: 0.7rem;
  }
}

.hidden-file-input {
  display: none;
}

.file-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

#file-chosen {
  font-size: 16px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.button, button, .button {
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  backdrop-filter: blur(10px);
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 0.7rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;

  transition: 0.3s ease;
}

@media (hover: hover) {
  a.button:hover, button:hover, .button:hover {
    border-radius: 1.5rem;
    background-color: rgba(154, 154, 154, 0.2);
    cursor: pointer;
  }
}
a.button:active, button:active, .button:active {
  border-radius: 1.5rem;
  background-color: rgba(154, 154, 154, 0.2);
  cursor: pointer;
}

button[type="submit"], button.submit, a.button[type="submit"] {
  background-image: linear-gradient(rgba(38, 255, 0, 0.3), rgba(38, 255, 0, 0.3));
}
a.button[type="cancel"], button.delete, button[type="cancel"] {
  background-image: linear-gradient(rgba(255, 0, 0, 0.3), rgba(255, 0, 0, 0.3));
}

a.button[type="link"], button.link, button[type="link"] {
  background-image: linear-gradient(rgba(0, 149, 255, 0.3), rgba(0, 149, 255, 0.3));
}

a.button[type="special"], button.special, button[type="special"] {
  background-image: linear-gradient(rgb(255 0 126 / 0.3), rgb(255 0 126 / 0.3));
}

.user_actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
  * {
    flex-grow: 1;
  }
}

.admin_panel {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  flex-grow: 1;
  gap: 40px;

  padding-top: 10px;

  .left_side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;


    flex: 1;

    h1 {
      align-self: start;
      width: 100%;
      background-color: white;
      color: black;
      font-weight: bolder;
      padding: 0 10px;
    }

    form {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 20px;
      background-color: rgb(255 255 255 / 0.1);
      padding: 20px;
      border: solid 1px #616161;
      border-radius: 2rem;
      backdrop-filter: blur(10px);

      .group {
        label {
          margin-right: 10px;
        }
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: end;
      }

      button {
        margin-top: 20px;
      }
    }
  }

  .right_side {
    flex: 1;
    min-width: 400px;

    .gifts_list {
      overflow-y: auto;
      overflow-x: hidden;
      max-height: 70vh;

      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 30px;
    }
  }

  .item_card {
    padding: 20px;
    border: solid 1px #616161;
    border-radius: 2rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 20vh;
    background-color: rgb(255 255 255 / 0.1);
    backdrop-filter: blur(10px);

    transition: transform 0.3s ease;

    gap: 20px;

    img {
      border: solid 1px white;
      width: 15vh;
      height: 15vh;
      object-fit: cover;
      border-radius: 1rem;
    }

    .popis {
      display: flex;
      flex-direction: column;
      align-items: center;

      flex: 1;
      min-width: 0;

      h1 {
        color: black;
        background-color: white;
        font-weight: bold;
        border-radius: 1rem;
        padding: 5px 10px;

        max-width: 100%;
        text-align: center;
      }

      p {
        font-size: 28px;
        text-align: center;
        max-width: 100%;
      }
    }

    .image_part {
      display: flex;
      flex-direction: column;
      gap: 10px;

      .file-upload-wrapper-specific {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      form {
        display: flex;
        flex-direction: column;
        gap: 10px;

        button[type="submit"][disabled] {
          background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
          color: #b8b8b8;
        }
        @media (hover: hover) {
          button[type="submit"][disabled]:hover {
            cursor: default;
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 0.7rem;
          }
        }
        button[type="submit"][disabled]:active {
          cursor: default;
          background-color: rgba(255, 255, 255, 0.2);
          border-radius: 0.7rem;
        }

        .file-name {
          font-size: 16px;
          width: 15vh;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }

      width: 15vh;

      align-items: center;
      text-align: center;

      button, .button {
        width: 100%;
      }
    }
  }

  .modal-overlay .gifts_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: scroll;
    max-height: 40vh;

    margin-bottom: 20px;
    margin-top: 20px;
  }

  .modal-overlay .item_card {
    display: grid;
    grid-template-columns: 1fr 3fr;
    align-items: center;
    justify-content: center;
    min-height: auto;
    .image_part {
      width: auto;
      height: auto;
      img {
        width: 10vh;
        height: 15vh;
      }
    }
    .popis {

      h1 {
        font-size: 2rem;
      }

      justify-content: center;
      align-items: center;
    }

    a, p {
      margin: 0;
    }
    
    .delete_reservation_form {
      display: flex;
      justify-content: right;
    }
  }
}

.select_user_page {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  justify-content: center;
  align-items: center;
  margin-bottom: 20vh;
  margin-right: 100px;
  margin-left: 100px;
  gap: 70px;
  a {
    text-align: center;
    text-decoration: none;
    color: white;
    font-weight: bolder;
    border-radius: 1.5rem;
    border: 2px solid white;
    backdrop-filter: blur(10px);
    padding: 30px 15px;
    background-color: rgba(0, 0, 0, 0.2);

    transition: 0.3s ease;

    h1 {
      font-weight: bolder;
      margin: 0;
    }
  }

  @media (hover: hover) {
    a:hover {
      border-radius: 6rem;
      background-color: rgba(255, 255, 255, 0.8);
      border: 2px solid black;
      color: black;
    }
  }
  a:active {
    border-radius: 6rem;
    background-color: rgba(255, 255, 255, 0.8);
    border: 2px solid black;
    color: black;
  }
}



footer {
  padding: 0 60px;
  margin-top: auto;
  background-color: rgb(0 0 0 / 0.5);
  height: 60px;
  backdrop-filter: blur(10px);

  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;

  a {
    color: hotpink;
  }
}

.hideondesktop {
  display: none;
}

.coolseparator {
  margin: 0;
  padding: 5px;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 2rem;
}

.welcome {
  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;
  margin-top: 20vh;

  gap: 30px;

  a {
    margin-top: 20px;
    width: fit-content;
  }

  p {
    text-align: center;
  }

  p.main_p {
    font-size: 20px;
  }

  div {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px);
    border-radius: 2rem;
    border: solid 1px #616161;
  }
}

@media (max-width: 768px) {

  .hideondesktop {
    display: block;
  }

  .modal-card {
    margin: 10px;
  }

  div.modal-actions {
    gap: 20px;
  }

  form {
    input {
      width: 100%;
    }
  }

  header {
    top: 0;
    flex-direction: row;
    margin-top: 0;
    margin-right: 0;
    margin-left: 0;
    padding-bottom: 10px;
    padding-left: 10px;
    padding-right: 20px;
    padding-top: 10px;
    justify-content: space-between;

    .logosection {
      align-items: center;
      margin: 0;
      background: none;
    }

    svg.headerlogo {
      padding: 0;
      background: none;
    }

    .logotext {
      background: none;
    }

    span.header_actions {
      display: flex;
      flex-direction: row;
    }

    a.button, button {
      img {
        margin-right: 0 !important;
        width: 24px !important;
      }
    }

    .share_button {
      display: flex;
      margin-right: 5px;
    }

    h1 {
      font-size: 7vw;
    }
  }

  main {
    margin-top: 10px;
  }

  div.apk_header {
    display: flex !important;
    position: sticky;
    z-index: 9999;
    flex-direction: row;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 10px;
    gap: 5px;
  }

  .apk_header a, .apk_header button {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    p {
      padding: 0;
      margin: 0;
    }

    img {
      width: 16px;
      height: auto;
      margin-right: 5px;
    }
  }

  .apk_header .dismiss_app_butt {
    border-top-right-radius: 0.2rem;
    border-bottom-right-radius: 0.2rem;
  }

  .download_button {
    flex-grow: 1;
    border-top-left-radius: 0.2rem;
    border-bottom-left-radius: 0.2rem;
  }

  footer {
    padding: 0 20px;
  }

  main {
    padding: 0 20px;
    margin-bottom: 20px;
    .card_container {
      grid-template-columns: 1fr;
      .category_card {

        min-height: 11vh;

        h1 {
          margin: 0;
        }
      }

      #cat_card_1 {
        background-image: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.8) 100%), url("../img/stepan.jpg");
      }
      #cat_card_2 {
        background-image: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.8) 100%), url("../img/andy.jpg");
      }
      #cat_card_3 {
        background-image: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.8) 100%), url("../img/maminka.jpg");
      }
      #cat_card_4 {
        background-image: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.8) 100%), url("../img/anezka.jpg");
      }
      #cat_card_5 {
        background-image: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.8) 100%), url("../img/babicka.jpg");
      }
    }
  }

  .gifts {
    min-height: 100%;
    .gifts_list {
      grid-template-columns: 1fr;
      min-height: 100%;
      max-height: 100%;
    }
  }

  .select_user_page {
    grid-template-columns: 1fr;
    margin: auto;
    gap: 0;
  }

  .admin_panel {
    display: flex;
    flex-direction: column;

    .left_side {
      margin-top: 10px;
    }

    .right_side {
      min-width: 0;
      .gifts_list {
        max-height: 100%;

        padding-top: 0;

        .item_card {
          display: grid;
          grid-template-areas: 
          "img popis popis"
          "img button button";


          min-height: auto;

          .popis {
            grid-area: popis;
          }
          form {
            align-self: end;
            display: flex;
            grid-area: button;
            align-items: end;
            justify-content: center;
          }

          img {
            aspect-ratio: 1/1;
            height: auto;
            width: 12vh;
          }

          .image_part {
            grid-area: img;
            width: 12vh;

            form {
              width: 12vh;

              .file-upload-wrapper-specific {
                width: 12vh;
              }
            }
          }
        }
      }
    }
  }

  button, a.button, input, label, p {
    font-size: 20px;
  }

  h2 {
    font-size: 30px;
  }

  .hideonmobile {
    display: none;
  }

  .user_actions {
    position: static;
    gap: 20px;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  .login {
    margin-left: 10px;
    margin-right: 10px;
  }

  .file-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .welcome {
    margin-top: 0;
  }
}

@media (min-width: 769px) {
  #reservesModal {
    .modal-card {
      min-width: 40vw;
    }
  }
}

@media (display-mode: standalone) {
  div.apk_header {
    display: none !important;
  }
}

.nsp-bottom-m-0 {
  margin-bottom: 0 !important;
}

.nsp-top-m-0 {
  margin-top: 0 !important;
}

.nsp-top-m-20 {
  margin-top: 20px !important;
}