@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root { 
    --bg: #071018; 
    --panel: #0b1720; 
    --panel-light: #12202e; 
    --muted: #9aa4b2; 
    --white: #eef2f7; 
    --accent: #38bdf8; 
    --accent2: #7c3aed; 
    --gradient-primary: linear-gradient(135deg, var(--accent), var(--accent2)); 
    --border-color: rgba(255, 255, 255, 0.08); 
    --danger: #ef4444; 
    --success: #22c55e; 
    --warning: #facc15; 
    --effect-color: #d946ef;
}

* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; outline: none; }

html {
    scroll-behavior: smooth;
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg); 
    color: var(--white); 
    margin: 0; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    overflow-x: hidden;
    background-image: radial-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px); 
    background-size: 30px 30px; 
}

::-webkit-scrollbar { width: 8px; height: 8px; background: var(--bg); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* --- ОБЕРТКА РЕДАКТОРА --- */
.editor-wrapper {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* --- ШАПКА --- */
header { 
    height: 45px; 
    background: var(--panel); 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 15px; 
    z-index: 50; 
    flex-shrink: 0; 
    position: sticky;
    top: 0;
}
.logo { 
    font-weight: 700; 
    font-size: 0.9em; 
    background: var(--gradient-primary); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    display: flex; 
    gap: 8px; 
    align-items: center; 
}
.logo i { color: var(--accent); -webkit-text-fill-color: initial; }
.header-controls { display: flex; gap: 10px; align-items: center; }

.history-group { display: flex; gap: 4px; }
.history-btn { 
    background: rgba(255,255,255,0.05); 
    border: 1px solid var(--border-color); 
    color: var(--muted); 
    width: 32px; 
    height: 32px; 
    border-radius: 6px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    font-size: 0.9em; 
    transition: all 0.2s; 
}
.history-btn:hover { background: rgba(56, 189, 248, 0.1); color: var(--accent); border-color: var(--accent); }
.history-btn:active { transform: scale(0.95); }

.v-sep { width: 1px; height: 20px; background: var(--border-color); margin: 0 2px; }

.export-btn { 
    background: var(--gradient-primary); 
    color: #021018; 
    border: none; 
    padding: 0 12px; 
    height: 32px; 
    border-radius: 6px; 
    font-weight: 700; 
    font-size: 0.75em; 
    cursor: pointer; 
    display: flex; 
    gap: 6px; 
    align-items: center; 
    transition: all 0.2s; 
}
.export-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* --- ОСНОВНАЯ ЗОНА --- */
.main-area { 
    flex: 1; 
    display: flex; 
    overflow: hidden; 
    position: relative; 
    min-height: 0;
}

/* ЛЕВАЯ КОЛОНКА */
.media-bin { 
    width: 380px; 
    background: var(--panel); 
    border-right: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: row; 
    flex-shrink: 0; 
    z-index: 40; 
}

.sidebar-tabs { 
    display: flex; 
    flex-direction: column; 
    width: 65px; 
    background: #081016; 
    border-right: 1px solid var(--border-color); 
    padding-top: 10px; 
    flex-shrink: 0; 
    margin: 0; 
    border-radius: 0; 
}
.tab-btn { 
    background: transparent; 
    border: none; 
    color: var(--muted); 
    padding: 12px 0; 
    cursor: pointer; 
    font-size: 0.65em; 
    font-weight: 600; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 6px; 
    width: 100%; 
    transition: 0.2s; 
}
.tab-btn:hover { color: var(--white); background: rgba(255,255,255,0.03); }
.tab-btn.active { 
    background: rgba(56, 189, 248, 0.1); 
    color: var(--accent); 
    border-right: 2px solid var(--accent); 
}

.tab-content { 
    display: none; 
    flex: 1; 
    flex-direction: column; 
    overflow: hidden; 
    padding: 15px; 
    background: var(--panel); 
}
.tab-content.active { display: flex; }

.upload-btn { 
    background: rgba(56, 189, 248, 0.1); 
    border: 1px solid rgba(56, 189, 248, 0.3); 
    color: var(--accent); 
    padding: 12px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 0.85em; 
    display: flex; 
    justify-content: center; 
    gap: 8px; 
    margin-bottom: 10px; 
    width: 100%; 
    transition: all 0.2s; 
    flex-shrink: 0; 
    align-items: center; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.upload-btn:hover { 
    background: rgba(56, 189, 248, 0.2); 
    border-color: var(--accent); 
    transform: translateY(-1px); 
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2); 
}
.upload-btn:active { transform: translateY(0); }
.upload-btn.active { background: var(--accent); color: #000; }

.bin-grid { 
    flex: 1; 
    overflow-y: auto; 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px; 
    align-content: start; 
    padding-bottom: 20px; 
}
.bin-item { 
    background: #000; 
    aspect-ratio: 16/9; 
    border-radius: 6px; 
    position: relative; 
    cursor: pointer; 
    border: 2px solid transparent; 
    overflow: hidden; 
}
.bin-item:hover { border-color: var(--accent); }
.bin-item.selected { 
    border-color: var(--success); 
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3); 
}
.bin-item.selected::after { 
    content: '\f00c'; 
    font-family: 'Font Awesome 6 Free'; 
    font-weight: 900; 
    position: absolute; 
    top: 5px; 
    right: 5px; 
    background: var(--success); 
    color: #000; 
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 10px; 
}
.bin-item img, .bin-item video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    opacity: 0.8; 
    pointer-events: none; 
}
.bin-item .type-icon { 
    position: absolute; 
    top: 4px; 
    left: 4px; 
    background: rgba(0,0,0,0.6); 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-size: 9px; 
    font-weight: 600; 
    backdrop-filter: blur(2px); 
}
.bin-item .name { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); 
    font-size: 9px; 
    padding: 6px 4px 2px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.transition-item { 
    background: var(--panel-light); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    aspect-ratio: 16/9; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-end; 
    cursor: pointer; 
    overflow: hidden; 
    position: relative; 
    transition: all 0.2s ease; 
}
.transition-item:hover { 
    border-color: var(--accent); 
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
}
.transition-item.active { 
    border-color: var(--success); 
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5); 
    transform: scale(0.98); 
}
.transition-item.effect-item { border-color: rgba(217, 70, 239, 0.3); }
.transition-item.effect-item:hover { 
    border-color: var(--effect-color); 
    box-shadow: 0 4px 12px rgba(217, 70, 239, 0.2); 
}

