/* Compare Dialog - Full Page Overlay */
.compare-fullpage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.compare-fullpage-header {
    background: #1a1a1a;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
}

.compare-fullpage-header h2 {
    color: #fff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.compare-back-btn {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.compare-back-btn:hover {
    background: #0056b3;
}

.compare-controls-header {
    display: flex;
    gap: 10px;
}

.compare-zoom-btn {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    transition: background 0.3s;
}

.compare-zoom-btn:hover {
    background: #218838;
}

.compare-fullpage-body {
    flex: 1;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.compare-images-container {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: 100%;
}

.compare-images-container[data-image-count="2"] {
    gap: 60px;
}

.compare-images-container[data-image-count="3"] {
    gap: 40px;
}

.compare-image-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.compare-image-wrapper {
    width: 550px;
    height: 550px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid #007bff;
    background: #000;
    flex-shrink: 0;
    position: relative;
}

.compare-images-container[data-image-count="2"] .compare-image-wrapper {
    width: 650px;
    height: 650px;
}

.compare-images-container[data-image-count="3"] .compare-image-wrapper {
    width: 500px;
    height: 500px;
}

.compare-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    transition: filter 0.2s;
    transform-origin: center;
}

/* Stitch images - use object-fit contain to show full image */
.compare-image.stitch-image {
    object-fit: contain;
}

.compare-image-info {
    color: #fff;
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
}

.compare-image-info div {
    margin: 3px 0;
}

.compare-fullpage-footer {
    background: #1a1a1a;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    border-top: 1px solid #333;
}

.compare-control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.compare-control-group label {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
}

.compare-slider {
    width: 200px;
    height: 6px;
    border-radius: 3px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
}

.compare-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}

.compare-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
}

.compare-reset-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.compare-reset-btn:hover {
    background: #5a6268;
}

.compare-magnify-btn {
    background: #17a2b8;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.compare-magnify-btn:hover {
    background: #138496;
}

.compare-magnify-btn.active {
    background: #0c7c8c;
    border: 2px solid #ffc107;
}

/* Magnifying Glass for Compare Dialog */
.compare-magnifying-glass {
    position: absolute;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5),
                0 0 10px rgba(0, 123, 255, 0.3);
    background: #000;
    z-index: 10000;
}

.compare-magnifying-glass canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.compare-magnify-label {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffc107;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    pointer-events: none;
}

/* Responsive */
/* Tablet - iPad Pro 12.9" - 2732×2048 */
@media (min-width: 2732px) and (max-width: 3839px) and (min-height: 2048px) {
    .compare-image-wrapper {
        width: 620px;
        height: 620px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper {
        width: 700px;
        height: 700px;
    }

    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 550px;
        height: 550px;
    }

    .compare-images-container {
        gap: 50px;
    }

    .compare-slider {
        width: 220px;
    }
}

/* Tablet - iPad Pro 11" and 2560×1440/2560×1600 */
@media (min-width: 2048px) and (max-width: 2731px) {
    .compare-image-wrapper {
        width: 580px;
        height: 580px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper {
        width: 680px;
        height: 680px;
    }

    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 520px;
        height: 520px;
    }

    .compare-images-container {
        gap: 48px;
    }

    .compare-slider {
        width: 215px;
    }
}

/* Tablet - 1920×1080 (Full HD tablets) */
@media (min-width: 1920px) and (max-width: 2047px) and (min-height: 1080px) {
    .compare-image-wrapper {
        width: 520px;
        height: 520px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper {
        width: 600px;
        height: 600px;
    }

    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 480px;
        height: 480px;
    }

    .compare-images-container {
        gap: 45px;
    }

    .compare-slider {
        width: 210px;
    }
}

/* Desktop and tablets - 1600px and below */
@media (max-width: 1919px) and (min-width: 1601px) {
    .compare-image-wrapper {
        width: 450px;
        height: 450px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper {
        width: 520px;
        height: 520px;
    }

    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 400px;
        height: 400px;
    }

    .compare-images-container {
        gap: 42px;
    }
}

@media (max-width: 1600px) and (min-width: 1441px) {
    .compare-image-wrapper {
        width: 380px;
        height: 380px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper {
        width: 440px;
        height: 440px;
    }

    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 350px;
        height: 350px;
    }

    .compare-images-container {
        gap: 38px;
    }
}

/* Tablet - 1280×800 (common Android tablet resolution) */
@media (min-width: 1280px) and (max-width: 1440px) and (min-height: 800px) {
    .compare-image-wrapper {
        width: 340px;
        height: 340px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper {
        width: 390px;
        height: 390px;
    }

    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 310px;
        height: 310px;
    }

    .compare-images-container {
        gap: 35px;
    }

    .compare-slider {
        width: 180px;
    }
}

/* Lower resolutions - 1280x720, 1366x768 */
@media (max-width: 1440px) and (max-height: 799px) {
    .compare-image-wrapper {
        width: 300px;
        height: 300px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper {
        width: 350px;
        height: 350px;
    }

    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 280px;
        height: 280px;
    }

    .compare-images-container {
        gap: 30px;
    }
}

@media (max-width: 1024px) {
    .compare-image-wrapper {
        width: 250px;
        height: 250px;
        border-width: 4px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper {
        width: 300px;
        height: 300px;
    }

    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 230px;
        height: 230px;
    }

    .compare-images-container {
        gap: 20px;
    }

    .compare-fullpage-footer {
        padding: 15px 20px;
        gap: 20px;
    }

    .compare-slider {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .compare-fullpage-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .compare-controls-header {
        width: 100%;
        justify-content: flex-end;
    }

    .compare-fullpage-body {
        padding: 20px 10px;
    }

    .compare-images-container {
        flex-direction: column;
        gap: 30px;
    }

    .compare-image-wrapper {
        width: 280px;
        height: 280px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper,
    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 280px;
        height: 280px;
    }

    .compare-fullpage-footer {
        flex-direction: column;
        gap: 15px;
    }

    .compare-control-group {
        width: 100%;
        justify-content: space-between;
    }

    .compare-slider {
        flex: 1;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .compare-image-wrapper {
        width: 220px;
        height: 220px;
        border-width: 3px;
    }

    .compare-images-container[data-image-count="2"] .compare-image-wrapper,
    .compare-images-container[data-image-count="3"] .compare-image-wrapper {
        width: 220px;
        height: 220px;
    }

    .compare-image-info {
        font-size: 12px;
    }
}
