/* ============================================================
   ADR-041 — Style Select: убрано превью, сетка 2×2, изящная шкала
   ------------------------------------------------------------
   ВАЖНО: все селекторы ограничены #styleModal. Классы .modal-layout,
   .premium-modal-content, .act-strip, .style-card используются также
   в captionsModal и других местах — глобально их менять нельзя.
   JS не тронут: разметку по-прежнему строит _renderStyleCards()
   и _buildActStrip() из ui-presets.js, меняется только внешний вид.
   Подключается ПОСЛЕ theme.css.
   ============================================================ */

/* ---------- Оболочка: фиксированная высота 520px больше не нужна ---------- */
#styleModal .modal-layout {
    display: block;
    height: auto;
}

#styleModal .modal-options-side {
    padding: 26px;
}

#styleModal .modal-header-block {
    margin-bottom: 18px;
}

/* ---------- Сетка пресетов 2×2 вместо колонки со скроллом ---------- */
#styleModal .style-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    overflow: visible;
    padding: 0;
}

/* ---------- Карточка пресета ---------- */
#styleModal .style-card {
    gap: 0;
    padding: 14px 15px 13px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-family: 'Outfit', sans-serif;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

#styleModal .style-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.07);
}

#styleModal .style-card.active {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 0 0 2px #B794F6, 0 12px 28px var(--accent-glow);
}

#styleModal .style-card-top {
    align-items: center;
    margin-bottom: 11px;
}

#styleModal .style-card-name {
    font-size: 15px;
    letter-spacing: -0.01em;
}

/* Длительность — пилюля; у выбранного пресета заливается акцентом */
#styleModal .style-card-dur {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.045);
    padding: 3px 9px;
    border-radius: var(--radius-full);
    line-height: 1.4;
}

#styleModal .style-card.active .style-card-dur {
    background: var(--accent-gradient);
    color: #fff;
}

#styleModal .style-card-desc {
    font-size: 10.5px;
    line-height: 1.45;
}

#styleModal .style-card.active .style-card-desc {
    color: var(--text-secondary);
}

/* ---------- Шкала актов: три капсулы вместо слитной полосы ---------- */
#styleModal .act-strip,
#styleModal .act-strip-sm {
    height: 6px;
    gap: 3px;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    margin: 0 0 10px;
}

#styleModal .act-seg {
    border-radius: var(--radius-full);
    min-width: 8px;
    opacity: 0.55;
    transition: opacity 0.25s ease;
}

#styleModal .style-card.active .act-seg {
    opacity: 1;
}

/* Плоская заливка вместо градиента — на 6px градиент не читается */
#styleModal .phase-intro   { background: #FF99B3; }
#styleModal .phase-process { background: #B794F6; }
#styleModal .phase-payoff  { background: #70C0F0; }

/* Насечки ритма на полосе 6px превращаются в шум — скрываем */
#styleModal .act-tick {
    display: none;
}

/* ---------- Легенда фаз ---------- */
#styleModal .style-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 16px 0 0;
}

#styleModal .style-legend span {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
}

#styleModal .style-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

#styleModal .style-legend .lg-intro   { background: #FF99B3; }
#styleModal .style-legend .lg-process { background: #B794F6; }
#styleModal .style-legend .lg-payoff  { background: #70C0F0; }

/* ---------- Футер ---------- */
#styleModal .modal-footer {
    margin-top: 18px;
    padding-top: 16px;
}

/* ══════════════════════════════════════════════════════════════════════════
   H-69 Т4 + H-69-fix (макет MOCKUP_H-69_fix, 05.12.2026)
   Кнопка Edit в Track, модалка Trim, список версий. Стиль один: светлое стекло
   сайта (как Audio Overlay), шрифт Outfit, палитра theme.css. Добавлен один
   читаемый оттенок акцента #7C5CD6 — для текста значений и обводок кнопок
   (у #A78BFA на светлом фоне не хватало контраста).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Audio Overlay: значения и имя трека — насыщенный акцент ── */
#audioMixModal .setting-value,
#audioTrimModal .setting-value {
    color: #7C5CD6;
    background: rgba(167, 139, 250, 0.16);
}

#aoTrackName {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Кнопка Edit: стандартный цвет сайта — градиент, белый текст.
   У .btn-modal-secondary всё через !important (theme.css:5301) — здесь тоже. */
.h69-track-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.btn-modal-secondary.h69-track-edit {
    padding: 0 14px !important;
    height: 28px !important;
    min-height: 0 !important;
    line-height: 28px !important;
    font-size: 11px !important;
    letter-spacing: .08em !important;
    border-radius: 14px !important;
    text-transform: uppercase !important;
    color: #fff !important;
    background: var(--accent-gradient) !important;
    border: none !important;
    box-shadow: 0 6px 16px -4px var(--accent-glow) !important;
    width: auto !important;
    flex: none;
}

.btn-modal-secondary.h69-track-edit:hover {
    color: #fff !important;
    filter: brightness(1.05);
}

.btn-modal-secondary.h69-track-edit[disabled] {
    opacity: .45;
    cursor: default;
    box-shadow: none !important;
}

/* ── Trim: модалка поверх Audio Overlay — плотное светлое стекло, не серое ── */
/* Trim открывается ПОВЕРХ Audio Overlay: у всех .modal z-index 9999 (layout.css:753),
   а разметка Trim стоит в index.html раньше — без этого правила она легла бы под него. */
#audioTrimModal {
    z-index: 10001;
}