.transition-item.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
    filter: grayscale(60%);
    transform: none !important;
    box-shadow: none !important;
    border-color: var(--border-color) !important;
}
.transition-item.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-color);
}
.transition-item.disabled .item-preview { opacity: 0.5; }
.transition-item.disabled .transition-icon { opacity: 0.3; }
.transition-item.disabled .item-label { color: #64748b; font-weight: 400; }

.item-preview { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 70%; 
    background: linear-gradient(45deg, #1e293b, #475569); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.transition-icon { font-size: 1.5em; color: var(--white); z-index: 2; }
.item-label { 
    height: 30%; 
    width: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.75em; 
    font-weight: 600; 
    background: #0f172a; 
    color: var(--muted); 
}

.instruction-hint.drag-hint {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(124, 58, 237, 0.15));
    border: 1px dashed rgba(56, 189, 248, 0.4);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.8em;
    padding: 12px 15px;
    border-radius: 8px;
    text-align: center;
    animation: pulseHint 2s infinite;
}
.instruction-hint.drag-hint i { margin-right: 8px; font-size: 1.1em; }

#effectsGrid .instruction-hint.drag-hint {
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(124, 58, 237, 0.15));
    border-color: rgba(217, 70, 239, 0.4);
    color: var(--effect-color);
}
#effectsGrid .instruction-hint.drag-hint i { color: var(--effect-color); }

@keyframes pulseHint {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

#mobile-action-toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85em;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 90vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#mobile-action-toast.success { background: rgba(34, 197, 94, 0.95); color: #000; }
#mobile-action-toast.error { background: rgba(239, 68, 68, 0.95); color: #fff; }
#mobile-action-toast.info { background: rgba(56, 189, 248, 0.95); color: #000; }

/* ПЛЕЕР */
.player-area { 
    flex: 1; 
    background: #050a10; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 10px; 
    position: relative; 
    overflow: hidden; 
    z-index: 10; 
    min-height: 0;
}
.player-wrapper { 
    flex: 1; 
    width: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
    position: relative; 
    min-height: 0;
}
canvas { 
    max-width: 100%; 
    max-height: 100%; 
    width: auto;
    height: auto;
    background: #000; 
    border-radius: 2px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    object-fit: contain; 
    cursor: default; 
    display: block;
}
.controls { 
    width: auto; 
    margin-top: 10px; 
    background: var(--panel-light); 
    padding: 6px 20px; 
    border-radius: 50px; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    border: 1px solid var(--border-color); 
    flex-shrink: 0; 
    z-index: 10; 
}
.ctrl-btn { 
    background: none; 
    border: none; 
    color: var(--white); 
    font-size: 1.1em; 
    cursor: pointer; 
    padding: 5px; 
}
.main-play-btn { 
    width: 36px; 
    height: 36px; 
    background: var(--white); 
    color: #000; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.time-code { 
    font-variant-numeric: tabular-nums; 
    font-size: 0.8em; 
    color: var(--muted); 
    min-width: 80px; 
    text-align: center; 
}

/* CROP CONTROLS */
.crop-actions { 
    position: absolute; 
    bottom: 20px; 
    left: 50%; 
    transform: translateX(-50%); 
    display: flex; 
    gap: 15px; 
    z-index: 2000; 
    background: rgba(0, 0, 0, 0.8); 
    padding: 8px 15px; 
    border-radius: 50px; 
    backdrop-filter: blur(5px); 
    border: 1px solid rgba(255,255,255,0.1); 
}
.crop-btn-ok { 
    background: var(--success); 
    color: #000; 
    border: none; 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.1em; 
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3); 
    pointer-events: auto; 
}
.crop-btn-cancel { 
    background: var(--danger); 
    color: #fff; 
    border: none; 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.1em; 
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3); 
    pointer-events: auto; 
}

.mobile-tools-grid { display: none; }

