/* © DJFuturo Tools. Todos los derechos reservados. */
/* === METRÓNOMO V2 === */

/* === BASE === */
.djf-metro-v2e {
  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-metro-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.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-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%;
}

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

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

/* === DISPLAY BPM === */
.djf-metro-bpm-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.djf-metro-bpm-display {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: 480px;
}

.djf-metro-bpm-display #djf-metro-bpm-input {
  justify-self: center;
  grid-column: 2;
}

.djf-metro-bpm-display .djf-bpm-right {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 3;
}


#djf-metro-bpm-input.djf-bpm-editable {
  font-size: 80px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #1a1a1a;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border: none !important;
  background: transparent !important;
  outline: none;
  font-family: inherit;
  cursor: pointer;
  padding: 0 !important;
  margin: 0;
  width: 3ch;
  box-shadow: none !important;
  border-radius: 0 !important;
}


#djf-metro-bpm-input.djf-bpm-editable:focus {
  color: #e0a800;
  cursor: text;
}

.djf-bpm-unit {
  font-size: 16px;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.djf-metro-tempo-name {
  font-size: 13px;
  font-weight: 500;
  color: #888;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 18px;
  transition: color 0.3s ease;
}

/* === FLECHAS BPM === */
.djf-bpm-arrows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.djf-bpm-arrow {
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.2;
  border-radius: 4px;
  border: 1px solid #d0d0d0;
  background: linear-gradient(180deg, #ffffff, #f8f9fa);
  cursor: pointer;
  color: #555;
  transition: all 0.1s ease;
  font-family: inherit;
}

.djf-bpm-arrow:hover {
  background: linear-gradient(180deg, #ffd95a, #f8c040);
  border-color: #e0a800;
  color: #1a1a1a;
}

.djf-bpm-arrow:active {
  transform: scale(0.94);
}

/* === SLIDER BPM === */
.djf-metro-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}

.djf-metro-slider-row span {
  font-size: 12px;
  color: #999;
  font-weight: 500;
  min-width: 28px;
}

.djf-metro-slider-row span:last-child {
  text-align: right;
}

input[type="range"].djf-bpm-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e0e0e0;
  outline: none;
  cursor: pointer;
}

input[type="range"].djf-bpm-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd95a 0%, #f8c040 100%);
  border: 2px solid #e0a800;
  box-shadow:
    0 2px 6px rgba(248, 208, 88, 0.5),
    0 0 0 3px rgba(248, 208, 88, 0.2);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

input[type="range"].djf-bpm-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow:
    0 3px 10px rgba(248, 208, 88, 0.6),
    0 0 0 4px rgba(248, 208, 88, 0.25);
}

input[type="range"].djf-bpm-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd95a 0%, #f8c040 100%);
  border: 2px solid #e0a800;
  box-shadow: 0 2px 6px rgba(248, 208, 88, 0.5);
  cursor: pointer;
}

input[type="range"].djf-bpm-slider:focus {
  outline: none;
}

/* === BEATS / INDICADORES === */
.djf-metro-beats-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.djf-metro-beats-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.djf-beat-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f0f0f0;
  border: 2px solid #ccc;
  box-shadow: none;
  transition:
    background 0.05s ease,
    border-color 0.05s ease,
    box-shadow 0.05s ease,
    transform 0.05s ease;
  flex-shrink: 0;
}