/* У .modal-center-size фон rgba(255,255,255,.2) !important (theme.css:2359):
   поверх открытого Audio Overlay он давал серое окно. */
#audioTrimModal .modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 242, 255, 0.92) 100%) !important;
}

#audioTrimModal .modal-title {
    color: var(--text-primary);
}

#audioTrimModal .modal-close {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.06);
}

.h69-trim-sub {
    text-align: center;
    font-size: 13px;
    margin: 4px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h69-trim-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 16px;
    border-radius: 16px;
}

/* Волна: canvas + тени вне фрагмента + маркеры In/Out + курсор воспроизведения */
.h69-wave-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(167, 139, 250, 0.25);
    user-select: none;
    touch-action: none;
}

.h69-wave-wrap canvas {
    display: block;
    width: 100%;
    height: 96px;
    cursor: crosshair;
}

.h69-wave-empty {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.6);
}

.h69-wave-wrap.no-peaks .h69-wave-empty {
    display: flex;
}

.h69-shade {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(45, 52, 54, 0.10);
    z-index: 2;
    pointer-events: none;
}

/* Ручка: вертикальная линия + «таблетка» по центру; 14 px, внутри области */
.h69-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 14px;
    cursor: ew-resize;
    z-index: 3;
    outline: none;
}

.h69-handle::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 2px;
    background: #B794F6;
}

.h69-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 1px;
    width: 12px;
    height: 28px;
    margin-top: -14px;
    border-radius: 6px;
    background: #fff;
    border: 2px solid #B794F6;
    box-shadow: 0 2px 6px rgba(80, 60, 140, 0.25);
    box-sizing: border-box;
}

.h69-handle:focus-visible::after {
    box-shadow: 0 0 0 3px rgba(183, 148, 246, 0.45);
}

.h69-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #FF99B3;
    z-index: 4;
    pointer-events: none;
    display: none;
}

/* Шкала: ≤5 подписей m:ss, первая прижата влево, последняя — вправо */
.h69-ruler {
    position: relative;
    height: 20px;
    margin: 6px 0 4px;
}

.h69-ruler span {
    position: absolute;
    top: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transform: translateX(-50%);
}

.h69-ruler span.first {
    transform: none;
}

.h69-ruler span.last {
    transform: translateX(-100%);
}

.h69-ruler i {
    position: absolute;
    top: 0;
    width: 1px;
    height: 4px;
    background: rgba(45, 52, 54, 0.2);
}

/* Поля In/Out и длина фрагмента */
.h69-trim-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.h69-trim-row .setting-label {
    color: var(--text-secondary);
    margin: 0;
}

.h69-num {
    width: 84px;
    height: 36px;
    padding: 0 8px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: 10px;
    outline: none;
}

.h69-num:focus {
    border-color: #A78BFA;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.h69-trim-row .setting-value {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* Кнопки: Play / Loop / Reset — обводка акцентом (читаются как активные),
   Trim — градиент сайта; всё в одну строку */
.h69-trim-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 16px;
}

.h69-trim-actions .btn-modal-secondary {
    height: 36px !important;
    padding: 0 12px !important;
    border-radius: 18px !important;
    font-size: 12px !important;
    letter-spacing: .08em !important;
    width: auto !important;
    margin: 0 !important;
    white-space: nowrap;
    color: #7C5CD6 !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1.5px solid rgba(167, 139, 250, 0.55) !important;
}

.h69-trim-actions .btn-modal-secondary:hover {
    color: #7C5CD6 !important;
    background: #fff !important;
    border-color: #A78BFA !important;
}

.h69-trim-actions .btn-modal-action {
    margin: 0 0 0 auto !important;
    height: 38px !important;
    padding: 0 22px !important;
    font-size: 13px !important;
    width: auto !important;
    white-space: nowrap;
}

/* ── Список версий (светлое стекло; база — инлайн в ui-recut-versions.js) ── */
.recut-versions-list::-webkit-scrollbar {
    width: 6px;
}

.recut-versions-list::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, 0.45);
    border-radius: 3px;
}

.recut-versions-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(167, 139, 250, 0.45) transparent;
}

.recut-versions-list .h69-ver-title {
    flex: 1;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.recut-versions-list .h69-ver-check {
    display: inline-flex;
    flex: none;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.recut-versions-list .h69-ver-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #A78BFA;
    cursor: pointer;
}

.recut-versions-list .h69-ver-ph {
    flex: none;
    width: 16px;
}

.recut-versions-list .h69-ver-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recut-versions-list .h69-ver-tag {
    flex: none;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #7C5CD6;
}

/* Ведро в строке — при наведении на строку */
.recut-versions-list .h69-del-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s, background .15s, color .15s;
}

.recut-versions-list .recut-version-item:hover .h69-del-btn,
.recut-versions-list .h69-del-btn:focus-visible {
    opacity: 1;
}

.recut-versions-list .h69-del-btn:hover {
    background: rgba(229, 72, 77, 0.12);
    color: #E5484D;
}

.recut-versions-list .h69-del-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

/* «Delete N» в шапке — видна только при выборе */
.recut-versions-list .h69-del-sel {
    height: 26px;
    padding: 0 10px;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    border-radius: 8px;
    font: 800 11px 'Outfit', sans-serif;
    color: #E5484D;
    background: rgba(229, 72, 77, 0.10);
    cursor: pointer;
}

.recut-versions-list .h69-del-sel:hover {
    background: rgba(229, 72, 77, 0.18);
}

@media (hover: none) {
    .recut-versions-list .h69-del-btn {
        opacity: 1;
    }
}
