.controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: rgba(30, 30, 42, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 20px;
  border-radius: 12px;
  z-index: 10;
  width: 300px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}
.control-panel-content {
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, margin-bottom 0.3s ease-in-out;
  overflow: auto;
  overflow-x: clip;
  flex-grow: 1;
  opacity: 1;
  padding: 8px;
}
.controls.collapsed .control-panel-content {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}
.toggle-button {
  position: absolute;
  top: 20px;
  right: 10px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.toggle-button:hover {
  background: rgba(255, 255, 255, 0.2);
}
.toggle-btn {
  flex-grow: 1;
  padding: 8px 5px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid transparent;
  color: #ccc;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
  font-size: 13px;
  text-align: center;
}
.toggle-btn svg {
  display: inline-block;
  vertical-align: middle;
}
.toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
.toggle-btn.active {
  background-color: #4a90e2;
  color: white;
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.5);
}

.control-group {
  margin-bottom: 15px;
}
.control-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 500;
}
.control-group input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.control-group input[type="range"]::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.2);
  height: 4px;
  border-radius: 2px;
}
.control-group input[type="range"]::-moz-range-track {
  background: rgba(255, 255, 255, 0.2);
  height: 4px;
  border-radius: 2px;
}
.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -6px;
  background-color: #4a90e2;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  border: 2px solid white;
}
.control-group input[type="range"]::-moz-range-thumb {
  background-color: #4a90e2;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  border: 2px solid white;
}
.control-group .value-display {
  float: right;
  font-size: 14px;
  font-weight: 600;
  color: #ccc;
}

.control-panel-content::-webkit-scrollbar {
  width: 8px;
}
.control-panel-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.control-panel-content::-webkit-scrollbar-thumb {
  background: rgba(74, 144, 226, 0.7);
  border-radius: 4px;
}
.control-panel-content::-webkit-scrollbar-thumb:hover {
  background: #4a90e2;
}

.panel-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-header {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  padding: 15px 5px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  position: relative;
  transition: background-color 0.2s;
}

.accordion-header::after {
  content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/></svg>');

  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-header::after {
  /* content: "-"; */
  transform: translateY(-50%) rotate(-90deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.text-input,
.font-select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(0, 0, 0, 0.2);
  color: white;
}

.color-input {
  width: 100%;
  height: 40px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

textarea.text-input {
  resize: vertical;
}

.popup-content .star-button {
  background-color: #24292e;
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
  transition: background-color 0.2s;
}

.popup-content .coffee-button {
  background-color: #24292e;
  color: yellow;
  padding: 10px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
  transition: background-color 0.2s;
}
