/* Image Compressor - точная копия imagecompressor.com */

.yan-tools-image-compressor {
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Главная область - одна колонка */
.yan-tools-main {
    margin-bottom: 30px;
}

/* Левая панель */
.yan-tools-left-panel {
    min-height: 600px;
}

/* Информационная панель внизу */
.yan-tools-info-panel {
    margin-top: 30px;
}

.yan-tools-info-panel .yan-tools-info {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Заголовок */
.yan-tools-header {
    text-align: center;
    margin-bottom: 30px;
}

.yan-tools-header h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 300;
}

.yan-tools-header p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 10px;
    margin-left: auto;
    margin-right: auto;
}

/* Основной контент - двухколоночный макет */
.yan-tools-main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.yan-tools-left-panel {
    flex: 1;
    min-width: 0;
}

.yan-tools-right-panel {
    flex: 0 0 300px;
}


/* Кнопки управления и настройки - в одной строке для десктопа */
.yan-tools-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
}

/* Настройки сжатия - скрыты в десктопной версии, так как они в кнопках */
.yan-tools-settings {
    display: none;
}

/* Область загрузки */
.yan-tools-upload-zone {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    min-height: 200px;
}

.yan-tools-upload-content {
    text-align: center;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.3s ease;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.yan-tools-upload-zone.dragover {
    border-color: #007cba;
    background-color: #f0f8ff;
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0, 124, 186, 0.3);
}

.yan-tools-upload-zone.dragover .yan-tools-upload-content {
    border-color: #007cba;
    background: #e6f3ff;
}

.yan-tools-upload-zone.files-dropped {
    border-color: #28a745;
    background-color: #f0fff4;
    transform: scale(1.01);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.3);
}

.yan-tools-upload-zone.files-selected {
    border-color: #ffc107;
    background-color: #fffbf0;
    transform: scale(1.01);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

.yan-tools-upload-zone.has-images .yan-tools-upload-content {
    display: none;
}

.yan-tools-upload-content h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.yan-tools-upload-content p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1em;
}

/* Сетка изображений */
.yan-tools-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px 0;
    align-items: start;
}

/* Карусель изображений */
.yan-tools-images-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 200px));
    gap: 20px;
    padding: 20px 0;
    align-items: start;
    justify-content: start;
}

.yan-tools-image-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 200px;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.yan-tools-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 12px;
}

.yan-tools-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yan-tools-image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.yan-tools-image-item.active {
    border: 2px solid #007cba;
    box-shadow: 0 4px 16px rgba(0, 123, 186, 0.3);
}

.yan-tools-image-preview {
    position: relative;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f5f5f5;
}

.yan-tools-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Оверлей с процентом экономии */
.yan-tools-savings-overlay {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: #4CAF50;
    font-size: 14px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 3px;
    z-index: 2;
}

/* Кнопка удаления */
.yan-tools-delete-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: auto;
}

.yan-tools-image-item:hover .yan-tools-delete-btn {
    opacity: 1;
}

.yan-tools-delete-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.yan-tools-image-name {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 12px;
    word-break: break-word;
}

.yan-tools-btn-download {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #007cba;
    color: white;
}

.yan-tools-btn-download:hover:not(:disabled) {
    background: #005a87;
}

.yan-tools-btn-download:disabled {
    background: #ccc;
    cursor: not-allowed;
}


.yan-tools-option-group {
    min-width: 120px;
    max-width: 150px;
}

.yan-tools-option-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Стили для чекбокса копирайта */
.yan-tools-checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* Современный чекбокс как кнопка-переключатель */
.yan-tools-checkbox-label .yan-tools-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    cursor: pointer;
}

.yan-tools-checkbox-label span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    gap: 6px;
}

.yan-tools-checkbox-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    color: inherit;
    transition: transform 0.3s ease;
}

.yan-tools-checkbox-label .yan-tools-checkbox:checked + span .yan-tools-checkbox-plus {
    transform: rotate(45deg);
}