/* СВОЙСТВА - Десктоп */
.properties-panel { 
    width: 0; 
    opacity: 0; 
    background: var(--panel); 
    border-left: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    transition: 0.3s ease; 
    position: relative; 
    z-index: 60; 
}
.properties-panel.active { width: 280px; opacity: 1; }
.prop-header { 
    height: 40px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 15px; 
    font-weight: 700; 
    font-size: 0.9em; 
    color: var(--accent); 
    background: var(--panel-light); 
}
.close-prop-btn { 
    background: none; 
    border: none; 
    color: var(--muted); 
    cursor: pointer; 
    font-size: 1.1em; 
}
.prop-content { 
    padding: 15px; 
    overflow-y: auto; 
    flex: 1; 
}
.prop-group { margin-bottom: 20px; }
.prop-label { 
    font-size: 0.75em; 
    color: var(--muted); 
    margin-bottom: 10px; 
    display: block; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}
.prop-range { 
    -webkit-appearance: none; 
    width: 100%; 
    height: 4px; 
    background: rgba(255,255,255,0.1); 
    border-radius: 3px; 
    outline: none; 
}
.prop-range::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    width: 16px; 
    height: 16px; 
    background: var(--accent); 
    border-radius: 50%; 
    cursor: pointer; 
    border: 2px solid #fff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); 
}
.prop-input { 
    width: 100%; 
    background: #000; 
    border: 1px solid var(--border-color); 
    color: #fff; 
    padding: 8px; 
    border-radius: 4px; 
    font-size: 0.9em; 
}

/* СТИЛИ ДЛЯ ЭФФЕКТОВ И МАСОК */
.mask-toggle { 
    position: relative; 
    display: inline-block; 
    width: 44px; 
    height: 24px; 
}
.mask-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { 
    position: absolute; 
    cursor: pointer; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-color: rgba(255,255,255,0.1); 
    transition: .3s; 
    border-radius: 24px; 
    border: 1px solid var(--border-color); 
}
.toggle-slider:before { 
    position: absolute; 
    content: ""; 
    height: 18px; 
    width: 18px; 
    left: 2px; 
    bottom: 2px; 
    background-color: white; 
    transition: .3s; 
    border-radius: 50%; 
}
.mask-toggle input:checked + .toggle-slider { 
    background-color: var(--effect-color); 
    border-color: var(--effect-color); 
}
.mask-toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

.mask-type-selector { display: flex; gap: 8px; }
.mask-type-btn { 
    flex: 1; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid var(--border-color); 
    color: var(--muted); 
    padding: 10px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 0.75em; 
    font-weight: 600; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 6px; 
    transition: all 0.2s; 
}
.mask-type-btn:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.mask-type-btn.active { 
    background: rgba(217, 70, 239, 0.2); 
    border-color: var(--effect-color); 
    color: var(--effect-color); 
}
.mask-type-btn i { font-size: 1.3em; }

.effect-intensity::-webkit-slider-thumb { background: var(--effect-color) !important; }

#intensityVal, #maskXVal, #maskYVal, #maskWVal, #maskHVal, #maskFeatherVal, #effectDurationVal { 
    color: var(--effect-color); 
    font-weight: 700; 
}

.timeline-clip.effect { 
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.3), rgba(124, 58, 237, 0.3)) !important; 
    border-color: var(--effect-color) !important;
}
.timeline-clip.effect .clip-name { color: var(--effect-color); }
.timeline-clip.effect .duration-badge { background: var(--effect-color); color: #fff; }

/* ТАЙМЛАЙН */
.timeline-wrapper { 
    height: 400px; 
    background: var(--panel); 
    border-top: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    z-index: 30; 
}
.timeline-tools { 
    height: 36px; 
    background: var(--panel-light); 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 10px; 
    color: var(--muted); 
    font-size: 0.8em; 
}
.delete-tool-btn { 
    background: rgba(239, 68, 68, 0.15); 
    color: #ef4444; 
    border: 1px solid rgba(239, 68, 68, 0.3); 
    padding: 4px 10px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.85em; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}
.edit-tool-btn { 
    background: rgba(56, 189, 248, 0.15); 
    color: var(--accent); 
    border: 1px solid rgba(56, 189, 248, 0.3); 
    padding: 4px 10px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.85em; 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}
.zoom-controls { display: flex; align-items: center; gap: 6px; }
.zoom-btn { 
    background: rgba(255,255,255,0.05); 
    border: 1px solid var(--border-color); 
    color: var(--white); 
    width: 24px; 
    height: 24px; 
    border-radius: 4px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.8em; 
}
.zoom-btn.active { background: var(--accent); color: #0b1720; border-color: var(--accent); }

#ratioSelect, .ratio-select { 
    background: rgba(11, 18, 25, 0.9); 
    color: var(--white); 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    padding: 4px 8px; 
    font-size: 0.85em; 
    font-weight: 600; 
    cursor: pointer; 
    outline: none; 
    height: 26px; 
    -webkit-appearance: none; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%2338bdf8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E"); 
    background-repeat: no-repeat; 
    background-position: right 6px center; 
    padding-right: 22px; 
}
#ratioSelect option { background: var(--panel); color: var(--white); padding: 8px; }

.timeline-scroll-area { 
    flex: 1; 
    overflow: auto; 
    position: relative; 
    padding-top: 25px; 
    background: #080f16; 
    padding-bottom: 40px; 
    touch-action: pan-x pan-y; 
    overscroll-behavior: none; 
    -webkit-overflow-scrolling: touch; 
}
.ruler { 
    position: absolute; 
    top: 0; 
    left: 0; 
    height: 25px; 
    width: 100%; 
    background: var(--panel-light); 
    border-bottom: 1px solid var(--border-color); 
    background-image: linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px); 
    background-size: 15px 100%; 
    pointer-events: none; 
}
.ruler-time-label { 
    position: absolute; 
    top: 2px; 
    font-size: 0.65em; 
    color: #64748b; 
    font-family: monospace; 
    padding-left: 4px; 
}
.playhead { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 2px; 
    bottom: 0; 
    height: auto; 
    background: var(--white); 
    z-index: 100; 
    pointer-events: none; 
}
.playhead-top { 
    position: absolute; 
    top: 0; 
    left: -6px; 
    width: 0; 
    height: 0; 
    border-left: 7px solid transparent; 
    border-right: 7px solid transparent; 
    border-top: 12px solid var(--white); 
}

