/* © DJFuturo Tools. Todos los derechos reservados. */
/* === BASE === */
.djf-organo-v4min {
  position: relative;  
  width: 100%;
  max-width: none !important;
  margin: 18px auto;
  color:#222;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.djf-organo-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:19px;
}
.djf-organo-header h1 {
  margin:0;
  font-size:18px;
}
.djf-organo-controls {
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap: wrap;
}
.djf-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  position: relative;
}
/* Separador solo después de sustain y nomenclatura */
.djf-control-group.has-separator::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  width: 1px;
  background: linear-gradient(180deg, transparent, #ddd 20%, #ddd 80%, transparent);
}
/* Primer grupo sin padding izquierdo */
.djf-control-group:first-child {
  padding-left: 0;
}
/* === BOTONES GENERALES === */
.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:disabled:hover {
  transform: none;
  box-shadow: none;
}
/* === REVERB TOGGLE === */
.djf-reverb-toggle {
  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;
}
.djf-reverb-toggle:hover {
  border-color: #bbb;
  background: #fafafa;
}
/* Estado activo con borde amarillo más grueso */
.djf-reverb-toggle.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-reverb-toggle input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #f8d058;
}
.djf-reverb-toggle span {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.djf-organo-container {
  user-select: none;
  touch-action: manipulation;
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #fbfbfb, #f3f6f9);
  box-shadow: 0 6px 18px rgba(20,30,50,0.06);
  display: flex;
}
/* Fila interna: transform por JS (M1) */
.djfo-row {
  display: flex;
  position: relative;
  align-items: flex-end;
  padding: 6px 0;
  width: max-content;
  transform-origin: left center;
  transition: transform 0.25s ease;
}
/* Glow botones: 3 o 2 px según intensidad */
.djf-reverb-toggle, .djf-select, .djf-btn {
  box-shadow: 0 0 0 3px rgba(248, 208, 88, 0.27);
}
/* === Parte 2 === */
/* === TECLAS === */

.djf-organ-key {
  position:relative;
  box-sizing:border-box;
  border:1px solid #d6d6d6;
  background: linear-gradient(180deg, #fdf6e3 0%, #fffaef 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 2px 4px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  height:160px;
  width:44px;
  margin:0;
  border-radius:6px;
  display:inline-flex;
  align-items:flex-end;
  justify-content:center;
  font-size:12px;
  color:#5a3e2b;
  cursor:pointer;
  transition:transform .06s linear, box-shadow .06s linear, background .06s linear;
}

.djf-organ-key.active {
  background:#f8d058 !important;
  transform: translateY(3px);
  box-shadow:none;
}

.djf-organ-key.black {
  position:absolute;
  width:30px;
  height:100px;
background: linear-gradient(180deg, #3d2008 0%, #1a0a00 100%);
  color:#c8a97e;
  border-radius:4px;
  top:0;
  left:30px;
  z-index:2;
  box-shadow:0 4px 8px rgba(0,0,0,0.45);
  transform-origin: bottom center;
}

.djf-organ-key.black.active {
  background: linear-gradient(180deg, #3d2008 0%, #1a0a00 100%) !important;
  box-shadow:0 0 10px #f8d058;
}

.djf-octave {
  display:flex;
  position:relative;
  margin-right: 0;
}

.djf-octave:last-child {
  margin-right: 0;
}

.djf-octave .white-container {
  display:flex;
  gap:0;
  z-index:1;
}

.djf-feedback {
  margin-top:8px;
  font-size:13px;
  color:#444;
  min-height:18px;
}

/* Contenedor de navegación de octavas */
#djf-organo-octave-nav {
  display: none;
  align-items: center;
  gap: 8px;
}

/* Flechas deshabilitadas */
.djf-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #f5f5f5;
  color: #999;
  border-color: #ddd;
}

/* === SELECT MEJORADO === */

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

/* Ocultar texto de teclas cuando está en modo "hidden" */
.djf-organ-key.note-hidden {
  font-size: 0;
}

/* === Gap pantallas pequeñas === */
@media (max-width:1150px){
  .djf-organo-header {
    margin-bottom:5px;
  }
}

/* === CONTROL DE DESPLAZAMIENTO DE TECLADO === */

.djf-keyboard-shift {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Botones pequeños */
.djf-btn-sm {
  padding: 5px 10px;
  min-width: 32px;
  font-size: 12px;
}

/* Ocultar en móvil (donde no hay teclado físico) */
@media (max-width: 800px) {
  .djf-keyboard-shift {
    display: none !important;
  }
}

/* Responsive: compactar en pantallas medianas */
@media (max-width: 1024px) {
  .djf-keyboard-shift span {
    font-size: 13px !important;
  }
  
  #djf-organo-kbd-range {
    min-width: 45px !important;
    font-size: 12px !important;
  }
}

/* Vista por filas */
@media (max-width:840px){
  .djf-organo-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }
  
 .djf-organo-controls {
    align-self: center;
  }
}

/* === MOBILE (M1) === */

@media (max-width:800px){
  .djf-organo-container {
    overflow: hidden;
    padding: 8px 0;
    position: relative;
    border-radius: 4px;
  }

  .djfo-row {
    transform-origin: left center;
  }

  #djf-organo-prev-oct,
  #djf-organo-next-oct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 6px 8px;
  }
  
  #djf-organo-octave-nav {
    display: flex !important;
  }
}

