/* ============================================
   POMODORO – ESTILOS ESPECÍFICOS
============================================ */

/* Container principal */
.tool-pomodoro {}

/* Timer display */
.tool-pomodoro-timer {
  font-size: 3rem;
  font-weight: 600;
}

/* Status (Foco/Pausa) */
.tool-pomodoro-status {
  opacity: 0.7;
  margin-top: 0.5rem;
}

/* Controles do timer (Iniciar/Pausar, Reset) */
.tool-pomodoro-controls {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.5rem;
}

/* ============================================
   FOOTER DO CARD
============================================ */

.tool-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ============================================
   CONTROLE DE ÁUDIO – DISCRETO E CONTEXTUAL
============================================ */

/* Footer do áudio "adormecido" */
.pomodoro-audio-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  opacity: 0.35;
  transition: opacity 0.25s ease;
}

/* Quando o usuário interage com o Pomodoro */
.tool-pomodoro:hover .pomodoro-audio-footer,
.tool-pomodoro:focus-within .pomodoro-audio-footer {
  opacity: 1;
}

/* ============================================
   BOTÃO TOGGLE DE SOM
============================================ */

#toggleSound {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;

  opacity: 0.7;
  transition: all 0.2s ease;
}

#toggleSound:hover,
#toggleSound:focus-visible {
  opacity: 1;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-color: var(--primary);
}

#toggleSound.active {
  opacity: 1;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

#toggleSound:active {
  transform: scale(0.95);
}

/* ============================================
   SELECT DE SOM
============================================ */

#soundSelect {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  min-width: 120px;

  opacity: 0.7;
  transition: all 0.2s ease;
}

#soundSelect:hover:not(:disabled),
#soundSelect:focus-visible {
  opacity: 1;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-color: var(--primary);
}

#soundSelect:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}

#soundSelect:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
}

/* ============================================
   BOTÃO TESTAR SOM
============================================ */

#testSound {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  min-width: 36px;

  opacity: 0.7;
  transition: all 0.2s ease;
}

#testSound:hover:not(:disabled),
#testSound:focus-visible {
  opacity: 1;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-color: var(--primary);
}

#testSound.playing {
  opacity: 1;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  animation: pulse-pomodoro 0.3s ease;
}

#testSound:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#testSound:active:not(:disabled) {
  transform: scale(0.95);
}

/* ============================================
   ANIMAÇÃO
============================================ */

@keyframes pulse-pomodoro {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ============================================
   RESPONSIVO
============================================ */

@media (max-width: 640px) {
  .tool-pomodoro-timer {
    font-size: 2.5rem;
  }

  .tool-footer {
    margin-top: 24px;
    padding-top: 18px;
  }

  .pomodoro-audio-footer {
    flex-wrap: wrap;
    gap: 6px;
    opacity: 1; /* mobile não usa hover */
  }

  #soundSelect {
    flex: 1;
    min-width: 110px;
  }
}

@media (max-width: 480px) {
  .tool-pomodoro-timer {
    font-size: 2rem;
  }

  .tool-pomodoro-controls {
    flex-direction: column;
    width: 100%;
  }

  .tool-pomodoro-controls button {
    width: 100%;
  }

  .tool-footer {
    margin-top: 20px;
    padding-top: 16px;
  }

  .pomodoro-audio-footer {
    flex-direction: column;
    width: 100%;
  }

  #toggleSound,
  #soundSelect,
  #testSound {
    width: 100%;
    opacity: 1;
  }
}