/* ============================================
   ENNEN/JÄLKEEN -VERTAILU
   ============================================ */
.aicg-comparison-modal-content {
    max-width: 900px;
}

.aicg-comparison-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.aicg-comp-stat {
    text-align: center;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 6px;
    border: 1px solid #dcdcde;
}

.aicg-comp-stat.original { border-color: #dba617; background: #fcf9e8; }
.aicg-comp-stat.webp { border-color: #2271b1; background: #f0f6fc; }
.aicg-comp-stat.avif { border-color: #00a32a; background: #edfaef; }

.aicg-comp-stat .format {
    font-weight: 700;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.aicg-comp-stat .size {
    font-size: 12px;
    color: #646970;
}

.aicg-comp-stat .saved {
    display: block;
    margin-top: 6px;
    font-weight: 600;
    color: #00a32a;
    font-size: 13px;
}

/* Slider */
.aicg-comparison-slider {
    position: relative;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dcdcde;
}

.aicg-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
}

.aicg-slider-before,
.aicg-slider-after {
    position: relative;
}

.aicg-slider-before img,
.aicg-slider-after img {
    width: 100%;
    height: auto;
    display: block;
}

.aicg-slider-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
}

.aicg-slider-after img {
    width: 200%;
    max-width: none;
}

.aicg-slider-label {
    position: absolute;
    top: 10px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

.aicg-slider-before .aicg-slider-label { right: 10px; }
.aicg-slider-after .aicg-slider-label { left: 10px; }

.aicg-slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #fff;
    cursor: ew-resize;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.aicg-slider-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #2271b1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: ew-resize;
}

/* Formaattivalitsin */
.aicg-comparison-format-switch {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.aicg-comparison-format-switch button {
    padding: 8px 20px;
    border: 1px solid #dcdcde;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.aicg-comparison-format-switch button.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.aicg-comparison-format-switch button:hover:not(.active) {
    background: #f0f6fc;
    border-color: #2271b1;
}

@media (max-width: 782px) {
    .aicg-comparison-stats {
        grid-template-columns: 1fr;
    }
}