.yan-tools-checkbox-label .yan-tools-checkbox:checked + span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.yan-tools-checkbox-label:hover span {
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.yan-tools-checkbox-label .yan-tools-checkbox:checked + span:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.yan-tools-checkbox-label .yan-tools-checkbox:focus + span {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Настройки копирайта */
.yan-tools-copyright-settings {
    margin-top: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 15px;
    align-items: flex-start;
    overflow-x: auto;
    width: 100%;
    box-sizing: border-box;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    margin-top: 0;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.yan-tools-copyright-settings.show {
    max-height: 1000px;
    opacity: 1;
    padding: 15px;
    margin-top: 15px;
    pointer-events: auto;
}

.yan-tools-copyright-settings .yan-tools-option-group {
    margin-bottom: 0;
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 200px;
    width: auto;
    display: flex;
    flex-direction: column;
}

.yan-tools-copyright-settings .yan-tools-option-group:first-child {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 220px;
    width: auto;
}

/* Гарантируем горизонтальное расположение на больших экранах */
@media (min-width: 769px) {
    .yan-tools-copyright-settings {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }
    
    .yan-tools-copyright-settings .yan-tools-option-group {
        flex: 0 0 auto !important;
        min-width: 150px !important;
        max-width: 200px !important;
        width: auto !important;
    }
    
    .yan-tools-copyright-settings .yan-tools-option-group:first-child {
        flex: 0 0 auto !important;
        min-width: 180px !important;
        max-width: 220px !important;
        width: auto !important;
    }
}

.yan-tools-copyright-settings .yan-tools-option-group:last-child {
    margin-bottom: 0;
}

/* Превью копирайта */
.yan-tools-copyright-preview {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    min-height: 100px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yan-tools-copyright-preview img {
    display: block;
    border-radius: 4px;
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.yan-tools-copyright-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.yan-tools-copyright-remove:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.yan-tools-copyright-file-group {
    min-width: 180px;
    max-width: 220px;
}

.yan-tools-copyright-file-group .yan-tools-file-input {
    margin-bottom: 0;
}

/* Поле ввода файла */
.yan-tools-file-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.yan-tools-file-input:hover {
    border-color: #9ca3af;
}

.yan-tools-file-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Числовое поле ввода */
.yan-tools-number-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #333;
    transition: all 0.3s ease;
}

.yan-tools-number-input:hover {
    border-color: #9ca3af;
}

.yan-tools-number-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.yan-tools-input-suffix {
    margin-left: 5px;
    color: #666;
    font-size: 13px;
}

.yan-tools-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.yan-tools-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.yan-tools-select:hover {
    border-color: #cbd5e0;
}

.yan-tools-select:disabled {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

/* Кнопка скачать все */
.yan-tools-download-all {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Информационная панель внизу */
.yan-tools-info-panel .yan-tools-info h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

.yan-tools-info-panel .yan-tools-info h4 {
    color: #555;
    margin: 20px 0 10px 0;
    font-size: 18px;
}

.yan-tools-info-panel .yan-tools-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 16px;
}

/* Попап превью изображения */
.yan-tools-preview-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in-out;
}

/* Панель превью изображения (основной попап) */
.yan-tools-preview-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-in-out;
    overflow-y: auto;
    padding: 20px;
}

.yan-tools-preview-panel .yan-tools-preview-content {
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.yan-tools-preview-panel .yan-tools-preview-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.yan-tools-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.yan-tools-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 1200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.yan-tools-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.yan-tools-popup-header h3 {
    font-size: 1.3em;
    color: #333;
    margin: 0;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yan-tools-popup-body {
    display: flex;
    gap: 0;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.yan-tools-image-preview-container {
    flex: 1;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    overflow: auto;
    min-height: 500px;
}

.yan-tools-image-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Контейнер сравнения До/После */
.yan-tools-image-comparison-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.yan-tools-comparison-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yan-tools-comparison-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.yan-tools-comparison-original {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    object-fit: contain;
    object-position: left center;
}

.yan-tools-comparison-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.yan-tools-comparison-wrapper .yan-tools-comparison-container {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.yan-tools-comparison-compressed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: left center;
    display: block;
    z-index: 2;
    clip-path: inset(0 0 0 50%);
    will-change: clip-path;
}

.yan-tools-comparison-overlay {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    z-index: 3;
    pointer-events: none;
    background: transparent;
    clip-path: inset(0 0 0 0);
    will-change: left, width;
}

.yan-tools-comparison-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 10;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
    will-change: left;
}

.yan-tools-comparison-handle {
    display: none; /* Скрываем кнопку ползунка */
}

/* Метки "ДО" и "ПОСЛЕ" на ползунке сверху */
.yan-tools-comparison-label-before,
.yan-tools-comparison-label-after {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.yan-tools-comparison-label-before {
    margin-left: -30px;
}

.yan-tools-comparison-label-after {
    margin-left: 45px;
}

/* Индикаторы "ДО" и "ПОСЛЕ" */
.yan-tools-comparison-label {
    position: absolute;
    top: 15px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    z-index: 5;
}

.yan-tools-comparison-label-left {
    left: 15px;
}

.yan-tools-comparison-label-right {
    right: 15px;
}

.yan-tools-popup-sidebar {
    width: 280px;
    background: white;
    border-left: 1px solid #e5e7eb;
    padding: 30px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
}

/* Строка с настройками и ползунком качества */
.yan-tools-popup-settings-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.yan-tools-popup-settings {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0; /* Позволяет сжиматься */
}

/* Компактная статистика До/После */
.yan-tools-compact-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.yan-tools-stat-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.yan-tools-stat-label {
    font-weight: 600;
    color: #333;
    min-width: 60px;
}

#original-stats {
    color: #dc3545;
    font-weight: 500;
}

#compressed-stats {
    color: #28a745;
    font-weight: 500;
}

/* Вертикальный ползунок качества */
.yan-tools-quality-control-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 40%;
    min-width: 0;
}

.yan-tools-quality-control-vertical label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 0;
    text-align: center;
    white-space: nowrap;
}

#quality-value {
    color: #007cba;
    font-weight: 700;
}

.yan-tools-quality-slider-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 190px;
    width: 100%;
}