.track-container { 
    padding-bottom: 50px; 
    position: relative; 
    min-width: 100%; 
    min-height: 100%; 
}
.track-wrapper { display: block; position: relative; width: 100%; }
.track-label-container { 
    position: sticky; 
    left: 0; 
    z-index: 25; 
    pointer-events: auto; 
}
.track-header { 
    font-size: 0.6em; 
    font-weight: 800; 
    padding: 2px 6px; 
    background: rgba(11, 23, 32, 0.95); 
    border: 1px solid var(--border-color); 
    border-left: none; 
    display: inline-block; 
    margin-top: 4px; 
    border-radius: 0 4px 4px 0; 
    backdrop-filter: blur(2px); 
    box-shadow: 2px 0 5px rgba(0,0,0,0.3); 
}

.track { 
    height: 60px; 
    margin-bottom: 4px; 
    position: relative; 
    background: rgba(255,255,255,0.015); 
    border-top: 1px solid rgba(255,255,255,0.03); 
    border-bottom: 1px solid rgba(255,255,255,0.03); 
}
.track.audio { height: 40px; background: rgba(34, 197, 94, 0.05); }
.track.overlay-track { height: 32px; background: rgba(255,255,255,0.02); }
.track.effect-track { height: 40px; background: rgba(217, 70, 239, 0.05); }
.track-dropzone { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    padding-left: 10px; 
    position: relative; 
}

.timeline-clip { 
    height: 85%; 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    border-radius: 6px; 
    overflow: hidden; 
    cursor: grab; 
    background-color: #1e293b; 
    border: 2px solid rgba(255,255,255,0.2); 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    background-size: cover; 
    background-position: center; 
    transition: border-color 0.2s, box-shadow 0.2s; 
    touch-action: none; 
}
.track.audio .timeline-clip { height: 80%; background-color: #22c55e; }
.track.overlay-track .timeline-clip { 
    height: 75%; 
    font-size: 9px; 
    line-height: 24px; 
}
.track.effect-track .timeline-clip { 
    height: 80%; 
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.4), rgba(124, 58, 237, 0.4)); 
    border-color: var(--effect-color); 
}
.timeline-clip:hover { 
    border-color: var(--white); 
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3); 
}
.timeline-clip.selected { 
    border-color: var(--accent); 
    box-shadow: 0 0 0 3px var(--accent); 
    z-index: 10; 
}
.timeline-clip.video { background-color: #0ea5e9; }
.timeline-clip.text { background-color: var(--warning); color: #000; }
.timeline-clip.transition { 
    background: rgba(255, 255, 255, 0.9); 
    border: 1px solid #fff; 
    border-radius: 4px; 
    z-index: 50; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #000; 
    font-size: 10px; 
}
.timeline-clip.effect { 
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.5), rgba(124, 58, 237, 0.5)); 
    border-color: var(--effect-color); 
}
.timeline-clip.effect.selected { 
    border-color: var(--effect-color); 
    box-shadow: 0 0 0 3px var(--effect-color); 
}

