/**
 * DJ Phase Meter Module - Styles
 * Visualización de alineación de fase entre decks
 */

/* ===============================================
   CONTENEDOR PHASE METER
   =============================================== */
.phase-meter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    background: linear-gradient(180deg, rgba(20, 20, 30, 0.9) 0%, rgba(10, 10, 15, 0.95) 100%);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 4px 0;
    cursor: pointer;
}

.phase-meter-container:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* ===============================================
   LABEL
   =============================================== */
.phase-meter-label {
    font-size: 7px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===============================================
   TRACK (BARRA)
   =============================================== */
.phase-meter-track {
    position: relative;
    width: 200px;
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===============================================
   ZONAS DE COLOR
   =============================================== */
.phase-meter-zones {
    display: flex;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.phase-zone {
    flex: 1;
    opacity: 0.3;
}

.phase-zone-left {
    background: linear-gradient(90deg, #00d4ff 0%, transparent 100%);
}

.phase-zone-center {
    background: linear-gradient(90deg, transparent 0%, #00ff88 50%, transparent 100%);
}

.phase-zone-right {
    background: linear-gradient(90deg, transparent 0%, #ff00c8 100%);
}

/* ===============================================
   LÍNEA CENTRAL
   =============================================== */
.phase-meter-center-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(-50%);
    z-index: 1;
}

/* ===============================================
   INDICADOR
   =============================================== */
.phase-meter-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left 0.05s ease-out;
    z-index: 2;
    box-shadow: 0 0 6px currentColor;
}

/* ===============================================
   LABELS INFERIORES
   =============================================== */
.phase-meter-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 200px;
    font-size: 8px;
    font-weight: 600;
}

.phase-arrow-left,
.phase-arrow-right {
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.15s ease;
}

.phase-arrow-left.active {
    color: #00d4ff;
    text-shadow: 0 0 4px rgba(0, 212, 255, 0.6);
}

.phase-arrow-right.active {
    color: #ff00c8;
    text-shadow: 0 0 4px rgba(255, 0, 200, 0.6);
}

.phase-meter-value {
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.6);
    min-width: 30px;
    text-align: center;
}

/* ===============================================
   ESTADOS
   =============================================== */
/* En fase - Verde */
.phase-meter-container.in-sync .phase-meter-track {
    border-color: rgba(0, 255, 136, 0.4);
}

.phase-meter-container.in-sync .phase-meter-value {
    color: #00ff88;
}

.phase-meter-container.in-sync .phase-meter-indicator {
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}

/* Advertencia - Amarillo */
.phase-meter-container.warning .phase-meter-track {
    border-color: rgba(255, 204, 0, 0.4);
}

.phase-meter-container.warning .phase-meter-value {
    color: #ffcc00;
}

.phase-meter-container.warning .phase-meter-indicator {
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
}

/* Fuera de fase - Rojo */
.phase-meter-container.off .phase-meter-track {
    border-color: rgba(255, 68, 68, 0.4);
}

.phase-meter-container.off .phase-meter-value {
    color: #ff4444;
}

.phase-meter-container.off .phase-meter-indicator {
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
    animation: phase-pulse 0.5s ease-in-out infinite;
}

@keyframes phase-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===============================================
   TOOLTIP
   =============================================== */
.phase-meter-container[title]::after {
    content: 'Doble click para sincronizar fase';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.95);
    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;
    margin-bottom: 4px;
}

.phase-meter-container:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ===============================================
   RESPONSIVE
   =============================================== */
@media (max-width: 768px) {
    .phase-meter-container {
        padding: 3px 6px;
    }

    .phase-meter-track {
        width: 150px;
        height: 10px;
    }

    .phase-meter-labels {
        width: 150px;
        font-size: 7px;
    }

    .phase-meter-indicator {
        width: 6px;
        height: 6px;
    }

    .phase-meter-label {
        font-size: 6px;
    }
}

/* ===============================================
   VARIANTE VERTICAL (opcional)
   =============================================== */
.phase-meter-container.vertical {
    flex-direction: row;
    padding: 8px 4px;
}

.phase-meter-container.vertical .phase-meter-track {
    width: 12px;
    height: 80px;
}

.phase-meter-container.vertical .phase-meter-zones {
    flex-direction: column;
}

.phase-meter-container.vertical .phase-meter-center-line {
    left: 0;
    right: 0;
    top: 50%;
    bottom: auto;
    width: auto;
    height: 2px;
    transform: translateY(-50%);
}

.phase-meter-container.vertical .phase-meter-indicator {
    top: 50%;
    left: 50%;
}

.phase-meter-container.vertical .phase-meter-labels {
    flex-direction: column;
    width: auto;
    height: 80px;
}