#quality-slider-vertical {
    width: 250px;
    height: 6px;
    transform: rotate(-90deg);
    transform-origin: center;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #e5e7eb 0%, #e5e7eb 100%);
    border-radius: 3px;
    outline: none;
}

#quality-slider-vertical::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 124, 186, 0.4);
    transition: all 0.2s ease;
}

#quality-slider-vertical::-webkit-slider-thumb:hover {
    background: #005a87;
    transform: scale(1.1);
}

#quality-slider-vertical::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 124, 186, 0.4);
    transition: all 0.2s ease;
}

#quality-slider-vertical::-moz-range-thumb:hover {
    background: #005a87;
    transform: scale(1.1);
}

/* Большая цифра экономии */
.yan-tools-savings-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: rgba(245, 245, 245, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.yan-tools-savings-percent {
    font-size: 72px;
    font-weight: 900;
    color: #6c757d;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: none;
    letter-spacing: -2px;
    opacity: 0.7;
}

.yan-tools-savings-label {
    font-size: 14px;
    font-weight: 500;
    color: #999;
    text-transform: none;
    letter-spacing: 0.5px;
}

.yan-tools-download-btn-popup {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    position: sticky;
    bottom: 0;
    margin-top: auto;
    margin-left: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.yan-tools-download-btn-popup #download-btn-text {
    flex: 1;
}

/* Адаптивность попапа */
@media (max-width: 1024px) {
    .yan-tools-popup-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .yan-tools-popup-sidebar {
        width: 240px;
    }
    
    .yan-tools-quality-slider-wrapper {
        height: 150px;
    }
    
    #quality-slider-vertical {
        width: 150px;
    }
    
    .yan-tools-quality-control-vertical {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
    }
}

@media (max-width: 768px) {
    .yan-tools-popup-body {
        flex-direction: column;
    }
    
    .yan-tools-popup-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        max-height: 40vh;
    }
    
    .yan-tools-image-preview-container {
        min-height: 300px;
        padding: 20px;
    }
    
    .yan-tools-popup-settings-row {
        flex-direction: row;
        gap: 15px;
        align-items: stretch;
    }
    
    /* Настройки (ширина/высота/формат) - в одну колонку */
    .yan-tools-popup-settings {
        flex: 0 0 50%;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    /* Ползунок качества - во вторую колонку */
    .yan-tools-quality-control-vertical {
        flex: 0 0 50%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .yan-tools-quality-slider-wrapper {
        height: 120px;
    }
    
    #quality-slider-vertical {
        width: 120px;
    }
}

.yan-tools-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.yan-tools-preview-header h3 {
    font-size: 1.2em;
    color: #333;
    margin: 0;
    font-weight: 500;
    flex: 1;
}

.yan-tools-close-preview {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 10px;
    line-height: 1;
}

.yan-tools-close-preview:hover {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(220, 53, 69, 1);
    color: white;
    transform: scale(1.1);
}

