/* ============================================
   LAKITA STUDIO - ESTILOS UNIFICADOS
   ============================================ */

:root {
    --arka-color: #ef4444;
    --ira-color: #3b82f6;
    --ui-bg: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--ui-bg);
    padding: 16px;
    overflow-x: hidden;
}

.max-w-5xl {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 8px;
}

/* ============================================
   CONTENEDOR DE TUBOS
   ============================================ */
#tubosContainer {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    background: #e2e8f0;
    border-radius: 24px;
    padding: 16px 12px;
    margin-bottom: 20px;
    width: 100%;
    overflow-x: auto;
    min-height: 280px;
}

#tubosContainer::-webkit-scrollbar {
    height: 4px;
}

/* ============================================
   TUBOS INDIVIDUALES
   ============================================ */
.tubo-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 48px;
    border-radius: 0 0 14px 14px;
    cursor: pointer;
    transition: 0.05s linear;
    padding-top: 8px;
    padding-bottom: 4px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tubo-lico {
    background: linear-gradient(180deg, #fbbf24 0%, #b45309 100%);
}

.tubo-zanja {
    background: linear-gradient(180deg, #94a3b8 0%, #3a4a55 100%);
}

.tubo-active {
    transform: translateY(3px);
}

.tubo-id-label {
    font-size: 7px;
    font-weight: 800;
    color: white;
    opacity: 0.8;
    text-align: center;
}

.tubo-note-label {
    font-size: 10px;
    font-weight: 900;
    color: white;
    margin: 4px 0 2px 0;
    text-align: center;
}

.seccion-tag {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 0 0 3px 3px;
}

.tag-arka {
    background-color: var(--arka-color);
}
.tag-ira {
    background-color: var(--ira-color);
}

/* ============================================
   MODO INTERCALADO
   ============================================ */
#tubosContainer.intercalado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 16px 12px;
}

#tubosContainer.intercalado .arka-row,
#tubosContainer.intercalado .ira-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

#tubosContainer.intercalado .ira-row {
    margin-top: -145px;
}

#tubosContainer.intercalado .tubo-visual {
    width: 48px;
}

/* ============================================
   BOTONES PRINCIPALES
   ============================================ */
.tropa-btn, .btn-vista {
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    padding: 14px 0;
    font-size: 1.2rem;
    width: 100%;
}

.tropa-btn-lico {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    color: white;
}

.tropa-btn-zanja {
    background: linear-gradient(135deg, #6d7e85, #3a4a55);
    color: white;
}

.tropa-btn-inactive, .btn-vista-inactivo {
    background: #e2e8f0;
    color: #64748b;
}

.btn-vista-activo {
    background: #0f172a;
    color: white;
}

.control-btn {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 0.7rem;
    background: white;
    border: 1px solid #e2e8f0;
}

.active-btn {
    background: #0f172a;
    color: white;
    border-color: #0f172a;
}

/* ============================================
   BOTONES DEL SECUENCIADOR
   ============================================ */
.melody-btn, .clear-btn, .mute-btn {
    font-size: 11px;
    font-weight: 800;
    padding: 8px 18px;
    border-radius: 2rem;
    background: #f1f5f9;
    color: #475569;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.melody-btn:hover, .clear-btn:hover {
    background: #e2e8f0;
    transform: scale(0.98);
}

.mute-arka {
    background: #fee2e2;
    color: #dc2626;
}

.mute-arka:hover {
    background: #fecaca;
}

.mute-ira {
    background: #dbeafe;
    color: #2563eb;
}

.mute-ira:hover {
    background: #bfdbfe;
}

.mute-active-arka {
    background: #dc2626 !important;
    color: white !important;
}

.mute-active-ira {
    background: #2563eb !important;
    color: white !important;
}


/* ============================================
   SECUENCIADOR - CABECERA Y GRILLA (CORREGIDO)
   ============================================ */

/* Contenedor del grid - sin scroll horizontal */
#seqGrid {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: auto;
}

/* Cabecera del secuenciador */
.seq-header {
    display: flex;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #e2e8f0;
}

.seq-header-cell {
    flex: 1;
    text-align: center;
    padding: 6px 2px;
    min-width: 0;
    width: 100%;
}

.seq-header-id {
    font-size: 9px;
    font-weight: 800;
    line-height: 1.3;
    white-space: nowrap;
}

.seq-header-note {
    font-size: 8px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
}

.seq-header-arka .seq-header-id,
.seq-header-arka .seq-header-note {
    color: #ef4444;
}

.seq-header-ira .seq-header-id,
.seq-header-ira .seq-header-note {
    color: #3b82f6;
}

/* Filas del secuenciador */
.step-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.05s linear;
    width: 100%;
}

.step-number {
    width: 36px;
    font-size: 10px;
    font-weight: bold;
    color: #94a3b8;
    text-align: center;
    flex-shrink: 0;
    background: white;
    position: sticky;
    left: 0;
    z-index: 5;
}

.step-cell {
    flex: 1;
    height: 36px;
    margin: 2px;
    border-radius: 6px;
    cursor: pointer;
    min-width: 0;
    width: 100%;
}

/* Asegurar que cabecera y celdas tengan la misma distribución */
.seq-header,
.step-row {
    display: flex;
    width: 100%;
}

.seq-header > div:first-child,
.step-row > div:first-child {
    flex-shrink: 0;
    width: 36px;
}

.seq-header .seq-header-cell,
.step-row .step-cell {
    flex: 1 1 0;
    min-width: 0;
}

.cell-arka.active {
    background: var(--arka-color);
}
.cell-ira.active {
    background: var(--ira-color);
}
.cell-arka.inactive {
    background: #fee2e2;
}
.cell-ira.inactive {
    background: #dbeafe;
}

/* Mute visual */
.cell-muted {
    opacity: 0.35;
    filter: grayscale(0.3);
    position: relative;
}

.cell-muted::after {
    content: "🔇";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    opacity: 0.7;
}

/* Fila actual en reproducción */
.playing-row {
    background-color: #dbeafe !important;
    border-left: 4px solid #3b82f6;
    transition: all 0.05s linear;
}


/* ============================================
   TABLA DE COMPARATIVA
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
}

/* Colores de desviación */
.dev-azul { color: #3b82f6; font-weight: bold; }
.dev-verde { color: #22c55e; font-weight: bold; }
.dev-amarillo { color: #eab308; font-weight: bold; }
.dev-rojo { color: #ef4444; font-weight: bold; }

/* Badges de Arreglo */
.badge-azul {
    background-color: #3b82f6 !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 9px;
    font-weight: bold;
}

.badge-verde {
    background-color: #22c55e !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 9px;
    font-weight: bold;
}

.badge-amarillo {
    background-color: #eab308 !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 9px;
    font-weight: bold;
}

.badge-rojo {
    background-color: #ef4444 !important;
    color: white !important;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 9px;
    font-weight: bold;
}

/* Botón de play en tabla */
.play-tubo-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    margin-left: 6px;
    color: #3b82f6;
    transition: all 0.1s ease;
}

.play-tubo-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.tubo-id-with-play {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   PANEL DE INFORMACIÓN (LUTHIER REPORT)
   ============================================ */
.play-sample-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.play-sample-btn:hover {
    background: #2563eb;
    transform: scale(1.02);
}

.frec-card {
    background: #1e293b;
    border-radius: 16px;
    padding: 12px;
    transition: all 0.2s ease;
}

.frec-card-highlight {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid #f59e0b;
    border-radius: 16px;
    padding: 12px;
}

/* ============================================
   UTILIDADES
   ============================================ */
.hidden { display: none; }