.clip-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.3); 
    z-index: 1; 
    pointer-events: none; 
}
.clip-name { 
    position: relative; 
    z-index: 2; 
    color: white; 
    font-size: 9px; 
    font-weight: 600; 
    padding: 0 6px; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.8); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    pointer-events: none; 
}
.timeline-clip.effect .clip-name { color: #fff; }
.duration-badge { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    background: #fbbf24; 
    color: #000; 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-size: 0.75em; 
    font-weight: 800; 
    opacity: 0; 
    transition: opacity 0.2s; 
    pointer-events: none; 
    z-index: 100; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); 
    white-space: nowrap; 
}
.timeline-clip.effect .duration-badge { background: var(--effect-color); color: #fff; }
.timeline-clip.is-dragging-active .duration-badge { opacity: 1; }
.timeline-clip.is-dragging-active .clip-name { opacity: 0; }

.resize-handle { 
    position: absolute; 
    top: 0; 
    bottom: 0; 
    cursor: col-resize; 
    z-index: 50; 
    touch-action: none; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    opacity: 0.7; 
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
}
.resize-handle.left { left: -20px; width: 44px; }
.resize-handle.right { right: -20px; width: 44px; }
.resize-handle.active { 
    opacity: 1 !important; 
    transform: scaleX(1.3) scaleY(1.1) !important; 
    filter: drop-shadow(0 0 20px var(--warning)); 
}
.handle-bar { 
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
    border-radius: 4px; 
    background: var(--warning); 
    width: 4px; 
    height: 50%; 
}
.resize-handle.active .handle-bar { 
    background: #ffdf5e !important; 
    box-shadow: 0 0 20px var(--warning) !important; 
    transform: scale(1.2); 
}

.context-menu { 
    position: fixed; 
    display: none; 
    z-index: 9999; 
    background: #1e293b; 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 8px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    min-width: 180px; 
    padding: 6px 0; 
    overflow: hidden; 
}
.context-menu.active { 
    display: block; 
    animation: fadeIn 0.1s ease-out; 
}
@keyframes fadeIn { 
    from { opacity: 0; transform: scale(0.95); } 
    to { opacity: 1; transform: scale(1); } 
}
.context-item { 
    padding: 12px 16px; 
    font-size: 0.9em; 
    cursor: pointer; 
    color: #fff; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    transition: all 0.15s; 
    position: relative; 
}
.context-item:hover:not(.disabled) { 
    background: rgba(56, 189, 248, 0.1); 
    color: #38bdf8; 
}
.context-item.disabled { 
    opacity: 0.4; 
    cursor: not-allowed; 
    color: #64748b; 
}
.context-item.delete { color: #ef4444; }
.context-item.delete:hover { 
    background: rgba(239, 68, 68, 0.1); 
    color: #ef4444; 
}
.context-separator { 
    height: 1px; 
    background: rgba(255,255,255,0.1); 
    margin: 5px 8px; 
}

#toast-notification { 
    position: fixed; 
    bottom: 80px; 
    left: 50%; 
    transform: translateX(-50%) translateY(100px); 
    background: rgba(56, 189, 248, 0.95); 
    color: #000; 
    padding: 12px 24px; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 0.9em; 
    z-index: 99999; 
    pointer-events: none; 
    opacity: 0; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
}
#toast-notification.show { 
    opacity: 1; 
    transform: translateX(-50%) translateY(0); 
}
#toast-notification.effect-toast {
    background: linear-gradient(135deg, rgba(217, 70, 239, 0.95), rgba(124, 58, 237, 0.95));
    color: #fff;
}

/* МОДАЛКИ */
.modal { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.85); 
    backdrop-filter: blur(10px); 
    z-index: 1000; 
    display: none; 
    justify-content: center; 
    align-items: center; 
    padding: 20px; 
}
.modal.active { 
    display: flex; 
    animation: modalFadeIn 0.3s ease; 
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Модалка настроек экспорта */
.export-modal .modal-content {
    background: linear-gradient(145deg, #0d1a25 0%, #0a131c 100%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(56, 189, 248, 0.1);
}
.export-header {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(124, 58, 237, 0.15));
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}
.export-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.3);
}
.export-title {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 8px 0;
}
.export-subtitle {
    font-size: 0.9em;
    color: var(--muted);
    margin: 0;
}
.project-info-card {
    margin: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}
