/* From Uiverse.io by chase2k25 - Cyberpunk Volume Knob */
.knob-wrapper {
  position: relative;
  font-family: 'Orbitron', sans-serif;
}

/* Versione compatta per ChatUni (120px invece di 230px) */
.knob-outer {
  user-select: none;
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 100%;
  box-shadow:
    5px 5px 10px rgba(0, 242, 255, 0.1) inset,
    -5px -5px 10px rgba(0, 0, 0, 0.5) inset,
    0 0 20px rgba(0, 242, 255, 0.15);
  background-color: transparent;
}

.knob-base {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 114px;
  height: 114px;
  margin: -57px 0 0 -57px;
  border-radius: 100%;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.6),
    0 0 15px rgba(0, 242, 255, 0.1);
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 100%);
  border: 1px solid rgba(0, 242, 255, 0.2);
}

.knob-middle {
  z-index: 4;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 100%;
  box-shadow:
    inset 0 1px 2px rgba(0, 242, 255, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.85);
  background: radial-gradient(ellipse at center, #16213e 0%, #0a0a15 100%);
  border: 1px solid rgba(0, 242, 255, 0.15);
}

.knob-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  border-radius: 100%;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0f0f23 100%);
}

.knob-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 100%;
  box-shadow:
    inset 0 1px 3px rgba(0, 242, 255, 0.3),
    0 4px 10px rgba(0, 0, 0, 0.9);
  background: radial-gradient(ellipse at center, #1f2940 0%, #0a0a15 100%);
  border: 1px solid rgba(0, 242, 255, 0.1);
}

.control {
  z-index: 3;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.knob-base .control label {
  z-index: 2;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 36px;
  margin-top: -18px;
  transform-origin: 0% 50%;
  cursor: pointer;
}

.knob-base .control label span {
  position: absolute;
  top: 0;
  right: 2px;
  width: 22px;
  height: 100%;
  font-weight: bold;
  font-size: 8px;
  line-height: 36px;
  text-align: center;
  color: #00f2ff;
  text-shadow: 0 0 5px #00f2ff;
  font-family: 'Orbitron', sans-serif;
}

.knob-base .control label:nth-child(1) {
  transform: rotate(-90deg);
}
.knob-base .control label:nth-child(1) span {
  transform: rotate(90deg);
}
.knob-base .control label:nth-child(2) {
  transform: rotate(-30deg);
}
.knob-base .control label:nth-child(2) span {
  transform: rotate(30deg);
}
.knob-base .control label:nth-child(3) {
  transform: rotate(30deg);
}
.knob-base .control label:nth-child(3) span {
  transform: rotate(-30deg);
}
.knob-base .control label:nth-child(4) {
  transform: rotate(90deg);
}
.knob-base .control label:nth-child(4) span {
  transform: rotate(-90deg);
}
.knob-base .control label:nth-child(5) {
  transform: rotate(150deg);
}
.knob-base .control label:nth-child(5) span {
  transform: rotate(-150deg);
}
.knob-base .control label:nth-child(6) {
  transform: rotate(210deg);
}
.knob-base .control label:nth-child(6) span {
  transform: rotate(-210deg);
}

.knob-base .control input {
  position: absolute;
  opacity: 0;
  visibility: hidden;
}

.pointer {
  z-index: 1;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  height: 52px;
  margin-top: -26px;
  transform-origin: 0% 50%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pointer span {
  position: absolute;
  top: 0;
  left: 8px;
  width: 52px;
  height: 52px;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 242, 255, 0.6) 0%,
    rgba(0, 242, 255, 0.15) 42%,
    rgba(0, 242, 255, 0) 72%
  );
  border-radius: 50%;
}

.marker {
  z-index: 6;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50%;
  height: 8px;
  margin-top: -4px;
  transform-origin: 0% 50%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.marker span {
  position: absolute;
  top: 0;
  left: 16px;
  width: 8px;
  height: 8px;
  border-radius: 100%;
  background: #00f2ff;
  box-shadow: 0 0 8px #00f2ff, 0 0 15px rgba(0, 242, 255, 0.5);
}

.status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
}

.off-light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #333;
  margin-bottom: 4px;
  transition:
    background-color 0.3s,
    box-shadow 0.3s;
}

.speed-lights {
  display: flex;
  gap: 3px;
}

.speed-light {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #333;
  transition:
    opacity 0.3s,
    background-color 0.3s,
    box-shadow 0.3s;
}

