/* UpliftAI TTS Player Styles - Ultra-Minimal Spotify-Inspired Design (Version 1.1.4) */
#upliftai-tts-container {
  max-width: 260px; /* Ultra-compact width */
  margin: 10px auto; /* Minimal vertical margin, centered */
  padding: 8px; /* Minimal padding */
  background: #181818; /* Spotify dark background */
  border-radius: 6px; /* Tighter rounded corners */
  border: 1px solid #282828; /* Subtle border */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1); /* Minimal shadow */
  box-sizing: border-box;
  overflow: hidden;
  color: #ffffff; /* White text/icons */
}

#upliftai-tts-player {
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.tts-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px; /* Tighter spacing */
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tts-btn {
  background: #282828; /* Dark button background */
  color: #ffffff; /* White icons */
  border: none;
  padding: 0; /* No padding, rely on button size */
  border-radius: 50%; /* Circular buttons */
  cursor: pointer;
  font-size: 13px; /* Smaller icons */
  transition: all 0.15s ease; /* Fast transitions */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; /* Compact button size */
  height: 36px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.tts-btn:hover {
  background: #1DB954; /* Spotify green on hover */
  transform: scale(1.1); /* Subtle scale effect */
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tts-btn:active {
  transform: scale(1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

#tts-play-pause {
  width: 40px; /* Slightly larger play button */
  height: 40px;
  background: #1DB954; /* Green for play */
}

#tts-play-pause:hover {
  background: #1ed760; /* Lighter green on hover */
}

.tts-generate-btn {
  background: #1DB954; /* Green for generate */
  border-radius: 18px; /* Slightly oval for distinction */
  width: 48px; /* Wider to stand out */
  height: 32px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.tts-generate-btn:hover {
  background: #1ed760;
  transform: scale(1.1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tts-speed {
  padding: 6px 10px;
  border: 1px solid #404040;
  border-radius: 5px;
  background: #282828;
  font-size: 12px; /* Smaller select */
  cursor: pointer;
  appearance: none;
  color: #ffffff;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%20197.3l-11.8-11.8a28.4%2028.4%200%2000-40.4%200l-69%2069-69-69a28.4%2028.4%200%2000-40.4%200L5.4%20197.3a28.4%2028.4%200%20000%2040.4l112%20112a28.4%2028.4%200%200040.4%200l112-112a28.4%2028.4%200%20000-40.4z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 8px;
  padding-right: 22px;
  min-width: 60px;
}

.tts-speed:focus {
  outline: none;
  border-color: #1DB954;
  box-shadow: 0 0 0 2px rgba(29,185,84,0.25);
}

.tts-progress-container {
  margin-bottom: 6px;
}

.tts-progress-bar {
  width: 100%;
  height: 3px; /* Very thin progress bar */
  background: #404040;
  border-radius: 1.5px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tts-progress-bar:hover {
  background: #535353;
}

.tts-progress {
  height: 100%;
  background: #1DB954; /* Spotify green */
  border-radius: 1.5px;
  transition: width 0.1s linear;
  position: relative;
}

.tts-progress::after {
  content: '';
  position: absolute;
  right: -3px;
  top: -3px;
  width: 9px; /* Tiny handle */
  height: 9px;
  background: #1DB954;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #181818, 0 1px 3px rgba(0,0,0,0.2);
  transition: all 0.1s ease;
}

.tts-progress-bar:hover .tts-progress::after {
  transform: scale(1.3);
}

.tts-time {
  display: flex;
  justify-content: space-between;
  font-size: 11px; /* Tiny time text */
  color: #b3b3b3;
  font-weight: 400;
}

#tts-loading {
  text-align: center;
  padding: 8px;
  color: #b3b3b3;
  font-size: 12px;
}

#tts-loading p {
  margin: 0;
  font-style: normal;
}

.tts-error {
  margin-top: 6px;
}

.tts-error p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #ffffff;
  background: #d32f2f;
  padding: 6px;
  border-radius: 5px;
  border: 1px solid #b71c1c;
  font-weight: 500;
}

/* Loading animation */
#tts-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid #404040;
  border-top: 1.5px solid #1DB954;
  border-radius: 50%;
  animation: tts-spin 0.5s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes tts-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 600px) {
  #upliftai-tts-container {
    max-width: 240px; /* Even smaller on mobile */
    padding: 6px;
    margin: 8px auto;
  }

  .tts-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .tts-btn {
    width: 100%;
    height: 36px;
    border-radius: 5px; /* Less circular on mobile */
    font-size: 12px;
  }

  #tts-play-pause {
    width: 100%;
    height: 38px;
  }

  .tts-generate-btn {
    width: 100%;
    height: 32px;
    border-radius: 16px;
  }

  .tts-speed {
    width: 100%;
    height: 36px;
    padding: 6px 10px;
    font-size: 12px;
    background-position: right 10px center;
  }

  .tts-progress-bar {
    height: 2.5px; /* Thinner on mobile */
  }

  .tts-progress::after {
    width: 8px;
    height: 8px;
    right: -2.5px;
    top: -2.5px;
  }

  .tts-time {
    font-size: 10px;
  }

  #tts-loading {
    padding: 6px;
    font-size: 11px;
  }

  .tts-error p {
    padding: 5px;
    font-size: 11px;
  }
}

/* Light mode support */
@media (prefers-color-scheme: light) {
  #upliftai-tts-container {
    background: #ffffff;
    border-color: #e0e0e0;
    color: #121212;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  }

  .tts-btn {
    background: #e0e0e0;
    color: #121212;
  }

  .tts-btn:hover {
    background: #1DB954;
    color: #ffffff;
  }

  #tts-play-pause, .tts-generate-btn {
    background: #1DB954;
  }

  #tts-play-pause:hover, .tts-generate-btn:hover {
    background: #1ed760;
  }

  .tts-speed {
    background: #ffffff;
    border-color: #e0e0e0;
    color: #121212;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23121212%22%20d%3D%22M287%20197.3l-11.8-11.8a28.4%2028.4%200%2000-40.4%200l-69%2069-69-69a28.4%2028.4%200%2000-40.4%200L5.4%20197.3a28.4%2028.4%200%20000%2040.4l112%20112a28.4%2028.4%200%200040.4%200l112-112a28.4%2028.4%200%20000-40.4z%22%2F%3E%3C%2Fsvg%3E');
  }

  .tts-speed:focus {
    border-color: #1DB954;
    box-shadow: 0 0 0 2px rgba(29,185,84,0.25);
  }

  .tts-progress-bar {
    background: #e0e0e0;
  }

  .tts-progress {
    background: #1DB954;
  }

  .tts-progress::after {
    box-shadow: 0 0 0 1.5px #ffffff, 0 1px 3px rgba(0,0,0,0.2);
  }

  .tts-time {
    color: #666666;
  }

  #tts-loading::before {
    border-color: #e0e0e0;
    border-top-color: #1DB954;
  }

  .tts-error p {
    color: #ffffff;
    background: #d32f2f;
    border-color: #b71c1c;
  }
}