body {
  background: #111;
  color: #eee;
  font-family: sans-serif;
  margin: 0;
}
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: rgba(34, 34, 34, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 1000;
}
.title-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-logo {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.header h1 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}
.controls-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-buttons {
  display: flex;
  gap: 5px;
  align-items: center;
}

.icon-btn {
  background: #444;
  color: #eee;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  padding: 8px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background: #555;
}

#startBtn .lucide-icon {
  stroke: #fff !important; /* White icon for better visibility */
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.8)); /* Add shadow for contrast */
}

.lucide-icon {
  width: 18px;
  height: 18px;
  stroke: #eee;
  stroke-width: 2;
  fill: none;
}

.share-dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #333;
  border: 1px solid #555;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 1001;
  min-width: 180px;
  white-space: nowrap;
}

.dropdown-content button {
  background: none;
  border: none;
  color: #eee;
  padding: 10px 15px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-size: 14px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-content button:hover {
  background: #444;
}

.dropdown-content button:first-child {
  border-radius: 3px 3px 0 0;
}

.dropdown-content button:last-child {
  border-radius: 0 0 3px 3px;
}

.share-dropdown:hover .dropdown-content,
.share-dropdown.active .dropdown-content {
  display: block;
}
#controls {
  display: block;
}
.settings-section {
  margin-bottom: 20px;
  border-bottom: 1px solid #444;
  padding-bottom: 10px;
}
.settings-section h3 {
  margin: 0 0 10px 0;
  color: #fff;
  font-size: 16px;
}
.settings-section > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 999;
  justify-content: center;
  align-items: center;
}
.overlay.active {
  display: flex;
}
.settings-content {
  background: #222;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
  max-height: 80%;
  overflow-y: auto;
  position: relative;
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff4444;
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
}
label {
  font-size: 14px;
}
canvas {
  position: absolute;
  top: 70px; /* 50px header + 20px space */
  left: 20px;
  width: calc(100% - 40px);
  height: calc(100vh - 90px); /* Adjusted for 20px space */
  display: block;
  cursor: crosshair;
  transition: top 0.3s ease, height 0.3s ease;
}

/* When playback bar is visible, push canvas down */
.playback-bar[style*="display: flex"] ~ canvas,
.playback-bar[style*="display: block"] ~ canvas {
  top: 170px; /* 50px header + 120px playback bar */
  height: calc(100vh - 190px); /* Adjusted height for playback bar */
}
.audio-level {
  display: flex;
  gap: 1px;
  margin: 0 10px;
}
.level-bar {
  width: 6px;
  height: 18px;
  display: inline-block;
  border: 1px solid #555;
}
.level-bar.low-off { background: #222; }
.level-bar.low-on { background: #0f0; }
.level-bar.mid-off { background: #222; }
.level-bar.mid-on { background: #ff0; }
.level-bar.high-off { background: #222; }
.level-bar.high-on { background: #f00; }
.tooltip {
  position: absolute;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 4px 6px;
  font-size: 12px;
  pointer-events: none;
  border-radius: 4px;
  z-index: 1002;
}

.playback-bar {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  height: 120px; /* Extended to include waveform container */
  background: rgba(17, 34, 34, 0.95);
  border-top: 1px solid #444;
  border-bottom: 1px solid #444;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  z-index: 999;
}

.playback-top-row {
  display: flex;
  align-items: center;
  padding: 0 10px;
  height: 40px;
  gap: 15px;
}

.playback-bar .playback-controls {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.playback-btn {
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  transition: background-color 0.2s;
}

.playback-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.playback-btn .lucide-icon {
  width: 16px;
  height: 16px;
  stroke: #fff;
  stroke-width: 2;
}

.progress-time {
  font-size: 11px;
  color: #ccc;
  min-width: 80px;
  flex-shrink: 0;
}

.playback-bar .playback-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #ccc;
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.playback-bar .playback-info span {
  padding-right: 10px;
}

.playback-bar .playback-info button {
  background: transparent;
  color: #fff;
  border: none;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  min-width: 25px;
  transition: background-color 0.2s;
}

.playback-bar .playback-info button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.waveform-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(17, 34, 34, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px 10px 5px;
  box-sizing: border-box;
}

.waveform-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.waveform-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111;
  border-radius: 4px;
  border: 1px solid #333;
  cursor: ew-resize !important; /* Override crosshair from main canvas */
}

.playback-line {
  position: absolute;
  top: 2px;
  bottom: 0;
  left: var(--playback-position, 0%);
  width: 2px;
  background: white;
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(255, 255, 0, 0.5);
  pointer-events: none;
  z-index: 10;
  transition: left 0.1s ease;
  /* Ensure it's visible and positioned correctly */
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Recording button spinning animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.recording-spin {
  animation: spin 1s linear infinite;
}
