/**
 * DJ Beat Grid Visual Module - Styles
 * Estilos para overlays y elementos de UI del beat grid
 */

/* ===============================================
   BEAT COUNTER OVERLAY
   =============================================== */
.beat-counter-overlay {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    pointer-events: none;
}

.beat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.1s ease;
}

.beat-dot.active {
    background: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.8);
    transform: scale(1.2);
}

/* Deck A - Cyan dots */
.deck-a .beat-dot.active {
    background: #00d4ff;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
}

/* Deck B - Magenta dots */
.deck-b .beat-dot.active {
    background: #ff64c8;
    box-shadow: 0 0 8px rgba(255, 100, 200, 0.8);
}

/* ===============================================
   PHRASE INDICATOR
   =============================================== */
.phrase-indicator {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 9px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.5);
    z-index: 10;
    pointer-events: none;
}

.phrase-indicator .phrase-number {
    color: rgba(255, 200, 0, 0.8);
    font-size: 11px;
}

/* ===============================================
   LOOP REGION INDICATOR (fuera del canvas)
   =============================================== */
.loop-region-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 700;
    color: rgba(0, 255, 200, 0.8);
    background: rgba(0, 20, 15, 0.7);
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.waveform-container.loop-active .loop-region-label {
    opacity: 1;
}

/* Deck B loop label */
.deck-b .loop-region-label {
    color: rgba(255, 100, 200, 0.8);
    background: rgba(20, 0, 15, 0.7);
}

/* ===============================================
   BEAT GRID TOGGLE BUTTON
   =============================================== */
.beatgrid-toggle-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    background: rgba(30, 30, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    transition: all 0.2s ease;
}

.beatgrid-toggle-btn:hover {
    background: rgba(50, 50, 60, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

.beatgrid-toggle-btn.active {
    background: rgba(0, 100, 80, 0.6);
    border-color: rgba(0, 255, 136, 0.4);
}

.beatgrid-toggle-btn svg {
    width: 12px;
    height: 12px;
    stroke: rgba(255, 255, 255, 0.5);
    fill: none;
}

.beatgrid-toggle-btn.active svg {
    stroke: #00ff88;
}

/* ===============================================
   WAVEFORM CONTAINER ENHANCEMENTS
   =============================================== */
.waveform-container {
    position: relative;
}

/* Borde de loop activo */
.waveform-container.loop-active {
    box-shadow: inset 0 0 0 2px rgba(0, 255, 200, 0.3);
}

.deck-b .waveform-container.loop-active {
    box-shadow: inset 0 0 0 2px rgba(255, 100, 200, 0.3);
}

/* ===============================================
   BAR NUMBER MARKERS (para overlays HTML)
   =============================================== */
.bar-markers-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 16px;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}

.bar-marker {
    position: absolute;
    top: 0;
    font-size: 8px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.4);
    transform: translateX(-50%);
}

.bar-marker.downbeat {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.bar-marker.phrase {
    color: rgba(255, 200, 0, 0.8);
    font-size: 9px;
}

/* ===============================================
   ANIMATIONS
   =============================================== */
@keyframes beat-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 4px rgba(0, 255, 136, 0.5);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 12px rgba(0, 255, 136, 1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 4px rgba(0, 255, 136, 0.5);
    }
}

.beat-dot.pulse {
    animation: beat-pulse 0.15s ease-out;
}

/* ===============================================
   RESPONSIVE
   =============================================== */
@media (max-width: 768px) {
    .beat-counter-overlay {
        gap: 4px;
        bottom: 4px;
    }

    .beat-dot {
        width: 6px;
        height: 6px;
    }

    .phrase-indicator {
        font-size: 8px;
        top: 2px;
        right: 4px;
    }

    .beatgrid-toggle-btn {
        width: 18px;
        height: 18px;
    }

    .beatgrid-toggle-btn svg {
        width: 10px;
        height: 10px;
    }
}