.djf-beat-dot.beat-active {
  background: radial-gradient(circle at 35% 35%, #ffe680, #f8d058 60%, #e8b800);
  border-color: #e0a800;
  border-width: 2px;
  box-shadow:
    0 0 0 3px rgba(248, 208, 88, 0.4),
    0 0 14px rgba(248, 208, 88, 0.6),
    0 0 28px rgba(248, 208, 88, 0.25);
  transform: scale(1.12);
}

.djf-beat-dot.beat-accent {
  width: 54px;
  height: 54px;
  border-color: #bbb;
  background: #e8e8e8;
}

.djf-beat-dot.beat-accent.beat-active {
  background: radial-gradient(circle at 35% 35%, #ffe680, #f8d058 60%, #e8b800);
  border-color: #e0a800;
  box-shadow:
    0 0 0 4px rgba(248, 208, 88, 0.5),
    0 0 20px rgba(248, 208, 88, 0.7),
    0 0 40px rgba(248, 208, 88, 0.3);
  transform: scale(1.18);
}

/* === CANTIDAD DE BEATS === */
.djf-metro-beats-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.djf-beats-count-display {
  font-size: 14px;
  font-weight: 600;
  color: #444;
  min-width: 60px;
  text-align: center;
}

/* === BOTONES BASE === */
.djf-btn {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #d0d0d0;
  background: linear-gradient(180deg, #ffffff, #f8f9fa);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  transition: all 0.15s ease;
  font-family: inherit;
}

.djf-btn:hover {
  background: linear-gradient(180deg, #fafbfc, #f1f3f5);
  border-color: #bbb;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 2px 4px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.djf-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15) inset;
  background: linear-gradient(180deg, #f1f3f5, #e9ecef);
}

.djf-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #999;
  box-shadow: none;
  transform: none;
}

.djf-btn-sm {
  padding: 5px 10px;
  min-width: 32px;
  font-size: 12px;
}

/* === BOTÓN START === */
.djf-btn-start {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 50% !important;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e0a800;
  background: linear-gradient(180deg, #ffd95a 0%, #f8c040 100%);
  color: #1a1a1a;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 2px 6px rgba(248, 208, 88, 0.35);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.djf-btn-start:hover {
  background: linear-gradient(180deg, #ffe170, #f8cc50);
  border-color: #d09000;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 3px 10px rgba(248, 208, 88, 0.5);
}

.djf-btn-start.active {
  background: linear-gradient(180deg, #f8c040, #e8a800);
  border-color: #c08000;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.15) inset,
    0 0 0 3px rgba(248, 208, 88, 0.3);
}

/* === BOTÓN TAP === */
.djf-btn-tap {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50% !important;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.djf-btn-tap:active {
  transform: scale(0.94);
}

/* === FILA INFERIOR: TAP + START + VOLUMEN === */
.djf-metro-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  gap: 12px;
}

.djf-metro-bottom .djf-btn-tap {
  justify-self: end;
}

.djf-metro-bottom .djf-btn-start {
  justify-self: center;
}

.djf-metro-bottom .djf-metro-volume {
  justify-self: start;
}

/* === VOLUMEN === */
.djf-metro-volume {
  display: flex;
  align-items: center;
  gap: 10px;
}

.djf-metro-volume span {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

input[type="range"].djf-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 3px;
  border-radius: 2px;
  background: #e0e0e0;
  outline: none;
  cursor: pointer;
}

input[type="range"].djf-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd95a, #f8c040);
  border: 2px solid #e0a800;
  box-shadow: 0 1px 4px rgba(248, 208, 88, 0.4);
  cursor: pointer;
}

input[type="range"].djf-vol-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd95a, #f8c040);
  border: 2px solid #e0a800;
  cursor: pointer;
}

/* === SELECT === */
.djf-select {
  padding: 6px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #f8f9fa);
  border: 1px solid #d0d0d0;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: #333;
  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);
}

/* === TOGGLE === */
.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;
}

.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;
}

/* === PIE: ACENTO + COMPÁS === */
.djf-metro-footer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 4px;
  width: 100%;
}

.djf-metro-footer-controls label {
  font-size: 13px;
  color: #555;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === FEEDBACK === */
.djf-feedback {
  margin-top: 4px;
  font-size: 13px;
  color: #888;
  min-height: 18px;
  text-align: center;
}

/* === SUBDIVISIONES === */
.djf-metro-subdivisions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.djf-subdiv-label {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

.djf-subdiv-pills {
  display: flex;
  gap: 6px;
}

.djf-subdiv-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 20px;
  border: 2px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #555;
  font-family: inherit;
}

.djf-subdiv-pill svg {
  width: 36px;
  height: 27px;
}

.djf-subdiv-pill:hover {
  border-color: #bbb;
  background: #fafafa;
  color: #333;
}

.djf-subdiv-pill.active {
  border-color: #f8d058;
  background: rgba(248, 208, 88, 0.1);
  color: #1a1a1a;
  box-shadow:
    0 0 0 2px #f8d058,
    0 0 0 4px rgba(248, 208, 88, 0.15);
}

/* === ALAS LATERALES === */
.djf-metro-wings {
  position: relative;
  width: 100%;
  display: block;
}

.djf-metro-wings .djf-metro-body {
  width: 100%;
  box-sizing: border-box;
}

.djf-metro-wing {
  position: absolute;
  pointer-events: none;
  top: 0;
  height: 240px;
}

.djf-metro-wing .djf-shortcut-btn {
  position: absolute;
  pointer-events: all;
}

.djf-metro-wing.wing-left {
  right: auto;
  left: auto;
  display: flex;
  align-items: flex-end;
}

.djf-metro-wing.wing-right {
  left: auto;
  right: auto;
  display: flex;
  align-items: flex-end;
}

.djf-wing-svg {
  overflow: visible;
  pointer-events: none;
}

.djf-wing-btns {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.djf-wing-btns .djf-shortcut-btn {
  position: absolute;
  pointer-events: all;
}

/* Botones de atajo */
.djf-shortcut-btn {
  position: absolute;
  pointer-events: all;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  background: linear-gradient(180deg, #ffffff, #f3f6f9);
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transform: translate(-50%, -50%);
}

.djf-shortcut-btn:hover {
  border-color: #e0a800;
  background: linear-gradient(180deg, #fff9e6, #fff3cc);
  color: #1a1a1a;
  box-shadow:
    0 0 0 3px rgba(248, 208, 88, 0.2),
    0 2px 8px rgba(248, 208, 88, 0.3);
}

.djf-shortcut-btn:active {
  transform: translate(-50%, -50%) scale(0.94);
}

.djf-shortcut-btn.current-bpm {
  border-color: #f8d058;
  background: linear-gradient(180deg, #ffffff, #f3f6f9);
  color: #1a1a1a;
  box-shadow:
    0 0 0 2px #f8d058,
    0 0 0 4px rgba(248, 208, 88, 0.15);
}

/* Ocultar alas en móvil */
@media (max-width: 840px) {
  .djf-metro-wing {
    display: none;
  }
}

/* === RESPONSIVE === */

@media (max-width: 840px) {
  .djf-metro-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }
}

@media (max-width: 669px) {
  .djf-tool-title h1 {
    font-size: 16px;
  }

  .djf-tool-badge {
    width: 36px;
    height: 36px;
  }

  #djf-metro-bpm-input.djf-bpm-editable {
    font-size: 64px;
  }

  .djf-bpm-unit {
    font-size: 15px;
  }

  .djf-metro-body {
    padding: 20px 16px;
    gap: 22px;
  }

  .djf-beat-dot {
    width: 40px;
    height: 40px;
  }

  .djf-beat-dot.beat-accent {
    width: 46px;
    height: 46px;
  }

  .djf-btn-start {
    width: 68px;
    height: 68px;
    min-width: 68px;
  }

  .djf-btn-tap {
    width: 54px;
    height: 54px;
    min-width: 54px;
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  #djf-metro-bpm-input.djf-bpm-editable {
    font-size: 52px;
  }

  .djf-metro-body {
    padding: 16px 10px;
  }

  .djf-beat-dot {
    width: 34px;
    height: 34px;
  }

  .djf-beat-dot.beat-accent {
    width: 40px;
    height: 40px;
  }

  .djf-metro-beats-row {
    gap: 10px;
  }

  .djf-metro-bottom {
    gap: 14px;
  }
}

@media (max-width: 360px) {
  .djf-tool-badge {
    width: 32px;
    height: 32px;
  }

  .djf-tool-title h1 {
    font-size: 15px;
  }
}