/* =========================================================
   ОСНОВНОЙ БЛОК
   ========================================================= */

.clipsub-video-tools {
    width: 100%;
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 18px;
}

.clipsub-video-tools-header {
    text-align: center;
    margin-bottom: 25px;
}

.clipsub-video-tools-header h2 {
    margin: 0 0 10px;
    font-size: 32px;
}

.clipsub-video-tools-header p {
    margin: 0;
    color: #666;
}

.clipsub-video-tools-upload {
    padding: 35px;
    text-align: center;
    border: 2px dashed #cfd8e3;
    border-radius: 15px;
    background: #fafcff;
}

.clipsub-video-tools-upload label {
    display: block;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}


/* =========================================================
   РЕДАКТОР
   ========================================================= */

.clipsub-editor {
    position: fixed;
    inset: 0;

    z-index: 999999;

    display: flex;
    flex-direction: column;

    width: 100vw;
    height: 100vh;
    height: 100dvh;

    overflow: hidden;

    background: #10234a;
    color: #ffffff;
}


/* =========================================================
   ВЕРХНЯЯ ПАНЕЛЬ
   ========================================================= */

.clipsub-editor-top {
    flex: 0 0 auto;

    min-height: 58px;

    display: flex;
    align-items: center;

    gap: 20px;

    padding: 8px 24px;

    box-sizing: border-box;

    background: #ffffff;

    color: #1f2937;

    border-bottom: 1px solid #e5e7eb;
}

.clipsub-editor-logo {
    display: flex;
    align-items: center;
    gap: 10px;

    white-space: nowrap;
}

.clipsub-editor-logo strong {
    font-size: 20px;
    color: #1769d1;
}

.clipsub-editor-logo span {
    color: #64748b;
    font-size: 13px;
}

.clipsub-editor-file {
    flex: 1;

    min-width: 0;

    text-align: center;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #64748b;
    font-size: 13px;
}

.clipsub-close-button {
    width: 38px;
    height: 38px;

    border: 1px solid #dbe2ea;
    border-radius: 50%;

    background: #f5f8fc;
    color: #42617f;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    transition: 0.2s ease;
}

.clipsub-close-button:hover {
    background: #eaf3ff;
    color: #1769d1;
}


/* =========================================================
   ИНСТРУМЕНТЫ
   ========================================================= */

.clipsub-editor-tools {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    padding: 7px 24px;

    background: #1769d1;

    overflow-x: auto;
}

.clipsub-editor-tool {
    min-height: 42px;

    padding: 0 20px;

    border: 0;
    border-right: 1px solid rgba(255,255,255,0.18);

    background: transparent;

    color: #eaf4ff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    white-space: nowrap;

    transition: 0.2s ease;
}

.clipsub-editor-tool:hover {
    background: rgba(255,255,255,0.12);
}

.clipsub-editor-tool.active {
    background: #ffffff;
    color: #1769d1;

    border-radius: 8px;
}


/* =========================================================
   ЦЕНТРАЛЬНАЯ ОБЛАСТЬ
   ========================================================= */

.clipsub-editor-main {
    flex: 1 1 auto;

    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


/* =========================================================
   ВИДЕО
   ========================================================= */

.clipsub-video-stage {
    flex: 1 1 auto;

    min-height: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 15px 25px;

    box-sizing: border-box;

    overflow: hidden;

    background: #102b5a;
}

.clipsub-video-stage video {
    display: block;

    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 100%;

    object-fit: contain;

    background: #000000;

    border-radius: 6px;
}


/* =========================================================
   РАБОЧАЯ ОБЛАСТЬ
   ========================================================= */

.clipsub-editor-workspace {
    flex: 0 0 auto;

    padding: 12px 25px 15px;

    box-sizing: border-box;

    background: #17376f;
}


/* =========================================================
   ОБРЕЗКА
   ========================================================= */

.clipsub-trim-workspace {
    width: 100%;
}

.clipsub-trim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 10px;
}

.clipsub-trim-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.clipsub-trim-title strong {
    font-size: 15px;
}

.clipsub-trim-title span {
    color: #b9c9df;
    font-size: 11px;
}

.clipsub-trim-times {
    display: flex;
    gap: 8px;
}

.clipsub-trim-times > div {
    min-width: 75px;

    padding: 5px 9px;

    border-radius: 7px;

    background: rgba(0,0,0,0.18);
}

.clipsub-trim-times small {
    display: block;

    color: #aebfd8;

    font-size: 9px;
}

.clipsub-trim-times strong {
    color: #ffffff;
    font-size: 13px;
}


