/* Anuncio advanced mix editor. Global (not scoped) because anuncioMezcla.js builds the timeline DOM.
   Row heights are shared with the lane headers rendered by DialogAnuncioMezclaAvanzada. */
:root {
    --amx-ruler-height: 28px;
    --amx-lane-height: 56px;
    --amx-header-width: 176px;
}

/* #region Editor frame */
.amx-editor {
    display: flex;
    align-items: flex-start;
    width: 100%;
    border: 1px solid var(--rz-base-300);
    border-radius: var(--rz-border-radius);
    background: var(--rz-base-background-color);
    overflow: hidden;
}

.amx-headers {
    flex: 0 0 var(--amx-header-width);
    border-right: 1px solid var(--rz-base-300);
    background: var(--rz-base-100);
}

.amx-headers-spacer {
    height: var(--amx-ruler-height);
    box-sizing: border-box;
    border-bottom: 1px solid var(--rz-base-300);
}

.amx-header {
    height: var(--amx-lane-height);
    box-sizing: border-box;
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--rz-base-300);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    overflow: hidden;
}

.amx-header-selected {
    background: var(--rz-primary-lighter);
}

.amx-header-title {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.amx-header-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.amx-header-volume {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
}

.amx-header-volume .rz-slider {
    flex: 1 1 auto;
}

.amx-timeline-wrap {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
/* #endregion */

/* #region Timeline */
.amx-root {
    position: relative;
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
}

.amx-ruler {
    position: relative;
    height: var(--amx-ruler-height);
    box-sizing: border-box;
    border-bottom: 1px solid var(--rz-base-300);
    cursor: pointer;
    overflow: hidden;
}

.amx-tick {
    position: absolute;
    bottom: 0;
    height: 6px;
    width: 1px;
    background: var(--rz-text-disabled-color);
    pointer-events: none;
}

.amx-tick-major {
    height: 14px;
    padding-left: 3px;
    font-size: 0.65rem;
    line-height: 1;
    color: var(--rz-text-secondary-color);
    background: var(--rz-text-secondary-color);
}

.amx-lanes {
    position: relative;
}

.amx-lane {
    position: relative;
    height: var(--amx-lane-height);
    box-sizing: border-box;
    border-bottom: 1px solid var(--rz-base-300);
    background-image: linear-gradient(to right, var(--rz-base-200) 1px, transparent 1px);
    background-size: calc(100% / 12) 100%;
}

.amx-lane.amx-drop-target {
    background-color: var(--rz-primary-lighter);
    outline: 2px dashed var(--rz-primary);
    outline-offset: -2px;
}

.amx-clip {
    position: absolute;
    top: 4px;
    bottom: 4px;
    box-sizing: border-box;
    border-radius: 4px;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    color: #fff;
    border: 1px solid transparent;
}

.amx-clip:active {
    cursor: grabbing;
}

.amx-clip-voz {
    background: var(--rz-primary);
}

.amx-clip-efecto1,
.amx-clip-efecto2 {
    background: var(--rz-warning);
    color: #3b2a00;
}

.amx-clip-musica {
    background: var(--rz-secondary);
}

.amx-clip.amx-selected {
    border-color: var(--rz-text-title-color);
    box-shadow: 0 0 0 2px var(--rz-primary-light);
}

.amx-clip-label {
    position: absolute;
    top: 1px;
    left: 4px;
    right: 4px;
    z-index: 1;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.amx-clip-wave {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
}

.amx-outside {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.18);
    pointer-events: none;
    z-index: 2;
}

.amx-end-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--rz-danger);
    pointer-events: none;
    z-index: 3;
}

.amx-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--rz-text-title-color);
    pointer-events: none;
    z-index: 4;
}
/* #endregion */

/* #region Volume envelope */
.amx-envelope {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: visible;
}

.amx-env-line {
    fill: none;
    stroke: var(--rz-text-title-color);
    stroke-width: 2;
}

.amx-env-line-empty {
    stroke-dasharray: 6 4;
    opacity: 0.45;
}

.amx-env-point {
    fill: #fff;
    stroke: var(--rz-text-title-color);
    stroke-width: 2;
    pointer-events: all;
    cursor: grab;
    touch-action: none;
}

.amx-envelope-hint {
    position: absolute;
    right: 6px;
    bottom: 2px;
    z-index: 1;
    font-size: 0.6rem;
    color: var(--rz-text-secondary-color);
    pointer-events: none;
}
/* #endregion */

/* #region Library panel */
.amx-library-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--rz-base-300);
    border-radius: var(--rz-border-radius);
    background: var(--rz-base-background-color);
    cursor: grab;
}

.amx-library-item:hover {
    border-color: var(--rz-primary);
}

.amx-library-list {
    max-height: 260px;
    overflow-y: auto;
}
/* #endregion */

@media (max-width: 720px) {
    :root {
        --amx-header-width: 124px;
    }
}
