* {
  box-sizing: border-box;
}
html {
  background-color: #f0f8ff;
}
body {
  font-family: "Anton", sans-serif;
  font-size: 20px;
  /* Glass effect */
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(55.3px);
  -webkit-backdrop-filter: blur(15.3px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin: 2rem;
  padding: 2rem;
  position: relative;
  z-index: 1;
  min-width: 0;
}

header {
  font-family: "Anton", sans-serif;
  color: red;
  display: block; /* This helps with transformations */
  width: 100%;
  height: 80px;
  margin: 0;
  font-size: clamp(16px, 5vw, 35px);
}
.title {
  position: relative;
  margin-left: 5vw; /* 15% of the viewport width */
  margin-top: 8px;
}
.content-box {
  flex-shrink: 0;
  align-items: center;
  background-color: #ffffff;
  border: 2.5px solid black;
  border-radius: 5px;
  width: min(980px, 100%);
  max-width: 100%;

  height: 660px;
  margin: 30px auto;
  position: relative;
  overflow: hidden;
  /*background: linear-gradient(306deg, #4ab4c2 3.33%, #ef0d0d 39.86%);*/
}
.circle,
.circle-gradient {
  width: 1000px;
  height: 1000px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  right: 360px;
  transform: translateY(-50%);
  transition: transform 0.4s ease;
}

.circle {
  background: transparent;
  /* keep your size and position styles */
  position: absolute;
  z-index: 1;
}

.circle-gradient {
  width: 1000px;
  height: 1000px;
  border-radius: 50%;
  box-shadow: -10px 40px 31.7px 25px rgba(0, 0, 0, 0.49);
  background: linear-gradient(306deg, #838383 3.33%, #e9e9e9 39.86%);
  position: absolute;
  right: 360px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0; /* Behind the circle */
}

.object button {
  /* Copy all styles from your popover button */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  position: absolute;
  padding: 10px;
  width: 80px;
  background-color: rgba(255, 255, 255, 0);
}

/* Position each of the other buttons */
button[popovertarget="my-popover"] {
  top: 54%;
  left: 51%;
  height: 7%;
  transform: translate(-50%, -50%);
  z-index: 10;
  /*background-color: red;*/
}

.backward-button,
.forward-button,
.pause-button {
  position: absolute;
  z-index: 10;
  width: 40px;
  height: 40px;
  cursor: pointer;
  /*background-color: red  !important;*/
}

.backward-button {
  width: 40px !important;
  height: 60px !important;
  top: 65%;
  left: 41%;
  transform: translate(-50%, -50%);
  /*background-color: green !important;*/
}

.forward-button {
  width: 40px !important;
  height: 60px !important;
  top: 65%;
  left: 59%;
  transform: translate(-50%, -50%);
}

.pause-button {
  width: 80px !important;
  height: 40px !important;
  top: 78%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes growFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#my-popover[popover]:popover-open {
  /* From https://css.glass */
  background-color: rgba(255, 255, 255, 0);
  border-radius: 15px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(9.9px);
  /*padding: 1px;*/
  width: 556px;
  height: 419px;
  /*transform-origin: center top;*/
  -webkit-backdrop-filter: blur(9.9px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  animation: growFadeIn 0.4s ease forwards;
}

/*inner popover content*/
#popover-content {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 4px 4px rgba(0, 0, 0, 0.19) inset;
  font-size: 20px;
  text-align: center;
  padding: 10px 10px;
  width: 338px;
  height: 256px;

  /* Centering styles */
  position: absolute; /* Allows positioning within parent relative container */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Centers element perfectly */
  display: flex;
  overflow: hidden;
}

/*left-content styling*/
#left-content {
  width: 60%;
  height: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  padding-right: 5px;
  overflow: hidden;
}

#right-content {
  width: 40%;
  height: 100%;
  border-radius: 5px;
  /*background-color: #222;*/
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* For the header styling */
.music-header {
  background: linear-gradient(to bottom, #f0f0f0, #d8d8d8);
  padding: 5px;
  border-bottom: 1px solid #aaa;
  font-weight: 100;
  color: #333;
  font-size: 16px;
  display: flex;
  border-radius: 4px;
  justify-content: space-between;
  align-items: center;
}

/* For the song list styling */
.song-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  /*overflow-y: auto; !* Allows scrolling if list is too long *!*/
}

.song-list li {
  padding: 6px 8px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  font-family: "Roboto Flex";
  font-weight: bolder;
  border-radius: 3px;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.song-list li.active {
  background-color: #3478f6;
  color: white;
}

.song-list li:hover:not(.active) {
  background-color: #d5d5d5;
}

.song-list li.active:hover {
  background-color: rgba(52, 120, 246, 0.91);
}

/* Album cover image styling */
#right-content img {
  width: 100%; /* Ensure the image spans the full width of the container */
  height: 100%; /* Ensure the image spans the full height of the container */
  object-fit: cover; /* Maintain aspect ratio and cover the container */
  border-radius: inherit; /* Match the border radius of parent container */
  position: absolute; /* Ensure the image is contained within its parent */
  top: 0;
  left: 0;
}

/* Base styling for all objects */
.object {
  /*background-color: red;*/
  transform: scale(0.7);
  transform-origin: center center;
  position: absolute;
  width: auto; /* Let the content determine the width */
}

/* Target the image directly */
.object img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

/* Position the first object */
.object:nth-child(1) {
  /*transform: translate(-50%, -50%);*/
  right: 0; /* Adjust this value to position from right edge of the circle */
  top: 300px; /* Adjust this value to position from top of the circle */
  width: 40%; /* Let the content determine width instead of 100% */
  /* background-color: red; !* For debugging *! */
}
.object:nth-child(2) {
  right: 300px;
  top: 5px;
  /* You can override size for specific objects if needed */
  width: 40%;
}
.object:nth-child(3) {
  /* transform: translate(-50%, -50%); */
  /*right: 20px;*/
  left: 10px;
  top: 300px;
  width: 30%;
}
.object:nth-child(4) {
  /*transform: translate(-50%, -50%);*/

  /*right: 0px;*/
  right: 300px;
  top: 550px;
  /*height: 10%;*/
  width: 50%;
}

#ipod {
  width: 450px; /* Try a fixed width instead of percentage */
  height: auto;
  display: block;
  /*transform: rotate(2deg);*/
  /*border: 2px solid blue; !* To see if the image is loading but maybe invisible *!*/
}

