/**
 * Waveform Comments Styles
 * SoundCloud-style timestamped comments on waveforms
 */

/* Overlay for interaction */
.waveform-comments-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
}

/* Hover line indicator */
.waveform-comments-hover-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: rgba(255, 255, 255, 0.6);
  transform: translateX(-50%);
  display: none;
  pointer-events: none;
  z-index: 11;
}

.dark .waveform-comments-hover-line {
  background-color: rgba(255, 255, 255, 0.8);
}

/* Hover timestamp display */
.waveform-comments-hover-time {
  position: absolute;
  top: -25px;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  white-space: nowrap;
  display: none;
  pointer-events: none;
  z-index: 12;
}

.dark .waveform-comments-hover-time {
  background-color: rgba(255, 255, 255, 0.9);
  color: #000;
}

/* Add comment button */
.waveform-comments-add-btn {
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #ff69b4;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: none;
  pointer-events: auto;
  z-index: 13;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.waveform-comments-add-btn:hover {
  background-color: #ff1493;
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 3px 6px rgba(255, 20, 147, 0.4);
}

.waveform-comments-add-btn:active {
  transform: translateX(-50%) scale(0.95);
}

/* Comment markers */
.waveform-comments-marker {
  position: absolute;
  z-index: 20;
  cursor: pointer;
}

.waveform-comments-marker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ff69b4;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.dark .waveform-comments-marker-dot {
  border-color: #333;
}

.waveform-comments-marker:hover .waveform-comments-marker-dot,
.waveform-comments-marker.active .waveform-comments-marker-dot {
  transform: scale(1.5);
  background-color: #ff1493;
  box-shadow: 0 2px 6px rgba(255, 20, 147, 0.5);
}

/* Multiple comments indicator */
.waveform-comments-marker-dot.has-multiple {
  width: 10px;
  height: 10px;
}

.waveform-comments-marker-dot.has-multiple::after {
  content: attr(data-count);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 9px;
  white-space: nowrap;
  display: none;
}

.waveform-comments-marker:hover .waveform-comments-marker-dot.has-multiple::after {
  display: block;
}

/* Marker tooltip */
.waveform-comments-marker-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 5px;
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 21;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waveform-comments-marker:hover .waveform-comments-marker-tooltip {
  opacity: 1;
}

.dark .waveform-comments-marker-tooltip {
  background-color: rgba(255, 255, 255, 0.95);
  color: #000;
}

/* Comment input container */
.waveform-comments-input-container {
  position: absolute;
  z-index: 1000;
  pointer-events: auto;
}

/* Comment input */
.waveform-comments-input {
  background-color: #000;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 1px solid #ff69b4;
  min-width: 280px;
  max-width: 400px;
  overflow: hidden;
  color: #fff;
}

.dark .waveform-comments-input {
  background-color: #000;
  color: #fff;
  border-color: #ff69b4;
}

.waveform-comments-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #ff69b4;
  background-color: #1a1a1a;
}

.dark .waveform-comments-input-header {
  background-color: #1a1a1a;
  border-bottom-color: #ff69b4;
}

.waveform-comments-input-time {
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.dark .waveform-comments-input-time {
  color: #aaa;
}

.waveform-comments-input-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.waveform-comments-input-close:hover {
  color: #333;
}

.dark .waveform-comments-input-close {
  color: #aaa;
}

.dark .waveform-comments-input-close:hover {
  color: #fff;
}

.waveform-comments-input-text {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: none;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  background-color: transparent;
  color: inherit;
  outline: none;
}

.waveform-comments-input-text::placeholder {
  color: #999;
}

.dark .waveform-comments-input-text::placeholder {
  color: #666;
}

.waveform-comments-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #ff69b4;
  background-color: #1a1a1a;
}

.dark .waveform-comments-input-footer {
  background-color: #1a1a1a;
  border-top-color: #ff69b4;
}

.waveform-comments-input-chars {
  font-size: 11px;
  color: #999;
}

.dark .waveform-comments-input-chars {
  color: #666;
}

.waveform-comments-input-submit {
  background-color: #ff69b4;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.waveform-comments-input-submit:hover {
  background-color: #ff1493;
}

.waveform-comments-input-submit:active {
  background-color: #ff69b4;
}

.waveform-comments-input-submit:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Ensure waveform container is positioned relatively */
.waveform_wrap {
  position: relative !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .waveform-comments-input {
    min-width: 240px;
    max-width: 90vw;
  }

  .waveform-comments-add-btn {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .waveform-comments-marker-dot {
    width: 10px;
    height: 10px;
  }
}

