// Variables
$modal-bg: rgba(0, 0, 0, 0.7); // Modal baggrund
$modal-blur: 8px;
$modal-z-index: 999999;
$modal-content-bg: #fff;
$modal-content-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
$button-color: #000;

// Global reset for button styles (kun på forsiden)
.open,
.open_inv {
  all: unset; // Fjerner globale værdier som border og baggrund
  display: inline-block;
  padding: 10px 15px;
  margin: 10px;
  font-size: 16px;
  color: $button-color;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;

  &:hover {
    transform: scale(1.05); // Let zoom-effekt
    color: darken($button-color, 20%);
  }
}

// Rotation på forsiden
.open {
  transform: rotate(10deg);
}

.open_inv {
  transform: rotate(-10deg);
}

// Modal background
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: $modal-bg;
  backdrop-filter: blur($modal-blur);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: $modal-z-index;
}

// Modal content
.modal-content {
  background-color: $modal-content-bg;
  padding: 20px;
  border-radius: 8px;
  box-shadow: $modal-content-shadow;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;

  img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
  }

  // Modal knapper (bevarer globale værdier)
  .modal-buttons {
    display: flex;
    justify-content: center;
    position: relative;
    margin-top: 20px;

    button {
      position: relative; /* Tillader z-index at tage effekt */
      margin: -20px; /* Øger negativ margin for mere overlap */
      padding: 12px 18px;
      font-size: 16px;
      cursor: pointer;
      transition: transform 0.3s ease, z-index 0.3s ease;

      &:hover {
        transform: scale(1.05);
        z-index: 3; /* Hæver knappen øverst ved hover */
      }
    }

    button:nth-child(odd) {
      transform: rotate(10deg); /* Roterer med uret */
      z-index: 1; /* Start-lag for ulige knapper */
    }

    button:nth-child(even) {
      transform: rotate(-10deg); /* Roterer mod uret */
      z-index: 2; /* Lidt højere lag for lige knapper */
    }
  }

  .close-btn {
    position: absolute;
    transform: translateX(-50%);
    cursor: pointer;
  }
}
.next-btn {
  cursor: pointer;
  position: absolute;
  right: 20px;
  transition: background-color 0.3s ease;
}
// Thumbnail styling (forsiden)
.thumbnail {
  width: 150px;
  height: 100px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.3s ease;

  &:hover {
    transform: scale(1.05);
  }
}