.info-header {
    background: rgba(56, 189, 248, 0.1);
    padding: 12px 16px;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--border-color);
}
.info-item {
    background: rgba(11, 23, 32, 0.8);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.info-label {
    font-size: 0.7em;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-value {
    font-size: 1em;
    font-weight: 600;
    color: var(--white);
}
.settings-section {
    margin: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}
.section-title {
    font-size: 0.8em;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title i { color: var(--accent); }
.quality-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.quality-option { cursor: pointer; }
.quality-option input { display: none; }
.quality-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px 8px;
    text-align: center;
    transition: all 0.2s;
}
.quality-option:hover .quality-card { background: rgba(255, 255, 255, 0.06); }
.quality-option input:checked + .quality-card {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.1);
}
.quality-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65em;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.quality-badge.sd { background: #64748b; color: #fff; }
.quality-badge.hd { background: var(--accent); color: #000; }
.quality-badge.fhd { background: var(--success); color: #000; }
.quality-name {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}
.quality-desc {
    font-size: 0.7em;
    color: var(--muted);
}
.format-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.format-option { cursor: pointer; }
.format-option input { display: none; }
.format-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}
.format-option:hover .format-card { background: rgba(255, 255, 255, 0.06); }
.format-option input:checked + .format-card {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.1);
}
.format-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: var(--white);
}
.format-icon.apple { background: rgba(255, 255, 255, 0.9); color: #000; }
.format-icon.web { background: #4285f4; color: #fff; }
.format-icon.mkv { background: #ff6b35; color: #fff; }
.format-name {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--white);
}
.format-desc {
    font-size: 0.7em;
    color: var(--muted);
}
.extra-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.toggle-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.toggle-option:hover { background: rgba(255, 255, 255, 0.06); }
.toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.toggle-title {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--white);
}
.toggle-desc {
    font-size: 0.7em;
    color: var(--muted);
}
.modern-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    cursor: pointer;
}
.modern-toggle input { display: none; }
.modern-toggle .toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: 0.3s;
}
.modern-toggle .toggle-slider:before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.modern-toggle input:checked + .toggle-slider { background: var(--accent); }
.modern-toggle input:checked + .toggle-slider:before { transform: translateX(22px); }
.export-summary {
    margin: 0 20px 20px;
    padding: 16px 20px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.1), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.summary-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: var(--muted);
}
.summary-value {
    font-weight: 700;
    color: var(--accent);
    font-size: 1.1em;
}
.export-actions {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
}
.btn-secondary, .btn-primary {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}
.btn-primary {
    background: var(--gradient-primary);
    color: #000;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

/* Модалка рендеринга */
.render-modal .modal-content {
    background: linear-gradient(145deg, #0d1a25 0%, #0a131c 100%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}
.render-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}
.gear {
    position: absolute;
    color: var(--accent);
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.5));
}
.gear-large {
    font-size: 80px;
    top: 20px;
    left: 10px;
    animation: rotateGear 3s linear infinite;
}
.gear-small {
    font-size: 50px;
    top: 0;
    right: 10px;
    color: var(--accent2);
    animation: rotateGearReverse 2s linear infinite;
}
.gear-tiny {
    font-size: 30px;
    bottom: 10px;
    right: 30px;
    color: var(--success);
    animation: rotateGear 1.5s linear infinite;
}
@keyframes rotateGear {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes rotateGearReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}
.render-title {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 8px 0;
}
.render-status {
    font-size: 0.9em;
    color: var(--muted);
    margin: 0 0 30px 0;
}
.render-warning-box {
    margin: 20px 0;
    padding: 15px;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
}
.render-warning-box i {
    color: #facc15;
    font-size: 1.2em;
    margin-top: 2px;
    flex-shrink: 0;
}
.render-warning-box > div {
    flex: 1;
}
.render-warning-box > div > div:first-child {
    font-weight: 600;
    color: #facc15;
    font-size: 0.9em;
    margin-bottom: 4px;
}
.render-warning-box > div > div:last-child {
    font-size: 0.85em;
    color: #cbd5e1;
    line-height: 1.5;
}
.progress-container { margin-bottom: 24px; }
.progress-track {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}
.progress-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
    animation: pulseGlow 1.5s ease-in-out infinite;
}
@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.progress-percent {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--accent);
}
.progress-time {
    font-size: 0.8em;
    color: var(--muted);
}
.render-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85em;
    color: var(--muted);
}
.detail-item i { color: var(--accent); }
.btn-cancel {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-cancel:hover { background: rgba(239, 68, 68, 0.2); }

/* Модалка успеха */
.success-modal .modal-content {
    background: linear-gradient(145deg, #0d1a25 0%, #0a131c 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}
.success-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
}
.success-circle {
    width: 100px;
    height: 100px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #000;
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.4);
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes successPop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.success-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}
.success-particles::before,
.success-particles::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--success);
    border-radius: 50%;
    animation: ripple 1.5s ease-out infinite;
}
.success-particles::after { animation-delay: 0.5s; }
@keyframes ripple {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}
.success-title {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--success);
    margin: 0 0 8px 0;
}
.success-subtitle {
    font-size: 0.9em;
    color: var(--muted);
    margin: 0 0 30px 0;
}
.result-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    text-align: left;
}
.result-preview {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(124, 58, 237, 0.2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent);
}
.result-info { flex: 1; min-width: 0; }
.result-name {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.result-meta {
    font-size: 0.8em;
    color: var(--muted);
}
.success-actions { display: flex; gap: 12px; }
.success-actions .btn-secondary,
.success-actions .btn-primary { flex: 1; }
.btn-download { text-decoration: none; }

/* Подсказка для субтитров */
.subtitle-warning-box {
    margin: 0 0 25px 0;
    padding: 15px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
}
.subtitle-warning-box i {
    color: #ef4444;
    font-size: 1.2em;
    margin-top: 2px;
    flex-shrink: 0;
}
.subtitle-warning-box > div {
    flex: 1;
}
.subtitle-warning-box > div > div:first-child {
    font-weight: 600;
    color: #ef4444;
    font-size: 0.9em;
    margin-bottom: 4px;
}
.subtitle-warning-box > div > div:last-child {
    font-size: 0.85em;
    color: #cbd5e1;
    line-height: 1.5;
}

/* === SEO СЕКЦИЯ === */
.seo-section {
    background: linear-gradient(180deg, #050a10 0%, #071018 100%);
    border-top: 1px solid var(--border-color);
    padding: 60px 20px;
    position: relative;
    z-index: 5;
}

.seo-container {
    max-width: 900px;
    margin: 0 auto;
}

.seo-section h1 {
    font-size: 2.2em;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    line-height: 1.3;
}

.seo-section h2 {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--white);
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.seo-intro {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--muted);
    margin-bottom: 30px;
}

.seo-intro strong {
    color: var(--white);
    font-weight: 600;
}

.seo-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.seo-list li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    font-size: 1em;
    line-height: 1.6;
    color: var(--muted);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.seo-list li:last-child {
    border-bottom: none;
}

.seo-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.seo-list li strong {
    color: var(--white);
    font-weight: 600;
}

.seo-section p {
    font-size: 1em;
    line-height: 1.8;
    color: var(--muted);
    margin-bottom: 20px;
}

.seo-section p strong {
    color: var(--white);
    font-weight: 600;
}

.seo-cta {
    text-align: center;
    margin: 40px 0;
}

.btn-seo {
    display: inline-block;
    padding: 16px 32px;
    background: var(--gradient-primary);
    color: #021018;
    font-weight: 700;
    font-size: 1em;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}

.btn-seo:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.4);
}