/* Rotations and Indicator States - Cyberpunk Version */
#vol_off:checked ~ .pointer {
  transform: rotate(-90deg);
}
#vol_off:checked ~ .knob-middle .status .off-light {
  background-color: #ff003c;
  box-shadow: 0 0 6px #ff003c;
}
#vol_off:checked ~ .pointer span {
  background: radial-gradient(
    ellipse at center,
    rgba(255, 0, 60, 0.4) 0%,
    rgba(255, 0, 60, 0.1) 42%,
    rgba(255, 0, 60, 0) 72%
  );
}
#vol_1:checked ~ .pointer {
  transform: rotate(-30deg);
}
#vol_2:checked ~ .pointer {
  transform: rotate(30deg);
}
#vol_3:checked ~ .pointer {
  transform: rotate(90deg);
}
#vol_4:checked ~ .pointer {
  transform: rotate(150deg);
}
#vol_5:checked ~ .pointer {
  transform: rotate(210deg);
}

#vol_off:checked ~ .marker {
  transform: rotate(-90deg);
}
#vol_off:checked ~ .marker span {
  background: #ff003c;
  box-shadow: 0 0 8px #ff003c;
}
#vol_1:checked ~ .marker {
  transform: rotate(-30deg);
}
#vol_2:checked ~ .marker {
  transform: rotate(30deg);
}
#vol_3:checked ~ .marker {
  transform: rotate(90deg);
}
#vol_4:checked ~ .marker {
  transform: rotate(150deg);
}
#vol_5:checked ~ .marker {
  transform: rotate(210deg);
}

/* Status lights for volume levels */
#vol_off:checked ~ .knob-middle .status .speed-lights .speed-light {
  opacity: 0.2;
}

#vol_off:checked ~ .knob-middle .status .off-light {
  background-color: #ff003c;
  box-shadow: 0 0 6px #ff003c;
}

#vol_1:checked ~ .knob-middle .status .off-light {
  background-color: #333;
  box-shadow: none;
}
#vol_1:checked ~ .knob-middle .status .speed-lights .speed-light:nth-child(1) {
  background-color: #00f2ff;
  box-shadow: 0 0 6px #00f2ff;
  opacity: 1;
}
#vol_1:checked ~ .knob-middle .status .speed-lights .speed-light:nth-child(n+2) {
  opacity: 0.2;
}

#vol_2:checked ~ .knob-middle .status .off-light {
  background-color: #333;
  box-shadow: none;
}
#vol_2:checked ~ .knob-middle .status .speed-lights .speed-light:nth-child(-n+2) {
  background-color: #00f2ff;
  box-shadow: 0 0 6px #00f2ff;
  opacity: 1;
}
#vol_2:checked ~ .knob-middle .status .speed-lights .speed-light:nth-child(n+3) {
  opacity: 0.2;
}

#vol_3:checked ~ .knob-middle .status .off-light {
  background-color: #333;
  box-shadow: none;
}
#vol_3:checked ~ .knob-middle .status .speed-lights .speed-light:nth-child(-n+3) {
  background-color: #00f2ff;
  box-shadow: 0 0 6px #00f2ff;
  opacity: 1;
}
#vol_3:checked ~ .knob-middle .status .speed-lights .speed-light:nth-child(n+4) {
  opacity: 0.2;
}

#vol_4:checked ~ .knob-middle .status .off-light {
  background-color: #333;
  box-shadow: none;
}
#vol_4:checked ~ .knob-middle .status .speed-lights .speed-light:nth-child(-n+4) {
  background-color: #00f2ff;
  box-shadow: 0 0 6px #00f2ff;
  opacity: 1;
}
#vol_4:checked ~ .knob-middle .status .speed-lights .speed-light:nth-child(5) {
  opacity: 0.2;
}

#vol_5:checked ~ .knob-middle .status .off-light {
  background-color: #333;
  box-shadow: none;
}
#vol_5:checked ~ .knob-middle .status .speed-lights .speed-light {
  background-color: #00f2ff;
  box-shadow: 0 0 6px #00f2ff;
  opacity: 1;
}

/* Hover effect for labels */
.knob-base .control label:hover span {
  color: #00ff41;
  text-shadow: 0 0 8px #00ff41;
}

/* Container styling for the volume knob */
.volume-knob-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 15px;
  border: 1px solid rgba(0, 242, 255, 0.15);
  backdrop-filter: blur(5px);
}

.volume-level-display {
  color: #00f2ff;
  font-size: 0.7rem;
  font-family: 'Orbitron', sans-serif;
  text-shadow: 0 0 5px rgba(0, 242, 255, 0.5);
  letter-spacing: 1px;
}