/* =========================================================
   ТАЙМЛАЙН
   ========================================================= */

.clipsub-timeline-area {
    width: 100%;
}

.clipsub-timeline {
    position: relative;

    width: 100%;
    height: 78px;

    overflow: hidden;

    border-radius: 7px;

    background: #07152f;

    user-select: none;

    touch-action: none;
}

.clipsub-timeline-frames {
    position: absolute;
    inset: 0;

    display: flex;
}

.clipsub-timeline-frame {
    flex: 1 1 0;

    min-width: 0;

    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    border-right: 1px solid rgba(0,0,0,0.3);
}


/* Затемнение невыбранных участков */

.clipsub-timeline-dim {
    position: absolute;
    top: 0;
    bottom: 0;

    background: rgba(4, 16, 35, 0.68);

    z-index: 2;

    pointer-events: none;
}

.clipsub-timeline-dim-left {
    left: 0;
}

.clipsub-timeline-dim-right {
    right: 0;
}


/* Выбранный участок */

.clipsub-timeline-selected {
    position: absolute;
    top: 0;
    bottom: 0;

    border-top: 3px solid #13cbed;
    border-bottom: 3px solid #13cbed;

    box-sizing: border-box;

    z-index: 3;

    pointer-events: none;
}


/* =========================================================
   РУЧКИ НАЧАЛА И КОНЦА
   ========================================================= */

.clipsub-timeline-handle {
    position: absolute;

    top: -1px;
    bottom: -1px;

    width: 22px;

    margin-left: -11px;

    border-radius: 5px;

    background: #13cbed;

    box-shadow: 0 0 0 2px rgba(255,255,255,0.25);

    cursor: ew-resize;

    z-index: 6;

    touch-action: none;

    transition: background 0.15s ease;
}

.clipsub-timeline-handle:hover {
    background: #08b5d5;
}

.clipsub-timeline-handle span {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    color: #ffffff;

    font-size: 22px;
    font-weight: bold;

    line-height: 1;
}


/* =========================================================
   ЛИНИЯ ТЕКУЩЕГО ВРЕМЕНИ
   ========================================================= */

.clipsub-playhead {
    position: absolute;

    top: 0;
    bottom: 0;

    width: 2px;

    background: #ffffff;

    z-index: 7;

    pointer-events: none;

    box-shadow: 0 0 4px rgba(0,0,0,0.5);
}


/* =========================================================
   ШКАЛА
   ========================================================= */

.clipsub-timeline-scale {
    display: flex;
    justify-content: space-between;

    margin-top: 4px;

    color: #a5b7d0;

    font-size: 10px;
}


/* =========================================================
   ВЫБРАННЫЙ ФРАГМЕНТ
   ========================================================= */

.clipsub-selected-info {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin-top: 7px;

    color: #b8c9df;

    font-size: 12px;
}

.clipsub-selected-info strong {
    color: #ffffff;
}


/* =========================================================
   ГЛАВНАЯ КНОПКА
   ========================================================= */