.faq-item {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.faq-question {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 10px;
}

.faq-answer {
    font-size: 0.95em;
    line-height: 1.7;
    color: var(--muted);
    margin: 0;
}

.faq-answer strong {
    color: var(--white);
}

/* --- МОБИЛЬНАЯ ВЕРСИЯ --- */
@media (max-width: 768px) {
    .editor-wrapper {
        height: auto;
        min-height: 100vh;
    }
    
    .main-area { 
        flex-direction: column; 
        height: auto;
        flex: 0 0 auto !important;   /* ← убирает пустоту между плеером и таймлайном */
    }
    .sidebar-tabs { display: none !important; }
    /* МОБИЛЬНЫЙ ПЛЕЕР — ЕЩЁ -20% (таймлайн теперь полностью видно) */
    player-area { 
        order: 1; 
        flex: 0 0 39vh !important;           
        max-height: 39vh !important;
        border-bottom: 1px solid var(--border-color); 
        padding: 3px 5px 4px;                /* сильно уменьшили отступы */
        display: flex; 
        flex-direction: column; 
        justify-content: flex-start; 
        background: #050a10;
    }

    .player-wrapper { 
        width: 100%; 
        flex: 1; 
        max-height: 27vh;                    
        display: flex; 
        align-items: center; 
        justify-content: center; 
        aspect-ratio: 9/16;
        background: #000; 
        margin-bottom: 3px;
        border-radius: 8px;
        overflow: hidden;
    }

    .controls { 
        margin-top: 1px !important; 
        margin-bottom: 2px !important; 
    }
    canvas { 
        width: 100%; 
        height: 100%; 
        max-width: 100%;
        max-height: 100%;
        object-fit: contain; 
        box-shadow: none;
        display: block;
    }
    .controls { 
        margin-top: 0; 
        margin-bottom: 5px; 
        background: rgba(11,23,32,0.8); 
        backdrop-filter: blur(5px); 
        padding: 4px 15px; 
    }
    
    .mobile-tools-grid { 
        display: grid; 
        grid-template-columns: repeat(6, 1fr);
        gap: 2px;
        width: 100%; 
        padding: 5px 2px; 
        padding-bottom: 15px; 
        background: transparent; 
        flex-shrink: 0; 
    }
    .tool-btn-big { 
        background: rgba(255,255,255,0.02); 
        border: 1px solid rgba(255,255,255,0.08); 
        border-radius: 6px; 
        padding: 4px 0;
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        justify-content: center; 
        gap: 2px; 
        color: #9aa4b2; 
        font-size: 0.45em;
        font-weight: 600; 
        cursor: pointer; 
        transition: 0.2s; 
    }
    .tool-btn-big:active { 
        background: rgba(56, 189, 248, 0.1); 
        color: var(--accent); 
        border-color: var(--accent); 
    }
    .tool-btn-big .icon-box { 
        font-size: 0.9em; 
        margin-bottom: 1px; 
    }
    
    .timeline-wrapper { 
        order: 2; 
        flex: 0 0 auto; 
        height: 400px; 
        min-height: 400px;
    }
    .timeline-scroll-area { 
        padding-bottom: 20px; 
        overflow-y: auto; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
        overscroll-behavior: none; 
    }
    .desktop-hint { display: none; }
    .media-bin { display: none; }
    .media-bin.mobile-modal { 
        display: flex; 
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100%; 
        z-index: 2000; 
        background: #0b1720; 
        padding-top: 50px; 
        flex-direction: column; 
    }
    .media-bin.mobile-top-drawer { 
        display: flex; 
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 250px; 
        z-index: 2000; 
        background: #0b1720; 
        padding-top: 40px; 
        flex-direction: column; 
        border-bottom: 1px solid var(--accent); 
        box-shadow: 0 5px 20px rgba(0,0,0,0.5); 
    }
    .media-bin.mobile-top-drawer #mobileBinControls { display: none !important; }
    .media-bin.mobile-top-drawer .bin-grid { 
        grid-template-columns: repeat(4, 1fr); 
        gap: 5px; 
        padding: 5px; 
    }
    .media-bin.mobile-top-drawer .transition-item { aspect-ratio: 1/1; }
    .media-bin.mobile-top-drawer .transition-icon { font-size: 1.2em; }
    .media-bin.mobile-top-drawer .item-label { font-size: 0.6em; }
    .media-bin.mobile-modal .bin-grid { 
        grid-template-columns: repeat(3, 1fr); 
        padding: 10px; 
        overflow-y: auto; 
    }
    .close-media-btn { 
        position: absolute; 
        top: 10px; 
        right: 15px; 
        background: none; 
        border: none; 
        color: #fff; 
        font-size: 1.5em; 
        display: block; 
        z-index: 2002; 
    }
    #mobileBinControls { 
        display: flex !important; 
        gap: 10px !important; 
        background: #0b1720 !important; 
        padding: 15px !important; 
        border-top: 1px solid var(--border-color) !important; 
        padding-bottom: 25px !important; 
    }
    #mobileBinControls button { 
        flex: 1 !important; 
        margin: 0 !important; 
        height: 45px !important; 
        border-radius: 8px !important; 
        font-size: 0.9em !important; 
        font-weight: 700 !important; 
        justify-content: center !important; 
        display: flex !important; 
        align-items: center !important; 
    }
    #mobileBinControls .upload-btn { margin-bottom: 0 !important; }
    #mobileBinControls .export-btn { 
        background: var(--gradient-primary) !important; 
        color: #000 !important; 
    }
    
    #ratioSelect, .ratio-select { 
        background: rgba(11, 18, 25, 0.95); 
        font-size: 0.8em; 
        padding: 3px 6px; 
        padding-right: 20px; 
        background-position: right 4px center; 
    }
    
    .properties-panel { 
        position: fixed; 
        top: auto; 
        right: 0; 
        bottom: 0; 
        left: 0; 
        z-index: 2100; 
        width: 100% !important; 
        height: auto; 
        max-height: 60vh; 
        min-height: 200px; 
        border-left: none; 
        border-top: 1px solid var(--border-color); 
        background: rgba(11, 23, 32, 0.98); 
        border-radius: 20px 20px 0 0; 
        transform: translateY(100%); 
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
        opacity: 1; 
        box-shadow: 0 -10px 40px rgba(0,0,0,0.8); 
    }
    .properties-panel.active { 
        transform: translateY(0); 
        width: 100% !important; 
        opacity: 1; 
    }
    .panel-drag-handle { 
        width: 40px; 
        height: 4px; 
        background: rgba(255,255,255,0.3); 
        border-radius: 2px; 
        margin: 12px auto; 
        cursor: grab; 
    }
    .panel-drag-handle:active { cursor: grabbing; }
    .close-prop-btn { 
        padding: 10px; 
        font-size: 1.5em; 
    }
    .resize-handle { 
        width: 52px !important; 
        opacity: 0.7; 
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
    }
    .resize-handle.left { left: -24px !important; }
    .resize-handle.right { right: -24px !important; }
    .resize-handle.active { 
        opacity: 1 !important; 
        transform: scaleX(1.3) scaleY(1.1) !important; 
        filter: drop-shadow(0 0 25px var(--warning)) !important; 
    }
    .handle-bar { 
        width: 10px !important; 
        height: 65% !important; 
    }
    .resize-handle.active .handle-bar { 
        width: 14px !important; 
        height: 80% !important; 
        background: #ffdf5e !important; 
        box-shadow: 0 0 25px var(--warning) !important; 
        transform: scale(1.2); 
    }
    .timeline-clip { cursor: grab !important; }
    .timeline-clip:active { cursor: grabbing !important; }
    .context-menu { min-width: 200px; }
    .context-item { padding: 15px 20px; font-size: 1em; }
    .upload-btn { font-size: 0.8em; padding: 10px; }
    
    .mask-type-selector { flex-direction: column; }
    .mask-type-btn { 
        flex-direction: row; 
        justify-content: center; 
        padding: 12px; 
    }

    .instruction-hint.drag-hint {
        font-size: 0.75em;
        padding: 10px 12px;
        margin-bottom: 8px;
    }
    .instruction-hint.drag-hint i {
        font-size: 1.2em;
        display: block;
        margin-bottom: 4px;
        margin-right: 0;
    }
    @keyframes mobilePulse {
        0%, 100% { opacity: 0.9; transform: scale(1); }
        50% { opacity: 1; transform: scale(1.01); }
    }
    .instruction-hint.drag-hint {
        animation: mobilePulse 1.5s infinite;
    }
    #textPanel #mobileBinControls {
        display: none !important;
    }
    .timeline-clip.text {
        border: 2px solid var(--warning) !important;
        box-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
    }
    .timeline-clip.text.selected {
        box-shadow: 0 0 0 3px var(--warning), 0 0 15px rgba(250, 204, 21, 0.8) !important;
    }
    .transition-item.disabled {
        opacity: 0.35;
        filter: grayscale(70%);
    }
    .transition-item.disabled .item-preview {
        opacity: 0.4;
    }
    .transition-item.disabled .transition-icon {
        opacity: 0.25;
    }
    .transition-item.disabled .item-label {
        font-size: 0.7em;
    }

    /* SEO секция на мобильных */
    .seo-section {
        padding: 40px 15px;
    }
    .seo-section h1 {
        font-size: 1.6em;
    }
    .seo-section h2 {
        font-size: 1.2em;
        margin-top: 30px;
    }
    .seo-intro {
        font-size: 1em;
    }
    .seo-list li {
        padding-left: 25px;
        font-size: 0.95em;
    }
    .btn-seo {
        padding: 14px 24px;
        font-size: 0.95em;
    }
    .faq-item {
        padding: 15px;
    }
    .faq-question {
        font-size: 1em;
    }
}

/* Медиа запросы для модалок на мобильных */
@media (max-width: 768px) {
    .export-modal .modal-content,
    .render-modal .modal-content,
    .success-modal .modal-content {
        max-width: 100%;
        margin: 10px;
        border-radius: 20px;
    }
    .quality-options {
        grid-template-columns: 1fr;
    }
    .format-grid {
        grid-template-columns: 1fr;
    }
    .export-header {
        padding: 20px;
    }
    .export-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    .export-title {
        font-size: 1.2em;
    }
    .settings-section {
        margin: 12px;
        padding: 16px;
    }
    .render-animation {
        transform: scale(0.8);
    }
    .success-circle {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
}