.song-structure-app {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
}

/* Контейнер для блоков и настроек - ВЕРХНЯЯ ЧАСТЬ */
.song-blocks-container {
    display: block;
    margin-bottom: 30px;
}

/* Блоки песни - ГОРИЗОНТАЛЬНО */
.song-blocks {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.song-blocks h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

/* ГОРИЗОНТАЛЬНОЕ РАСПОЛОЖЕНИЕ БЛОКОВ */
.block-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 0;
    margin: 0;
}

.song-block {
    flex: 0 0 auto;
    margin-right: 10px;
    padding: 12px 20px;
    color: white;
    border-radius: 6px;
    cursor: move;
    text-align: center;
    user-select: none;
    font-weight: bold;
    min-width: 120px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.song-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.song-block:active {
    transform: translateY(0);
}

.song-block:last-child {
    margin-right: 0;
}

/* Настройки трека - РЯДОМ С БЛОКАМИ */
.track-settings {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.track-settings h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.track-settings .setting {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.track-settings .setting:last-child {
    margin-bottom: 0;
}

.track-settings label {
    font-weight: bold;
    color: #444;
    white-space: nowrap;
    margin-right: 10px;
    min-width: 140px;
    text-align: right;
}

.track-settings input[type="range"] {
    width: 200px;
    margin-right: 10px;
}

.track-settings input[type="number"] {
    width: 60px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

/* Таймлайн - ОТДЕЛЬНО СНИЗУ */
.timeline-container {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.timeline-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.timeline {
    display: flex;
    height: 150px;
    position: relative;
    margin-top: 20px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 99px,
        #f0f0f0 99px,
        #f0f0f0 100px
    );
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow-x: auto;
    min-height: 120px;
}

/* Бар (4 такта) */
.bar {
    position: relative;
    width: 100px;
    height: 100%;
    border-right: 1px solid #ddd;
    flex-shrink: 0;
}

.bar:nth-child(4n+1) {
    border-right: 2px solid #aaa;
}

.bar-number {
    position: absolute;
    bottom: -25px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

/* Блок на таймлайне */
.timeline-block {
    position: absolute;
    padding: 8px 4px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.2);
    box-sizing: border-box;
    min-width: 25px;
    user-select: none;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.timeline-block:hover {
    border: 2px solid rgba(0,0,0,0.4);
    z-index: 10;
}

/* Ручка для ресайза */
.ui-resizable-e {
    right: -4px;
    width: 8px;
    background: rgba(255,255,255,0.7);
    border-radius: 2px;
    cursor: col-resize;
}

/* Окно динамики */
.dynamic-popup {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 200px;
}

.dynamic-popup label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.dynamic-popup input[type="range"] {
    width: 100%;
    margin-bottom: 10px;
}

.dynamic-popup .close-popup {
    background: #4a6fa5;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    float: right;
}

.info-panel {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.info-panel strong {
    color: #2c5282;
}

/* Адаптивность */
@media (max-width: 768px) {
    .block-list {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .song-block {
        min-width: 100px;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .track-settings .setting {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .track-settings label {
        text-align: left;
        margin-bottom: 5px;
        min-width: auto;
    }
    
    .timeline {
        height: 120px;
    }
}