/* ============================= */
/* OVERLAY */
/* ============================= */

#scheme-view-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    /* затемнение */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* ============================= */
/* MAIN BOX */
/* ============================= */

.scheme-view-box {
    width: 97%;
    height: 97%;
    background: #f5f5f5;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    /* чтобы крестик позиционировался от неё */
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

#scheme-view-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.75);

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.25s ease;
}

#scheme-view-overlay.active {
    opacity: 1;
    pointer-events: auto;
}


/* ============================= */
/* LOADING */
/* ============================= */

.scheme-view-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f2f2f2;
    color: #444;
}

/* ============================= */
/* VIEWER AREA */
/* ============================= */

.scheme-view-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    cursor: grab;
}


/* Сцена для zoom/pan */
.viewer-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

.viewer-stage.dragging {
    cursor: grabbing;
}

.viewer-transform {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
}


/* Когда зажат drag */
.viewer-stage:active {
    cursor: grabbing;
}

.viewer-stage img {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Изображения */
.viewer-image {
    display: block;
}

/* Линия сравнения (будущее) */

#viewer-original,
#viewer-preview {
    position: absolute;
    top: 0;
    left: 0;
}

#viewer-preview {
    z-index: 10;
}

/* ============================= */
/* BOTTOM ACTIONS */
/* ============================= */

.scheme-view-actions {
    padding: 10px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    gap: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Кнопки */
.scheme-view-actions button {
    flex: 1;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* Отмена */
#scheme-view-cancel {
    background: linear-gradient(135deg, #f3eee9, #efe6dd);
    color: #7a5a43;
    box-shadow: 0 4px 10px rgba(180, 120, 60, 0.08);
    transition: all 0.25s ease;
    font-size: 18px;
}

/* Наведение */
#scheme-view-cancel:hover {
    background: linear-gradient(135deg, #f6e6d6, #f0d8c2);
    box-shadow: 0 6px 16px rgba(180, 120, 60, 0.15);
    transform: translateY(-1px);
}

/* Нажатие */
#scheme-view-cancel:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(180, 120, 60, 0.12);
}

/* Полная генерация */
.btn-main {
    font-size: 23px;
}

.btn-sub {
    font-size: 13px;
    margin-top: -9px;
}

/* Основной текст */
#scheme-view-full {
    width: 100%;
    padding: 10px 22px 22px 22px;
    border-radius: 14px;
    border: none;
    cursor: pointer;

    background: linear-gradient(90deg, #6a6ee8, #2ec76f);
    color: #ffffff;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;

    transition: all 0.25s ease;
    box-shadow: 0 10px 24px rgba(80, 100, 200, 0.25);
}

/* hover */
#scheme-view-full:hover {
    background: linear-gradient(90deg, #8f5df0, #b982ff);
    box-shadow: 0 10px 28px rgba(123, 77, 227, 0.4);
    transform: translateY(-2px);
}

/* active */
#scheme-view-full:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(123, 77, 227, 0.25);
}



/* Ползунок */
.scheme-view-top {
    padding: 18px 24px;
    background: #f7f7f7;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.scheme-view-top.visible {
    opacity: 1;
    pointer-events: auto;
}

#compare-range {
    -webkit-appearance: none;
    appearance: none;

    width: 100%;
    height: 8px;

    border-radius: 20px;
    outline: none;

    background: linear-gradient(
        90deg,
        #6a6ee8 0%,
        #2ec76f 50%,
        #ddd 50%
    );

    transition: background 0.2s ease;
}

/* бегунок */
#compare-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    width: 30%;
    height: 42px;
    border-radius: 8px;

    background: #ffffff;
    border: 3px solid #6a6ee8;

    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;

    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#compare-range::-webkit-slider-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

#compare-range::-webkit-slider-thumb:active {
    transform: scale(1);
}

#compare-range::-moz-range-thumb {
     width: 30%;
    height: 42px;
    border-radius: 8px;
    background: #ffffff;
    border: 3px solid #6a6ee8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;
}



.compare-slider-placeholder {
    width: 100%;
    height: 40px;
    background: #eaeaea;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding-left: 12px;
    color: #777;
    font-size: 14px;
}




.range-glow::-webkit-slider-thumb {
    box-shadow: 0 0 0 0 #bac4b9;
    animation: pulseRange 1.2s ease-in-out infinite;
}

.range-glow::-moz-range-thumb {
    box-shadow: 0 0 0 0 #bac4b9;
    animation: pulseRange 1.2s ease-in-out infinite;
}

@keyframes pulseRange {
    0% {
        box-shadow: 0 0 0 0 #bac4b9;
    }

    70% {
        box-shadow: 0 0 0 12px rgba(193, 138, 45, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(193, 138, 45, 0);
    }
}



.scheme-view-close {
    position: absolute;
    top: 91px;
    right: 22px;

    width: 130px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
    font-weight: 600;

    background: rgba(29, 14, 14, 0.822);
    color: #fff;

    border-radius: 10px;
    cursor: pointer;

    transition: all 0.2s ease;
    z-index: 50;
}

.scheme-view-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

@media (max-width: 680px) {

    .btn-sub {
        font-size: 12px;
    }

    .btn-main {
        font-size: 20px;
    }

    .scheme-view-full {
        padding: 1px 22px 7px 22px;
    }

    .scheme-view-close {
        left: 5px;
        right: auto;
        width: 90px;
        height: 52px;
        font-size: 14px;
        font-weight: 500;
    }
}