.yan-tools-before-after {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.yan-tools-before-column,
.yan-tools-after-column {
    flex: 1;
    text-align: center;
}

.yan-tools-before-column h4,
.yan-tools-after-column h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.yan-tools-before-column h4 {
    color: #dc3545;
}

.yan-tools-after-column h4 {
    color: #28a745;
}

.yan-tools-info-item {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.yan-tools-info-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.yan-tools-before-column .yan-tools-info-item span:last-child,
.yan-tools-after-column .yan-tools-info-item span:last-child {
    font-weight: 600;
    font-size: 14px;
}

.yan-tools-before-column .yan-tools-info-item span:last-child {
    color: #dc3545;
}

.yan-tools-after-column .yan-tools-info-item span:last-child {
    color: #28a745;
}

.yan-tools-image-info {
    margin-bottom: 15px;
}

.yan-tools-image-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.yan-tools-info-label {
    font-weight: 600;
    color: #333;
}

/* Простое превью изображения */
.yan-tools-image-preview {
    width: 100%;
    min-height: 300px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.yan-tools-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

/* Функция увеличения изображения */
.yan-tools-zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yan-tools-zoom-overlay img {
    max-width: none;
    max-height: none;
    transition: transform 0.3s ease;
    user-select: none;
    cursor: grab;
}

.yan-tools-zoom-overlay img:active {
    cursor: grabbing;
}

.yan-tools-zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 1001;
}

.yan-tools-zoom-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.yan-tools-zoom-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.yan-tools-zoom-btn:active {
    transform: scale(0.95);
}

/* Глобальная анимация загрузки */
.yan-tools-global-loading {
    opacity: 0.6;
    filter: blur(1px);
    transition: all 0.3s ease;
}

.yan-tools-global-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.yan-tools-global-loading-indicator .yan-tools-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Сравнение изображений */
.yan-tools-image-comparison {
    position: relative;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

#comparison-canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
}

.yan-tools-comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #007cba;
    cursor: ew-resize;
    z-index: 10;
}

.yan-tools-slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #007cba;
    border-radius: 50%;
    cursor: ew-resize;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.yan-tools-slider-handle:before {
    content: '◀ ▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    letter-spacing: 2px;
}

/* Прогресс загрузки */
.yan-tools-upload-progress {
    text-align: center;
    margin: 0;
    position: relative;
    z-index: 2;
}

.yan-tools-progress-bar {
    width: 100%;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.yan-tools-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, #f0f0f0);
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
    position: relative;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

.yan-tools-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shine 1.5s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.yan-tools-progress-text {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Результат загрузки */
.yan-tools-upload-result {
    text-align: center;
    padding: 20px;
}

.yan-tools-result-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.yan-tools-upload-result h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.yan-tools-upload-result p {
    margin: 5px 0;
    color: #666;
}

/* Прогресс-бар в карусели */
.yan-tools-batch-progress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    color: white;
    position: relative;
    overflow: hidden;
}

.yan-tools-batch-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

.yan-tools-settings-progress {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
    color: white;
    position: relative;
    overflow: hidden;
}

.yan-tools-settings-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Уведомления */
.yan-tools-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
    word-wrap: break-word;
}

.yan-tools-notification-show {
    transform: translateX(0);
}

.yan-tools-notification-success {
    background: #28a745;
}

.yan-tools-notification-warning {
    background: #ffc107;
    color: #333;
}

.yan-tools-notification-error {
    background: #dc3545;
}

/* Контроль качества - как на imagecompressor.com */
.yan-tools-quality-control {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.yan-tools-quality-control label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    min-width: 60px;
}

.yan-tools-quality-input {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

#quality-input {
    width: 50px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    background: white;
}

#quality-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

#quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

#quality-slider::-webkit-slider-thumb:hover {
    background: #005a87;
    transform: scale(1.1);
}

#quality-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: none;
}

/* Кнопки */
.yan-tools-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.yan-tools-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.yan-tools-btn:hover:before {
    left: 100%;
}

.yan-tools-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.yan-tools-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.yan-tools-btn-primary.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
}

.yan-tools-btn-primary .yan-tools-checkbox-plus {
    display: inline-block;
    margin-right: 5px;
    font-weight: bold;
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

.yan-tools-btn-primary.active .yan-tools-checkbox-plus {
    transform: rotate(45deg);
}

.yan-tools-btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.yan-tools-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.6);
}

.yan-tools-btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.yan-tools-btn-secondary:hover {
    background: #cbd5e0;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.yan-tools-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.download-count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.9em;
    min-width: 24px;
    text-align: center;
}

/* Правая панель */
.yan-tools-right-panel {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.yan-tools-info h3 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
}

.yan-tools-info h4 {
    font-size: 1.3em;
    color: #333;
    margin: 25px 0 15px 0;
    font-weight: 500;
}

.yan-tools-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1em;
}

.yan-tools-info strong {
    color: #333;
    font-weight: 600;
}