.clipsub-main-action {
    display: block;

    width: 100%;
    max-width: 300px;

    margin: 10px auto 0;

    padding: 12px 20px;

    border: 0;
    border-radius: 9px;

    background: #2f80ed;
    color: #ffffff;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}

.clipsub-main-action:hover {
    background: #1f6fd1;
    transform: translateY(-1px);
}

.clipsub-main-action:active {
    background: #1769c2;
    transform: translateY(0);
}


/* =========================================================
   СООБЩЕНИЕ
   ========================================================= */

.clipsub-temporary-message {
    max-width: 700px;

    margin: 9px auto 0;

    padding: 9px 12px;

    border-radius: 7px;

    background: rgba(255,255,255,0.1);

    color: #dce8f8;

    text-align: center;

    font-size: 11px;
}


/* =========================================================
   СЖАТИЕ И РАЗМЕР
   ========================================================= */

.clipsub-simple-workspace {
    width: 100%;
}

.clipsub-simple-title {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 10px;
}

.clipsub-simple-title strong {
    font-size: 15px;
}

.clipsub-simple-title span {
    color: #b9c9df;
    font-size: 11px;
}

.clipsub-quality-buttons,
.clipsub-size-buttons {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 10px;
}

.clipsub-quality-buttons button,
.clipsub-size-buttons button {
    padding: 11px;

    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;

    background: #214b88;
    color: #ffffff;

    cursor: pointer;

    transition: 0.2s ease;
}

.clipsub-quality-buttons button:hover,
.clipsub-size-buttons button:hover {
    background: #2861a9;
    border-color: #69b9ff;
}

.clipsub-quality-buttons button.active,
.clipsub-size-buttons button.active {
    background: #2f80ed;
    border-color: #8bc9ff;
    box-shadow: 0 0 0 2px rgba(47,128,237,0.3);
}

.clipsub-quality-buttons strong,
.clipsub-quality-buttons small,
.clipsub-size-buttons strong,
.clipsub-size-buttons small {
    display: block;
}

.clipsub-quality-buttons strong,
.clipsub-size-buttons strong {
    font-size: 12px;
}

.clipsub-quality-buttons small,
.clipsub-size-buttons small {
    margin-top: 3px;

    color: #d2e1f3;

    font-size: 10px;
}


/* =========================================================
   НИЖНЯЯ ПАНЕЛЬ
   ========================================================= */

.clipsub-editor-dock {
    flex: 0 0 auto;

    min-height: 62px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 8px 25px;

    box-sizing: border-box;

    background: #ffffff;

    color: #1f2937;
}

.clipsub-play-button {
    width: 46px;
    height: 40px;

    flex: 0 0 auto;

    border: 0;
    border-radius: 8px;

    background: #2f80ed;
    color: #ffffff;

    font-size: 16px;

    cursor: pointer;

    transition: 0.2s ease;
}

.clipsub-play-button:hover {
    background: #1f6fd1;
}

.clipsub-play-button:active {
    background: #1769c2;
}

.clipsub-current-time {
    display: flex;
    align-items: center;

    gap: 5px;

    white-space: nowrap;

    color: #718096;

    font-size: 12px;
}

.clipsub-current-time strong {
    color: #26364d;
}

.clipsub-dock-status {
    flex: 1;

    text-align: center;

    color: #64748b;

    font-size: 12px;
}

.clipsub-save-button {
    min-width: 105px;
    height: 40px;

    padding: 0 18px;

    border: 0;
    border-radius: 8px;

    background: #2f80ed;
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.2s ease;
}

.clipsub-save-button:hover {
    background: #1f6fd1;
}

.clipsub-save-button:active {
    background: #1769c2;
}


/* =========================================================
   ВСПЛЫВАЮЩЕЕ СООБЩЕНИЕ
   ========================================================= */

.clipsub-editor-message {
    position: absolute;

    left: 50%;
    bottom: 80px;

    transform: translateX(-50%);

    max-width: 90%;

    padding: 12px 18px;

    border-radius: 9px;

    background: #ffffff;
    color: #24344d;

    box-shadow: 0 5px 25px rgba(0,0,0,0.25);

    font-size: 13px;

    z-index: 30;
}


/* =========================================================
   ТЕЛЕФОН
   ========================================================= */

@media (max-width: 700px) {

    .clipsub-video-tools {
        margin: 0;
        padding: 0;
        max-width: none;
    }

    .clipsub-video-tools-header,
    .clipsub-video-tools-upload {
        display: none;
    }


    /* Верх */

    .clipsub-editor-top {
        min-height: 46px;

        padding: 5px 9px;

        gap: 8px;
    }

    .clipsub-editor-logo strong {
        font-size: 16px;
    }

    .clipsub-editor-logo span {
        display: none;
    }

    .clipsub-editor-file {
        font-size: 10px;
    }

    .clipsub-close-button {
        width: 32px;
        height: 32px;

        font-size: 22px;
    }


    /* Инструменты */

    .clipsub-editor-tools {
        padding: 4px 6px;
    }

    .clipsub-editor-tool {
        flex: 1;

        min-height: 37px;

        padding: 0 6px;

        font-size: 12px;
    }


    /* Видео */

    .clipsub-video-stage {
        padding: 5px 7px;
    }

    .clipsub-video-stage video {
        max-width: 100%;
        max-height: 100%;
    }


    /* Рабочая область */

    .clipsub-editor-workspace {
        padding: 7px 7px 9px;
    }


    /* Заголовок */

    .clipsub-trim-header {
        gap: 8px;

        margin-bottom: 6px;
    }

    .clipsub-trim-title strong {
        font-size: 12px;
    }

    .clipsub-trim-title span {
        font-size: 9px;
    }


    /* Время */

    .clipsub-trim-times {
        gap: 4px;
    }

    .clipsub-trim-times > div {
        min-width: 58px;

        padding: 4px 6px;
    }

    .clipsub-trim-times small {
        font-size: 8px;
    }

    .clipsub-trim-times strong {
        font-size: 11px;
    }


    /* Таймлайн */

    .clipsub-timeline {
        height: 68px;
    }

    .clipsub-timeline-handle {
        width: 24px;

        margin-left: -12px;
    }

    .clipsub-timeline-handle span {
        font-size: 20px;
    }


    .clipsub-selected-info {
        margin-top: 5px;

        font-size: 10px;
    }


    /* Кнопка */

    .clipsub-main-action {
        max-width: none;

        margin-top: 7px;

        padding: 10px;

        font-size: 13px;
    }


    /* Нижняя панель */

    .clipsub-editor-dock {
        min-height: 53px;

        padding: 6px 7px;

        gap: 6px;
    }

    .clipsub-play-button {
        width: 39px;
        height: 35px;
    }

    .clipsub-current-time {
        font-size: 10px;
    }

    .clipsub-dock-status {
        font-size: 9px;
    }

    .clipsub-save-button {
        min-width: 82px;

        height: 35px;

        padding: 0 10px;

        font-size: 12px;
    }


    /* Сжатие / размер */

    .clipsub-simple-title {
        margin-bottom: 7px;
    }

    .clipsub-simple-title strong {
        font-size: 12px;
    }

    .clipsub-simple-title span {
        font-size: 9px;
    }

    .clipsub-quality-buttons {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .clipsub-quality-buttons button {
        padding: 7px;
    }

    .clipsub-quality-buttons small {
        display: inline;
        margin-left: 5px;
    }

    .clipsub-size-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .clipsub-size-buttons button {
        padding: 9px 5px;
    }

}


/* =========================================================
   ОЧЕНЬ МАЛЕНЬКИЙ ЭКРАН
   ========================================================= */

@media (max-width: 380px) {

    .clipsub-dock-status {
        display: none;
    }

    .clipsub-video-stage {
        padding: 3px 5px;
    }

    .clipsub-editor-workspace {
        padding-left: 5px;
        padding-right: 5px;
    }

}
.clipsub-video-tools-upload input[type="file"] {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 12px;
    box-sizing: border-box;
    border: 0;
    border-radius: 10px;
    background: #2f80ed;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.clipsub-video-tools-upload input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    background: #2f80ed;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}
/* Начальные кнопки инструментов */
.clipsub-video-tools-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.clipsub-video-tools-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border: 0;
    border-radius: 9px;
    background: #2f80ed;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.clipsub-video-tools-actions button:hover {
    background: #1f6fd1;
    transform: translateY(-1px);
}

.clipsub-video-tools-actions button:active {
    background: #1769c2;
    transform: translateY(0);
}

/* На телефоне кнопки не сливаются */
@media (max-width: 700px) {
    .clipsub-video-tools-actions {
        gap: 10px;
        padding: 0 12px;
    }

    .clipsub-video-tools-actions button {
        width: 100%;
        max-width: 320px;
    }
}
@media (max-width: 700px) {
    .clipsub-video-tools-upload {
        display: block !important;
        padding: 20px 12px;
    }
}
/* =========================================================
   БЛОК СКАЧИВАНИЯ ГОТОВОГО ВИДЕО
   ========================================================= */

.clipsub-download-result {
    width: 100%;
    max-width: 560px;
    margin: 14px auto 0;
    padding: 18px;
    box-sizing: border-box;
    border-radius: 14px;
    background: #ffffff;
    text-align: center;
}

.clipsub-download-title {
    margin-bottom: 6px;
    color: #1769d1;
    font-size: 20px;
    font-weight: 800;
}

.clipsub-download-text {
    margin-bottom: 14px;
    color: #4A6A85;
    font-size: 14px;
}

.clipsub-download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    padding: 0 20px;
    box-sizing: border-box;
    border-radius: 12px;
    background: #2f80ed;
    color: #ffffff !important;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.clipsub-download-button:hover {
    background: #1f6fd1;
    transform: translateY(-1px);
}

.clipsub-download-button:active {
    background: #1769c2;
    transform: translateY(0);
}

.clipsub-download-hint {
    margin-top: 10px;
    color: #718096;
    font-size: 11px;
    line-height: 1.4;
}


/* =========================================================
   СКАЧИВАНИЕ НА ТЕЛЕФОНЕ
   ========================================================= */

@media (max-width: 700px) {

    .clipsub-download-result {
        max-width: none;
        margin-top: 10px;
        padding: 12px 8px;
        border-radius: 10px;
    }

    .clipsub-download-title {
        margin-bottom: 4px;
        font-size: 18px;
    }

    .clipsub-download-text {
        margin-bottom: 9px;
        font-size: 12px;
    }

    .clipsub-download-button {
        min-height: 58px;
        padding: 0 12px;
        border-radius: 10px;
        font-size: 17px;
    }

    .clipsub-download-hint {
        margin-top: 7px;
        font-size: 10px;
    }

}