/* Main settings card container */

#settingsCard {
  position: absolute;
  top: 20px;
  right: 20px;
  width: clamp(20px, 30vw, 80px); /* Responsive width */
  max-width: fit-content;
  height: 30px;
  background-color: rgba(0, 0, 0, 0.8); /* Match theme background */
  border: 2px solid rgba(240, 171, 0, 0.6); /* Gold border */
  border-radius: 10px;
  backdrop-filter: blur(8px);
  transition: all 0.9s ease-in-out;
  cursor: pointer;
  z-index: 99;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  overflow: hidden;
  font-size: 15px;
}



/* Expanded card */
#settingsCard.expanded {
  width: auto;
  height: auto;
  align-items: flex-start;
  border-radius: 15px;
  flex-direction: column;
  transition: transform 0.9s ease-in-out;
}

#settingsCard.disabled {
  opacity: 0.5;
  pointer-events: none; /* Prevents interaction */
  cursor: not-allowed; /* Shows a "not-allowed" cursor */
  transition: opacity 0.3s ease-in-out;
}

/* Card header */
.card-header {
  width: 100%;
  padding: 10px;
  color: #f5bd02; /* Golden text */
  font-weight: bold;
  text-align: center;
  border-radius: 15px 15px 0 0;
  justify-content: flex-start;
  align-items: center;
}

/* Card content */
.card-content {
  padding: 15px;
  display: none;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

#settingsCard.expanded .card-content {
  opacity: 1;
}

/* Tablet adjustments */
@media (max-width: 768px) {
  #settingsCard {
    top: 15px;
    right: 15px;
    width: clamp(20px, 40vw, 70px); /* Slightly smaller width on tablets */
    font-size: 14px; /* Smaller font */
  }
  
  .card-header {
    padding: 8px; /* Less padding */
  }
  
  .card-content {
    padding: 10px;
  }
}

/* Mobile adjustments */
@media (max-width: 480px) {
  #settingsCard {
    top: 10px;
    right: 10px;
    width: clamp(20px, 50vw, 60px); /* More compact on mobile */
    font-size: 12px; /* Smaller font */
  }
  
  .card-header {
    padding: 6px; /* Less padding */
  }
  
  .card-content {
    padding: 8px;
  }
}

/* Extra Small Mobile adjustments */
@media (max-width: 320px) {
  #settingsCard {
    top: 5px;
    right: 5px;
    width: clamp(20px, 60vw, 50px); /* Even more compact */
    font-size: 11px; /* Smallest font */
  }
  
  .card-header {
    padding: 5px;
  }
  
  .card-content {
    padding: 6px;
  }
}


/* Container for spread selector and inversion toggle */
#settingsContent {
  display: inline-flex;
  flex-direction: column;
  gap: 15px; /* Space between inversion toggle and spread selector */
  justify-content: flex-start;
  align-items: center;
}


#settingsCard:not(.expanded) #settingsContent {
  display: none;
}


/* Spread selector buttons */
#spreadSelector {
  display: flex;
  flex-direction: column; /* Stack buttons vertically */
  align-items: center; /* Align buttons horizontally */
}

#spreadSelector button {
  margin: 5px;
  padding: 5px 15px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #f5bd02; /* Golden text */
  border: 1px solid rgba(240, 171, 0, 0.6); /* Gold border */
  border-radius: 15px;
  font-size: 12px;
  font-weight: normal;
  transition: all 0.4s ease;
  backdrop-filter: blur(5px);
  outline: none; /* Keep outlines off */
}

#spreadSelector button:hover {
  background-color: rgba(240, 171, 0, 0.5);
  box-shadow: 0px 0px 10px rgba(240, 171, 0, 0.5);
}

/* Style for selected button */
#spreadSelector button.selected {
  background-color: rgba(240, 171, 0, 0.7);
  box-shadow: 0px 0px 10px rgba(240, 171, 0, 0.8);
  border-color: rgba(240, 171, 0, 0.8);
  color: #fff; /* White text for emphasis */
  font-weight: bold;
}

/* Flex container for switch and label */
.settings-item {
  display: flex;
  flex-direction: column; /* Stack slider and label vertically */
  align-items: center;
  justify-content: center;
}

/* Slider switch for inversion toggle */
.switch {
  position: relative; /* Allows the absolute positioning of the slider */
  display: inline-block;
  width: 30px;
  height: 15px;
  margin-bottom: 5px; /* Space between slider and label */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute; /* Absolute positioning inside switch container */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  border: 2px solid rgba(240, 171, 0, 0.8); /* Outline for the slider track */
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 11px; /* Smaller than slider height */
  width: 11px; /* Smaller than slider width */
  left: 0px; /* Start position inside the slider */
  top: 50%; /* Center align vertically */
  transform: translateY(-50%); /* Ensure it’s vertically centered */
  background-color: #f5bd02; /* Gold color */
  border-radius: 50%; /* Round circle */
  border: 2px solid rgba(0, 0, 0, 0.8); /* Outline for the circle */
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #f5bd02; /* Gold background when active */
  border: 2px solid rgba(0, 0, 0, 0.8); /* Outline for the slider track */
}

input:checked + .slider:before {
  transform: translate(
    14px,
    -50%
  ); /* Move horizontally while keeping vertically centered */
}

/* Label for inversion toggle */
#toggleLabel {
  font-size: 12px;
  color: #f5bd02; /* Gold text */
  align-self: center;
  margin-top: -5px; /* Space between the slider and label */
  position: relative; /* Allow positioning within flex context */
  padding-left: 5px;
}
