/*
 * TMN Radio Visualizer Stylesheet
 *
 * Provides a dark, neon aesthetic to complement the psychedelic
 * visualisations. The design emphasises accessibility with high contrast
 * controls and intuitive layout. Media queries ensure mobile responsiveness.
 */

.tmn-rv-container {
  position: relative;
  background: linear-gradient(180deg, #0a1f44, #120a3f);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
  margin: 1rem 0;
  font-family: sans-serif;
  color: #fff;
}

.tmn-rv-player-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
}

.tmn-rv-player-wrapper audio {
  width: 100%;
  height: 40px;
  outline: none;
  background-color: #020A1D;
  color: #23ffe9;
}

.tmn-rv-canvas-wrapper {
  position: relative;
  width: 100%;
  /* Increase the default height to give the visuals more breathing room */
  height: 600px;
}

.tmn-rv-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.tmn-rv-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 5;
}

.tmn-rv-message {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  text-align: center;
  padding: 1rem;
  font-size: 1.1rem;
  background: rgba(0, 0, 0, 0.4);
  color: #23ffe9;
}

/* Now Playing section shown at the top of the overlay. */
.tmn-rv-song-info {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto;
  color: #fff;
  font-size: 1rem;
  z-index: 6;
}

.tmn-rv-song-info .tmn-rv-artwork {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.tmn-rv-song-info .tmn-rv-song-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tmn-rv-song-info .tmn-rv-song-title {
  font-weight: bold;
  color: #FFD600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tmn-rv-song-info .tmn-rv-song-artist {
  font-size: 0.8rem;
  color: #23ffe9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tmn-rv-controls {
  pointer-events: auto;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.5rem;
  flex-wrap: wrap;
}

.tmn-rv-controls button {
  cursor: pointer;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-weight: bold;
  background: linear-gradient(45deg, #23ffe9, #FFD600);
  color: #0a1f44;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  font-size: 0.9rem;
  pointer-events: auto;
}

.tmn-rv-controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

/* Settings button uses same style as other controls */
.tmn-rv-settings-btn {
}

/* Settings panel styles */
.tmn-rv-settings-panel {
  pointer-events: auto;
  position: absolute;
  /* Position the settings panel above the control buttons so it doesn’t obscure them */
  bottom: 3rem;
  right: 0;
  background: rgba(2, 10, 40, 0.9);
  border-top-left-radius: 6px;
  padding: 0.5rem;
  color: #fff;
  font-size: 0.85rem;
  z-index: 10;
  width: 260px;
  max-width: 100%;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.tmn-rv-settings-panel label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: bold;
  color: #23ffe9;
}

.tmn-rv-setting {
  margin-bottom: 0.6rem;
  display: flex;
  flex-direction: column;
}

.tmn-rv-setting select,
.tmn-rv-setting input[type="range"] {
  width: 100%;
  margin-top: 0.1rem;
  background-color: #0a1f44;
  border: 1px solid #23ffe9;
  border-radius: 4px;
  color: #FFD600;
  height: 28px;
  -webkit-appearance: none;
  appearance: none;
}

.tmn-rv-setting input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFD600;
  cursor: pointer;
  border: 2px solid #23ffe9;
}

.tmn-rv-setting input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFD600;
  cursor: pointer;
  border: 2px solid #23ffe9;
}

/* Logos positioning at the bottom left of the overlay */
.tmn-rv-logos {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  display: flex;
  gap: 0.5rem;
  pointer-events: none;
  z-index: 5;
}

.tmn-rv-logos img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.tmn-rv-logos img:hover {
  opacity: 1;
}

/* Bottom notice styling: appears beneath the canvas. The text glows subtly to
 * match the bioluminescent TMN aesthetic. Links are underlined and coloured.
 */
.tmn-rv-bottom-notice {
  padding: 0.5rem 1rem;
  background: rgba(2, 10, 40, 0.8);
  color: #23ffe9;
  font-size: 0.9rem;
  text-align: center;
  pointer-events: auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.4) inset;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-shadow: 0 0 6px rgba(35,255,233,0.6);
}

.tmn-rv-bottom-notice a {
  color: #FFD600;
  text-decoration: underline;
}

/* Fullscreen adjustments */
:fullscreen .tmn-rv-container,
.tmn-rv-container:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

/* Ensure canvas wrapper expands to full height when in fullscreen */
:fullscreen .tmn-rv-canvas-wrapper,
.tmn-rv-container:fullscreen .tmn-rv-canvas-wrapper {
  height: 100%;
}

@media (max-width: 600px) {
  .tmn-rv-canvas-wrapper {
    height: 350px;
  }
  .tmn-rv-controls button {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
}