/* © DJFuturo Tools. Todos los derechos reservados. */
/* === TAP BPM === */

/* === BASE === */
.djf-tapbpm {
  position: relative;
  width: 100%;
  max-width: none !important;
  margin: 18px auto;
  color: #222;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === HEADER === */
.djf-tapbpm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.djf-tool-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 2px 2px;
  background: linear-gradient(135deg, rgba(248, 208, 88, 0.5), transparent);
  border-radius: 30px;
}

.djf-tool-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

/* === CUERPO PRINCIPAL === */
.djf-tapbpm-body {
  background: linear-gradient(180deg, #fbfbfb, #f3f6f9);
  box-shadow: 0 6px 18px rgba(20,30,50,0.06);
  border-radius: 12px;
  padding: 0px 24px 33px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* === DISPLAY BPM === */
.djf-tapbpm-display {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
}

.djf-tapbpm-number-group {
  grid-column: 2;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.djf-tapbpm-bpm-unit-mobile {
  display: none;
}

.djf-tapbpm-display-right {
  grid-column: 3;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
}
.djf-tapbpm-bpm-number {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #1a1a1a;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  min-width: 3ch;
  text-align: center;
  transition: color 0.15s ease;
}

.djf-tapbpm-bpm-number:not(.has-value) {
  font-size: 36px;
  font-weight: 300;
  color: #ccc;
  letter-spacing: 0;
}

.djf-tapbpm-bpm-unit {
  font-size: 20px;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  align-self: flex-end;
  padding-bottom: 14px;
}

.djf-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

/* === TEMPO LABEL === */
.djf-tapbpm-tempo-name {
  font-size: 13px;
  font-weight: 500;
  color: #888;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 23px;
  text-align: center;
  transition: color 0.3s ease;
  margin-top: -30px;
}


/* === BOTÓN TAP === */
.djf-tapbpm-btn-tap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid #e0a800;
  background: linear-gradient(180deg, #fff9e5 0%, #f8c040 100%);
  color: #1a1a1a;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(248, 208, 88, 0.1), 0 0 0 10px rgba(248, 208, 88, 0.5), 0 0 0 19px rgba(248, 208, 88, 0.3), 0 0 0 22px rgba(248, 208, 88, 0.05);
  transition: box-shadow 0.1s ease, background 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.djf-tapbpm-btn-tap:hover {
  background: linear-gradient(210deg, #fff, #f8c040);
  box-shadow:
0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(248, 208, 88, 0.1), 0 0 0 6px rgba(248, 208, 88, 0.5), 0 0 0 12px rgba(248, 208, 88, 0.3), 0 0 0 19px rgba(248, 208, 88, 0.05);
}

.djf-tapbpm-btn-tap:active {
  transform: scale(0.94);
  background: linear-gradient(210deg, #fff, #f8c040);
  box-shadow:
0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(248, 208, 88, 0.1), 0 0 0 6px rgba(248, 208, 88, 0.5), 0 0 0 12px rgba(248, 208, 88, 0.3), 0 0 0 19px rgba(248, 208, 88, 0.05);
}


.djf-tapbpm-tap-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #999;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}

.djf-tapbpm-tap-count span:last-child {
  font-weight: 700;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.djf-tapbpm-feedback {
  font-size: 13px;
  color: #888;
  min-height: 18px;
  width: 100%;
  /* min-height: 34px; */
  text-align: center;
  width: 100%;
  margin-top: -7px;
}



/* === CONTROLES SECUNDARIOS === */
.djf-tapbpm-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
   margin-top: -7px;
}

.djf-tapbpm-control-item {
  font-size: 14px;
  color: #555;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
line-height: 1.3;
}

/* === TOGGLE (reutilizado del metrónomo) === */
.djf-toggle-label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  box-shadow: 0 2px 6px rgba(248,208,88,0.2);
}

.djf-toggle-label:hover {
  border-color: #bbb;
  background: #fafafa;
}

.djf-toggle-label.active {
  border: 2px solid #f8d058;
  box-shadow:
    0 0 0 2px #f8d058,
    0 0 0 4px rgba(248,208,88,0.15),
    0 2px 6px rgba(248,208,88,0.2);
}

.djf-toggle-label input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #f8d058;
}

/* === SELECT === */
.djf-select {
  padding: 6px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #f8f9fa);
  border: 1px solid #d0d0d0;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: #555;
  font-weight: 500;
  transition: all 0.15s ease;
}

.djf-select:hover  { border-color: #4a90e2; background: #fff; }
.djf-select:focus  {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74,144,226,0.1), 0 1px 3px rgba(0,0,0,0.08);
}

/* === RESET === */
.djf-tapbpm-btn-reset {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #d0d0d0;
  background: linear-gradient(180deg, #ffffff, #f1f3f5);
  font-size: 14px;
  font-weight: 500;
  color: #555;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 2px 6px rgba(248,208,88,0.35);
}

.djf-tapbpm-btn-reset:hover {
  border-color: #bbb;
  color: #222;
}

.djf-tapbpm-btn-reset:active {
  background: linear-gradient(180deg, #f1f3f5, #e9ecef);
}





/* === SOUND GROUP === */
.djf-tapbpm-sound-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Toggle tipo interruptor */
.djf-tapbpm-sound-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #d0d0d0;
  background: linear-gradient(180deg, #ffffff, #f1f3f5);
  transition: all 0.2s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 2px 6px rgba(248,208,88,0.35);
}

.djf-tapbpm-sound-toggle.active {
  border-color: #f8d058;
  box-shadow: 0 0 0 2px #f8d058, 0 0 0 4px rgba(248,208,88,0.15), 0 2px 6px rgba(248,208,88,0.2);
}

.djf-sound-icon {
  font-size: 15px;
  color: #888;
  line-height: 1;
}

.djf-sound-text {
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

/* Switch track + thumb */
.djf-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.djf-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.djf-switch-track {
  display: block;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #ddd;
  position: relative;
  transition: background 0.25s ease;
}

.djf-switch input:checked + .djf-switch-track {
  background: #f8d058;
}

.djf-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.25s ease;
}

.djf-switch input:checked + .djf-switch-track .djf-switch-thumb {
  transform: translateX(16px);
}

/* Mini panel de acento */
.djf-tapbpm-accent-panel {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 2px;
  background: rgba(248, 208, 88, 0.08);
  border-radius: 0 0 12px 12px;
  border: 1px solid rgba(248, 208, 88, 0.25);
  border-top: none;
  white-space: nowrap;
  z-index: 10;
}

.djf-tapbpm-accent-panel.visible {
  display: flex;
}


.djf-tapbpm-accent-pill {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid #d0d0d0;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.djf-tapbpm-accent-pill:hover {
  border-color: #bbb;
  color: #444;
}

.djf-tapbpm-accent-pill.active {
  border-color: #f8d058;
  color: #444;
  background: #fff;
  box-shadow: 0 0 0 2px #f8d058, 0 0 0 4px rgba(248,208,88,0.15), 0 2px 6px rgba(248,208,88,0.2);
}


/* === DOTS VISUAL === */
.djf-tapbpm-dots-wrap {
  position: relative;
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.djf-tapbpm-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.djf-tap-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f8d058;
  border: 1px solid #e0a800;
  flex-shrink: 0;
}

.djf-tap-dot.accent {
  width: 22px;
  height: 22px;
  border-color: #c88000;
}

.djf-tap-dot.current {
  box-shadow:
    0 0 0 3px rgba(248, 208, 88, 0.35),
    0 0 10px rgba(248, 208, 88, 0.5);
  animation: dotPop 0.2s ease-out forwards;
}

.djf-tap-dot.accent.current {
  box-shadow:
    0 0 0 4px rgba(248, 208, 88, 0.45),
    0 0 16px rgba(248, 208, 88, 0.6);
  animation: dotPopAccent 0.2s ease-out forwards;
}

@keyframes dotPop {
  0%   { transform: scale(1.4); }
  100% { transform: scale(1); }
}

@keyframes dotPopAccent {
  0%   { transform: scale(1.6); }
  100% { transform: scale(1); }
}

/* Separador entre compases */
.djf-tap-sep {
  width: 10px;
  flex-shrink: 0;
}

/* === BADGE === */
.djf-tool-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd95a 0%, #f8c040 100%);
  border: 2px solid #f0b830;
  box-shadow:
    0 2px 8px rgba(248, 208, 88, 0.25),
    0 0 0 3px rgba(248, 208, 88, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.djf-tool-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* === COPIAR BPM === */
.djf-tapbpm-copy-btn {
  position: relative;
  align-self: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  border: 1.5px solid #c8c8c8;
  background: #fff;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.djf-copy-default {
  display: flex;
  align-items: center;
  gap: 5px;
}

.djf-copy-done {
  display: none;
}

.djf-tapbpm-copy-btn.copied .djf-copy-default {
  display: none;
}

.djf-tapbpm-copy-btn.copied .djf-copy-done {
  display: flex;
}

.djf-tapbpm-copy-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.djf-tapbpm-copy-btn:not(:disabled):hover {
  border-color: #e0a800;
  color: #e0a800;
  background: rgba(248, 208, 88, 0.08);
}

.djf-tapbpm-copy-btn.copied {
  border-color: #4caf50;
  color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}

.djf-tapbpm-copy-btn:disabled ~ .djf-tapbpm-display-spacer,
.djf-tapbpm-copy-btn:disabled {
  /* cuando está deshabilitado el espaciador sigue activo para mantener centro */
}

/* === TAP WRAP + ONDA === */
.djf-tapbpm-tap-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.djf-tapbpm-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  pointer-events: none;
}

.djf-tapbpm-btn-tap.tap-pulse {
  transform: scale(0.94);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.15) inset,
    0 0 0 4px rgba(248,208,88,0.3);
  background: linear-gradient(180deg, #f8c040, #e8a800);
}

/* === DISPLAY WRAP + INTRO === */
.djf-tapbpm-display-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px; /* altura fija = altura del número BPM */
}

.djf-tapbpm-intro {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
    padding-top: 25px !important;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  color: #555;
  text-align: center;
  line-height: 1.4;
  padding: 0 16px;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
}

.djf-intro-note {
  font-style: italic;
  color: #555;
  font-size: 32px;
  margin-left: 4px;
  vertical-align: middle;
}

.djf-tapbpm-intro.hidden {
  opacity: 0;
  pointer-events: none;
}

.djf-tapbpm-display {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.djf-tapbpm-display.visible {
  opacity: 1;
}

.djf-tapbpm-accent-pill input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 14px;
  height: 14px;
  accent-color: #f8d058;
  flex-shrink: 0;
}

.djf-tapbpm-accent-pill {
  display: flex;
  align-items: center;
  gap: 6px;
}


/* === BOTÓN METRÓNOMO === */
.djf-tapbpm-metro-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  border: 1.5px solid #c8c8c8;
  background: #fff;
  color: #888;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  pointer-events: none;
  opacity: 0.3;
}

.djf-tapbpm-metro-btn.active {
  pointer-events: all;
  opacity: 1;
  color: #888;
}

.djf-tapbpm-metro-btn.active:hover {
  border-color: #e0a800;
  color: #e0a800;
  background: rgba(248,208,88,0.08);
}

#djfuturo-tapbpm .djf-btn-stack .djf-tapbpm-copy-btn,
#djfuturo-tapbpm .djf-btn-stack .djf-tapbpm-metro-btn {
  margin-right: auto;
}


.djf-line-break {
  flex-basis: 100%;
  height: 0;
  width: 0;
}


.djf-metro-label-short {
  display: none;
}


/* === RESPONSIVE === */

/* 1. Pantallas medianas/móviles grandes */
@media (max-width: 669px) {
  .djf-tapbpm-bpm-number { font-size: 58px; }

  .djf-tapbpm-bpm-unit {
    font-size: 16px;
    padding-bottom: 10px;
  }

  .djf-intro-note {
    font-size: 28px !important;
    vertical-align: baseline !important;
  }

  /*  
  .djf-tapbpm-btn-tap {
    width: 100px;
    height: 100px;
    font-size: 19px;
  } 
  .djf-tapbpm-body { padding: 24px 16px 22px; } 
  */
}

/* 2. Ajuste para rango intermedio */
@media (max-width: 640px) {
  .djf-tapbpm-intro {
    padding-top: 11px !important;
  }
}


@media (max-width: 630px) {
  .djf-tapbpm-display {
    grid-template-columns: 1fr auto 1fr;
  }

  .djf-tapbpm-display-right {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

.djf-tapbpm-bpm-unit {
    display: none;
  }

  .djf-tapbpm-bpm-unit-mobile {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: -4px;
  }

.djf-metro-label-full {
    display: none;
  }

  .djf-metro-label-short {
    display: inline;
  }

  }

@media (max-width: 510px) {
  .djf-tapbpm-controls {
    display: grid;
    grid-template-columns: max-content max-content;
    grid-template-rows: auto auto;   
    justify-content: center; 
    justify-items: center; 
    row-gap: 10px;
    column-gap: 15px;
  }

  .djf-tapbpm-tap-count {
    grid-column: 1;
    grid-row: 1;
  }

  .djf-tapbpm-time-sig-wrap,
  #djf-tapbpm-time-sig {
    grid-column: 2;
    grid-row: 1;
  }

  .djf-tapbpm-sound-group {
    grid-column: 1;
    grid-row: 2;
  }

  .djf-tapbpm-btn-reset {
    grid-column: 2;
    grid-row: 2;
  }
}


/* 3. Pantallas pequeñas */
@media (max-width: 400px) {
  .djf-tapbpm-intro {
    font-size: 20px !important;
  }

  .djf-tapbpm-bpm-number { font-size: 48px; }

  .djf-tapbpm-controls { gap: 10px; }

  /*  
  .djf-tapbpm-btn-tap {
    width: 88px;
    height: 88px;
    font-size: 17px;
  }
  */

   .djf-tapbpm-body { padding: 0px 1px 33px; gap: 18px; } 
  .djf-copy-label-full {font-size: 10px;}
  .djf-tapbpm-metro-btn {font-size: 10px;}


}

/* 4. Pantallas muy pequeñas (Ajustado el h1 y corregido el bpm-number) */
@media (max-width: 360px) {
  .djf-tapbpm-info-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  .djf-info-sep {
    display: none;
  }

  .djf-tapbpm-feedback {
    width: 100%;
    flex: none;
    text-align: left;
  }

  .djf-tapbpm-intro {
    font-size: 17px !important;
  }

  .djf-intro-note {
    font-size: 18px !important;
  }

  .djf-tool-title h1 { font-size: 19px; }
  
  /* Corregido de 52px a 44px para mantener la proporción decreciente */
  .djf-tapbpm-bpm-number { font-size: 44px; } 

  .djf-tapbpm-accent-panel {
    left: 0;
    transform: none;
  }

}