/* Адаптивность */
@media (max-width: 768px) {
    .yan-tools-image-compressor {
        padding: 15px;
    }
    
    .yan-tools-main {
        margin-bottom: 20px;
    }
    
    .yan-tools-header h2 {
        font-size: 2em;
    }
    
    .yan-tools-upload-zone {
        padding: 20px;
    }
    
    .yan-tools-upload-content {
        padding: 30px 20px;
    }
    
    /* Кнопки в мобильной версии */
    .yan-tools-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .yan-tools-buttons .yan-tools-btn {
        width: 100%;
    }
    
    /* Скрываем настройки в кнопках для мобильной версии */
    .yan-tools-buttons .yan-tools-option-group {
        display: none;
    }
    
    /* Скрываем кнопку "скачать всё" в мобильной версии */
    #download-all-btn {
        display: none;
    }
    
    /* Показываем дублирующие настройки в мобильной версии */
    .yan-tools-settings {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 15px;
        justify-content: stretch;
    }
    
    .yan-tools-images-grid {
        gap: 10px;
    }
    
    .yan-tools-images-carousel {
        gap: 10px;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .yan-tools-image-item {
        flex: 0 0 120px;
        max-width: 120px;
    }
    
    /* Настройки копирайта в мобильной версии */
    .yan-tools-copyright-settings {
        flex-direction: column !important;
        flex-wrap: wrap !important;
    }
    
    .yan-tools-copyright-settings .yan-tools-option-group {
        min-width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    .yan-tools-copyright-settings .yan-tools-option-group:first-child {
        min-width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    .yan-tools-info {
        padding: 20px;
    }
    
    .yan-tools-options-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .yan-tools-option-group {
        min-width: auto;
    }
    
    .yan-tools-before-after {
        flex-direction: column;
        gap: 15px;
    }
    
    .yan-tools-before-column,
    .yan-tools-after-column {
        text-align: left;
    }
    
    
    .yan-tools-option-group {
        text-align: center;
        min-width: auto;
        max-width: none;
    }
    
    .yan-tools-option-group label {
        display: block;
        font-weight: 600;
        color: #333;
        margin-bottom: 8px;
        font-size: 13px;
        text-align: center;
    }
    
    .yan-tools-select {
        width: 100%;
        padding: 8px 6px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        font-size: 12px;
        background: white;
        color: #333;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
    }
    
    .yan-tools-select:focus {
        outline: none;
        border-color: #007cba;
        box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
    }
    
    .yan-tools-select:hover {
        border-color: #cbd5e0;
    }
    
    .yan-tools-select:disabled {
        background: #f7fafc;
        color: #a0aec0;
        cursor: not-allowed;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes uploadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.yan-tools-image-item {
    animation: fadeIn 0.3s ease-out;
}

/* Анимация загрузки */
.yan-tools-uploading {
    position: relative;
    overflow: hidden;
}

.yan-tools-uploading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: uploadProgress 2s ease-in-out infinite;
}

.yan-tools-upload-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #007cba;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.yan-tools-upload-progress.active {
    animation: uploadProgress 1s ease-out;
}

/* Спиннер загрузки */
.yan-tools-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* Анимация загрузки изображений */
.yan-tools-image-item-loading {
    opacity: 0.8;
    animation: pulse 1.5s ease-in-out infinite;
}

.yan-tools-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    z-index: 2;
}

.yan-tools-loading-overlay .yan-tools-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

.yan-tools-loading-overlay span {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Прелоадер обработки файлов */
.yan-tools-files-processing-loader {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    animation: fadeInLoader 0.3s ease-in-out;
}

.yan-tools-upload-zone.processing-files {
    position: relative;
}

.yan-tools-processing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 40px;
}

.yan-tools-processing-content .yan-tools-spinner {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.yan-tools-processing-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yan-tools-processing-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.yan-tools-processing-subtitle {
    font-size: 16px;
    color: #666;
}

@keyframes fadeInLoader {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Анимация появления изображений */
.yan-tools-image-item.loading {
    opacity: 0.6;
    animation: pulse 1s ease-in-out infinite;
}

.yan-tools-image-item.loading .yan-tools-image-preview::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Улучшенное превью - как на imagecompressor.com */
.yan-tools-image-comparison {
    position: relative;
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    cursor: ew-resize;
}

#comparison-canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.yan-tools-comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #007cba;
    cursor: ew-resize;
    z-index: 10;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 124, 186, 0.5);
}

.yan-tools-comparison-slider .yan-tools-slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #007cba;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
    transition: all 0.2s ease;
}

.yan-tools-comparison-slider .yan-tools-slider-handle::before {
    content: '◀ ▶';
    font-size: 10px;
    letter-spacing: 2px;
    line-height: 1;
}

.yan-tools-comparison-slider .yan-tools-slider-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Эффект наведения на ползунок */
.yan-tools-image-comparison:hover .yan-tools-comparison-slider {
    background: #005a87;
}

.yan-tools-image-comparison:hover .yan-tools-comparison-slider .yan-tools-slider-handle {
    background: #005a87;
    transform: translate(-50%, -50%) scale(1.1);
}