/*
  Estilos para o controlador de áudio móvel.
  Esta folha foca em usabilidade simples com um visual limpo e agradável.
*/

/* Variáveis de cores para cada faixa (padrões inspirados na imagem de exemplo) */
:root {
  --color-track-1: #e74c3c;
  /* vermelho vivo */
  --color-track-2: #c0392b;
  /* vermelho escuro */
  --color-track-3: #3498db;
  /* azul claro */
  --color-track-4: #9b59b6;
  /* roxo */
  --color-track-5: #f1c40f;
  /* amarelo */
  --color-track-6: #e67e22;
  /* laranja */
  --color-track-7: #16a085;
  /* verde aquático */
  --color-active-note: #1abc9c;
  /* verde para nota ativa */
  --color-note-bg: #00000021;
  /* fundo claro para botões de nota */
  --color-note-text: #2c3e50;
  /* texto escuro para botões de nota */
  --color-background: #fafafa;
  /* fundo geral */
  --color-header-bg: #2c3e50;
  /* fundo do cabeçalho */
  --color-header-text: #ecf0f1;
  /* texto do cabeçalho */
  --color-footer-text: #7f8c8d;
  /* texto do rodapé */
}

/* Reset básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  background-color: var(--color-background);
  color: var(--color-note-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
}

header {
  background-color: var(--color-header-bg);
  color: var(--color-header-text);
  padding: 1rem;
  text-align: center;
}

header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

header p {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Seletor de notas (botões) */
.note-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem;
  background-color: var(--color-note-bg);
  max-width: 100%;
}

.note-selector button {
  flex: 0 0 auto;
  padding: 1rem 0.5rem;
  border: none;
  border-radius: 0.75rem;
  background-color: var(--color-note-bg);
  color: var(--color-note-text);
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 3.5rem;
  width: 100%;
}

.note-selector button.active {
  background-color: var(--color-active-note);
  color: #fff;
}

.note-selector button:hover {
  background-color: var(--color-active-note);
  color: #fff;
}

/* Seção de instruções */
.instructions {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.instructions h3 {
  color: #2c3e50;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
}

.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem;
  background-color: white;
  border-radius: 0.5rem;
  border-left: 4px solid var(--color-active-note);
}

.step-number {
  background-color: var(--color-active-note);
  color: white;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.step p {
  margin: 0;
  color: #495057;
  font-size: 0.95rem;
  line-height: 1.4;
  flex: 1;
}

/* Container de faixas */
.tracks-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.5rem;
  overflow-y: auto;
}

/* Cada faixa individual */
.track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  border-radius: 0.75rem;
  color: #fff;
}

.track .info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.track .info .name {
  font-size: 0.9rem;
  font-weight: bold;
}

.track .info .status {
  font-size: 0.75rem;
  opacity: 0.8;
}

.track button.play-btn {
  margin-right: 0.5rem;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.track button.play-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.track .volume {
  flex: 0 0 40%;
}

.track input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.4);
  outline: none;
  cursor: pointer;
}

.track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.1);
}

.track input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

footer {
  padding: 0.5rem 1rem;
  background-color: var(--color-note-bg);
  font-size: 0.75rem;
  color: var(--color-footer-text);
}

footer .disclaimer {
  text-align: center;
  line-height: 1.4;
}

.global-controls {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0;
}

#fade-out-btn {
  width: 96%;
  height: 43px;
  margin-top: 20px;
  margin-bottom: 20px;
  font-size: 1.1rem;
  background-color: var(--color-active-note);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}

/* overlay */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: #1E1E2E;
  /* cor escura do header */
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  font-family: sans-serif;
}

#loading-overlay .loader {
  font-size: 1.1rem;
}

.play-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}