.image-wrapper {
  position: relative;
  /* background: red; */
  /*transform-origin: center center;*/
  /*transform: rotate(20deg);*/
}

.image-wrapper::after {
  content: "";
  position: absolute;
  top: 100px;
  left: 31%;
  width: 40%;
  height: 65%;
  /*background: rgba(187, 27, 27, 0.2);*/
  filter: blur(8px);
  box-shadow:
    1px 1px 30px rgb(0, 0, 0, 1),
    1px 1px 30px rgba(0, 0, 0, 1),
    1px 1px 30px rgba(0, 0, 0, 1);
  z-index: -1;
}
.image-wrapper1 > .open-popup-app-button {
  background: red;
  right: 50px;
  top: 50px;
  width: 80%;
  height: 75%;
  transform: rotate(-9deg);
  background-color: rgba(255, 255, 255, 0);
  cursor: pointer;
}

/* Initially hide the pop-up */
.popup {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(9.9px);
  border-radius: 15px;
  position: fixed;
  z-index: 1;
  /* Position the top-left corner of the div in the center of the screen */
  padding: 30px;
  left: 50%;
  top: 45%;
  display: none;
  /* IMPROVED: Ensure popup doesn't overflow viewport on small screens */
  max-width: calc(100vw - 40px); /* 20px margin on each side */
  max-height: calc(100vh - 40px);
  /* Use transform to shift the div back by half of its own width and height */
  transform: translate(-50%, -50%);
  width: clamp(520px, 50vw, 600px);
  height: clamp(350px, 50vh, 60vh);
}

/* Class to display the pop-up */
.popup.show {
  display: flex; /* Or 'block', depending on your layout needs */
  justify-content: center;
  align-items: center;
}

/* Style the content inside the pop-up */
.popup-content {
  background-color: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 15px;
  height: 100%;
  width: 100%;
  max-width: 100%;
  position: relative;
  border: 1px solid black; /* To see if the image is loading but maybe invisible *! */
}

/*Style synonym-network-app heading*/
.popup-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: white;
  border-radius: 15px;
  flex-shrink: 0;
  position: relative;
}

.popup-heading h2 {
  margin: 0;
  font-size: clamp(0.85rem, 1vw, 1.1rem);
  font-weight: 500;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #616161;
}
/*Style  synonym-network-app body*/
.popup-body,
.dep-popup-body {
  padding: 20px 15px;
  background-color: white;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
/* Specific styling for definitions popup body */
.def-popup-body {
  padding: 0; /* Remove padding since we'll handle it in the displayDefinitions function */
}

#cy,
#dy {
  width: 100%;
  height: 100%;
  display: none;
  flex: 1;
}

.popup-api-response {
  display: flex;
  font-size: clamp(1rem, 1vw, 1.5rem);
  font-weight: 150;
  flex-shrink: 0;
  height: 4vw;
  width: 100vw;
  background-color: white;
  padding: 10px;
  margin: 5px;
}
/*Style  synonym-network-app buttons*/
.popup-btns {
  margin: 10px;
  padding: 0 10px;
  display: flex;
  gap: 9px;
  align-items: center;
  background-color: white;
  border-radius: 0 0 15px 15px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.popup-btns input[type="text"] {
  min-width: 100px;
  width: clamp(100px, 20vw, 180px);
  padding: 8px 10px;
  height: 22px;
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  border: 1px solid white-space;
  flex: 1;
  max-width: 120px;
}

.popup-btns button {
  padding: 8px 16px;
  border: none;
  height: 41px;
  width: 140px;
  background-color: #222;
  color: white;
  font-size: 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#definition-btn:disabled {
  background-color: #ccc;
  color: #666;
  cursor: not-allowed;
}

#definition-btn.ready {
  background-color: #222;
  color: white;
  cursor: pointer;
}

.popup-btns button:hover {
  background-color: #0056b3;
}

/* Style the close button */
.close-btn,
.def-close-btn {
  color: #aaa;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  line-height: 1;
  font-weight: bold;
}

.close-btn:hover,
.def-close-btn:hover,
.close-btn:focus,
.def-close-btn:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}
body.dark-mode {
  background: rgba(45, 46, 57, 0.9);
}

body.dark-mode .title {
  color: rgba(205, 109, 176, 1);
}
html.dark-mode {
  background: rgba(37, 38, 46, 1);
}
body.dark-mode .content-box {
  border: 2.5px solid white;
  background-color: #f2f0ef;
}