/* === LABELS === */

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

/* === RESPONSIVE HEADER === */

/* Móvil vertical: apilar controles en 2 filas */
@media (max-width: 669px) {

  .djf-organo-header h1 {
    font-size: 16px;
  }
  
  .djf-organo-controls {
    gap: 8px;
  }
  
  .djf-control-group {
    padding: 0 8px;
  }
  
  .djf-control-group:first-child {
    padding-left: 0;
  }
  
  .djf-control-group:last-child {
    padding-right: 0;
  }
  
  .djf-reverb-toggle {
    padding: 5px 12px;
  }
  
  .djf-reverb-toggle span {
    font-size: 13px;
  }
  
  .djf-btn,
  .djf-select {
    font-size: 12px;
    padding: 6px 8px;
  }
  
  .djf-organo-controls label {
    font-size: 13px;
  }
  
  .djf-select {
    max-width: 110px;
  }
  
  #djf-organo-prev-oct,
  #djf-organo-next-oct {
    min-width: 28px;
    padding: 5px 6px;
  }
}

/* Móvil muy estrecho: máxima compresión */
@media (max-width: 360px) {
  .djf-organo-header h1 {
    font-size: 15px;
    margin-bottom: 4px;
  }
  
  .djf-organo-controls {
    gap: 1px;
  }
  
  .djf-btn,
  .djf-select {
    font-size: 11px;
    padding: 5px 6px;
  }
  
  .djf-select {
    max-width: 100px;
  }
  
  .djf-organo-controls label {
    font-size: 12px !important;
  }

  .djf-reverb-toggle {
    padding: 4px 10px;
  }
  
  .djf-reverb-toggle span {
    font-size: 12px;
  }
}

/* === LOADING OVERLAY === */

.djf-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: 8px;
}

.djf-loading-content {
  text-align: center;
  max-width: 300px;
}

.djf-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4a90e2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.djf-loading-content p {
  margin: 0 0 15px;
  font-size: 16px;
  color: #333;
}

.djf-progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.djf-progress {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2, #63b3ed);
  width: 0%;
  transition: width 0.3s ease;
}

#djf-organo-loading-text {
  font-size: 14px;
  color: #666;
}

.djf-loading.hidden {
  display: none;
}

/* Overlay de activación solo móvil */
#djf-organo-audio-unlock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#djf-organo-audio-unlock-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.djf-unlock-text {
  color: white;
  font-size: 20px;
  text-align: center;
  padding: 20px;
  user-select: none;
}

/* Mostrar solo en móvil */
@media (min-width: 801px) {
  #djf-organo-audio-unlock-overlay {
    display: none !important;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  .djf-organ-key.white {
    height: 250px;
  }
  
  .djf-organ-key.black {
    height: 145px;
  }
  
  .djf-organo-container {
    padding: 0;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center; 
  }
  
  .djfo-row {
    padding: 0; 
    margin: 0;
  }
}

@media (max-width: 520px) and (orientation: portrait) {
  .djf-organo-container {
    height: 200px;
  }
}

/* Badge */

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

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

/* Badge Responsive */

@media (max-width: 669px) {
  .djf-tool-badge {
    width: 36px;
    height: 36px;
  }
  
  .djf-tool-badge img {
    width: 100%;
    height: 100%;
  }
  
  .djf-tool-title h1 {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  .djf-tool-badge {
    width: 32px;
    height: 32px;
  }
  
  .djf-tool-badge img {
    width: 100%;
    height: 100%;
  }
  
  .djf-tool-title h1 {
    font-size: 16px;
  }
}

/* Toggle y separadores adapt */
@media (max-width: 400px) {
  .djf-control-group {
    padding: 0 6px;
  }
  
  .djf-control-group:first-child {
    padding-left: 0;
  }
  
  .djf-reverb-toggle span {
    font-size: 12px;
  }

  .djf-control-group.has-separator::after {
    display: none;
  }
}

@media (max-width: 390px) {
  .djf-organo-controls {
    gap: 1px;
  }
  .djf-control-group {
    padding: 0 2px;
  }
}