/**
 * DJ Keylock Module - Styles
 * Botón y LED para Keylock (Master Tempo)
 */

/* ===============================================
   CONTENEDOR KEYLOCK
   =============================================== */
.keylock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* ===============================================
   BOTÓN KEYLOCK
   =============================================== */
.keylock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 42px;
    height: 24px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;

    background: linear-gradient(180deg, #2a2a35 0%, #1a1a22 100%);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.keylock-btn:hover {
    background: linear-gradient(180deg, #3a3a45 0%, #2a2a32 100%);
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}

.keylock-btn.active {
    background: linear-gradient(180deg, #1a4a3a 0%, #0d3025 100%);
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.4);
    box-shadow:
        0 0 10px rgba(0, 255, 136, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.keylock-btn.active:hover {
    background: linear-gradient(180deg, #205a4a 0%, #154035 100%);
    box-shadow:
        0 0 15px rgba(0, 255, 136, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ===============================================
   ICONO KEYLOCK (Llave musical)
   =============================================== */
.keylock-icon {
    width: 10px;
    height: 10px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: all 0.2s ease;
}

.keylock-btn.active .keylock-icon {
    stroke: #00ff88;
    filter: drop-shadow(0 0 2px rgba(0, 255, 136, 0.6));
}

/* ===============================================
   LED INDICADOR
   =============================================== */
.keylock-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(80, 80, 90, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.keylock-led.active {
    background: #00ff88;
    box-shadow:
        0 0 6px rgba(0, 255, 136, 0.8),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    animation: keylock-glow 2s ease-in-out infinite;
}

@keyframes keylock-glow {
    0%, 100% {
        box-shadow:
            0 0 6px rgba(0, 255, 136, 0.6),
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow:
            0 0 10px rgba(0, 255, 136, 0.9),
            0 0 15px rgba(0, 255, 136, 0.4),
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
    }
}

/* ===============================================
   LABEL DEL BOTÓN
   =============================================== */
.keylock-label {
    font-size: 7px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.keylock-btn.active + .keylock-label,
.keylock-container.active .keylock-label {
    color: rgba(0, 255, 136, 0.7);
}

/* ===============================================
   POSICIONAMIENTO EN DECK
   =============================================== */
/* Cerca del pitch fader */
.deck-a .keylock-container {
    position: absolute;
    right: 8px;
    bottom: 20px;
    z-index: 50;
}

.deck-b .keylock-container {
    position: absolute;
    left: 8px;
    bottom: 20px;
    z-index: 50;
}

/* ===============================================
   TOOLTIP
   =============================================== */
.keylock-btn[title] {
    position: relative;
}

.keylock-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 9px;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.keylock-btn:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 4px);
}

/* ===============================================
   RESPONSIVE
   =============================================== */
@media (max-width: 768px) {
    .keylock-btn {
        width: 36px;
        height: 22px;
        font-size: 7px;
    }

    .keylock-icon {
        width: 8px;
        height: 8px;
    }

    .keylock-led {
        width: 5px;
        height: 5px;
    }

    .deck-a .keylock-container,
    .deck-b .keylock-container {
        bottom: 10px;
    }
}

/* ===============================================
   INTEGRACIÓN CON PITCH FADER
   =============================================== */
/* Indicador en el pitch fader cuando keylock está activo */
.pitch-fader.keylock-active .pitch-track::before {
    content: '🔒';
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    z-index: 10;
}

/* Color del pitch knob cuando keylock activo */
.pitch-fader.keylock-active .pitch-knob-led {
    background: #00ff88 !important;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.8) !important;
}
