/* Обновленная цветовая схема - ТЕМНАЯ ТЕМА */
:root {
    --primary: #6a5af9;
    --primary-dark: #5b4af0;
    --secondary: #f72585;
    --accent: #4cc9f0;
    --light: #1e1e2e;
    --dark: #f8f9fa;
    --card-bg: rgba(30, 30, 46, 0.95);
    --text-dark: #f8f9fa;
    --text-light: #212529;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --gray: #6c757d;
}

/* Новый фон с анимацией */
body {
    background: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #1a1a2e);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    color: var(--text-dark);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Современные карточки - темный стиль */
.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Улучшенные кнопки */
.btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    transition: all 0.5s ease;
    z-index: -1;
}

.btn:hover:before {
    width: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

/* Анимированный логотип */
.logo {
    background: var(--light);
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.logo:hover {
    transform: rotate(15deg) scale(1.1);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

/* Современный инпут диапазона */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--light);
    border: 3px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--accent);
}

/* Анимированная область загрузки */
.upload-area {
    border: 3px dashed var(--primary);
    border-radius: 15px;
    padding: 50px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(40, 40, 60, 0.3);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.upload-area:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(106, 90, 249, 0.1), 
        rgba(247, 37, 133, 0.1),
        rgba(76, 201, 240, 0.1));
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover:before {
    opacity: 1;
}

.upload-area.dragover {
    border-color: var(--success);
    animation: pulseBorder 1.5s infinite;
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 0 0 rgba(6, 214, 160, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(6, 214, 160, 0); }
    100% { box-shadow: 0 0 0 0 rgba(6, 214, 160, 0); }
}

/* Анимация для иконки загрузки */
.upload-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    transition: all 0.5s ease;
    display: inline-block;
}

.upload-area:hover .upload-icon {
    transform: translateY(-5px);
    color: var(--secondary);
}

/* Неоновый эффект для активных элементов */
.batch-btn.active, .crop-ratio.active {
    box-shadow: 0 0 15px rgba(106, 90, 249, 0.6);
    border-color: var(--primary);
}

/* Анимация прогресс-бара */
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-100px) skewX(-15deg);
    animation: progressShine 1.5s infinite ease-in-out;
}

@keyframes progressShine {
    0% { transform: translateX(-100px) skewX(-15deg); }
    100% { transform: translateX(500px) skewX(-15deg); }
}

/* Обновленные карточки статистики */
.stat-item {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.stat-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.stat-item:hover:before {
    opacity: 1;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Плавные переходы */
* {
    transition: 
        background-color 0.3s ease,
        color 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        opacity 0.3s ease;
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    color: white;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-text h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: var(--text-dark);
}

.header-text .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    color: #a0a0c0;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Стили для PDF кнопок */
.pdf-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    height: 40px;
    gap: 8px;
}

.pdf-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .pdf-btn span {
        display: none;
    }
    .pdf-btn {
        padding: 10px;
        width: 40px;
        justify-content: center;
    }
    
    .fa-file-word {
        font-size: 1.1em !important;
        margin-top: 2px;
    }
    
    #batchRenameBtn i,
    #exifEditorBtn i,
    #collageMakerBtn i {
        font-size: 1.1em;
    }
    
    .header-actions {
        gap: 8px;
    }
}

/* Кнопка истории */
.history-toggle {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 1100px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-text {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-subtext {
    color: #a0a0c0;
    font-size: 0.95rem;
}

#fileInput {
    display: none;
}

.file-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.file-preview {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 100px;
    background: var(--light);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.7rem;
    padding: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.remove-file:hover {
    opacity: 1;
    transform: scale(1.1);
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.control-group {
    background: rgba(40, 40, 60, 0.3);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(106, 90, 249, 0.2);
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #e0e0ff;
}

select, .btn {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(106, 90, 249, 0.3);
    border-radius: 10px;
    background: #2d2d44;
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.3s ease;
}

select:focus, .btn:focus {
    border-color: var(--primary);
    outline: none;
}

.btn:disabled {
    background: var(--gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.btn-secondary {
    background: var(--light);
    color: var(--text-dark);
    border: 2px solid var(--primary);
}

.quality-value {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.preview-section {
    display: none;
    margin: 30px 0;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

.preview-item {
    background: rgba(40, 40, 60, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.preview-item h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.preview-item img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.file-info {
    margin-top: 15px;
    padding: 10px;
    background: rgba(106, 90, 249, 0.15);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.processing {
    display: none;
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    color: var(--text-dark);
}

.spinner {
    border: 4px solid rgba(243,243,243,0.3);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.history-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--card-bg);
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    padding: 25px;
    z-index: 1000;
    transition: right 0.4s ease;
    overflow-y: auto;
}

.history-panel.active {
    right: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.history-title {
    font-size: 1.4rem;
    color: var(--accent);
}

.close-history {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-history:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

.history-item {
    background: rgba(40, 40, 60, 0.5);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.history-item:hover {
    background: rgba(106, 90, 249, 0.2);
    transform: translateX(5px);
}

.history-item h4 {
    margin-bottom: 8px;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
}

.history-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #a0a0c0;
}

/* Editor Styles */
.editor-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
    display: none;
}

.editor-preview {
    position: relative;
    width: 100%;
    height: 400px;
    border: 2px dashed var(--accent);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.05);
}

#previewImage {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.3s ease;
}

.editor-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.editor-btn {
    padding: 10px;
    background: var(--light);
    border: 2px solid var(--primary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
}

.editor-btn:hover {
    background: var(--primary);
    color: white;
}

.editor-btn i {
    font-size: 1.2rem;
}

.crop-controls {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
    background: rgba(40, 40, 60, 0.5);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--accent);
}

.crop-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.crop-ratio {
    padding: 8px;
    background: var(--light);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--gray);
    color: var(--text-dark);
}

.crop-ratio.active {
    border-color: var(--accent);
    background: rgba(76, 201, 240, 0.2);
}

.edit-notification {
    display: none;
    padding: 10px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    text-align: center;
    margin-top: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Crop overlay */
.crop-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    overflow: hidden;
    background: #2d2d44;
    justify-content: center;
    align-items: center;
}

.crop-box {
    position: absolute;
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    cursor: move;
    display: none;
}

.crop-handle {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    z-index: 10;
    touch-action: none;
}

.handle-nw { top: -12px; left: -12px; cursor: nw-resize; }
.handle-ne { top: -12px; right: -12px; cursor: ne-resize; }
.handle-sw { bottom: -12px; left: -12px; cursor: sw-resize; }
.handle-se { bottom: -12px; right: -12px; cursor: se-resize; }

.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #20bf6b;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    bottom: 30px;
}

.watermark-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.auto-optimize {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* User info styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.15);
    padding: 8px 15px;
    border-radius: 30px;
    color: var(--text-dark);
}

.premium-badge {
    background: #a5b1c2;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.85rem;
}

.btn-premium {
    background: linear-gradient(135deg, #ffd700, #ff9800);
    color: #333;
    border: none;
    border-radius: 20px;
    padding: 6px 15px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.btn-logout {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    color: var(--danger);
}

/* Daily counter */
.daily-counter {
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* Batch controls */
.batch-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.batch-btn {
    flex: 1;
    padding: 10px;
    background: var(--light);
    border: 2px solid var(--primary);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.batch-btn.active {
    background: var(--primary);
    color: white;
}

/* Стили для водяных знаков */
.watermark-controls {
    margin-top: 20px;
    padding: 15px;
    background: rgba(40, 40, 60, 0.5);
    border-radius: 12px;
    display: none;
    border: 1px solid var(--primary);
}

.watermark-type-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.watermark-type-btn {
    flex: 1;
    padding: 8px;
    background: var(--light);
    border: 2px solid var(--primary);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.watermark-type-btn.active {
    background: var(--primary);
    color: white;
}

.watermark-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.watermark-preview {
    width: 100%;
    height: 100px;
    border: 1px dashed var(--gray);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: 10px;
    background: rgba(0,0,0,0.1);
}

.watermark-preview img {
    max-width: 100%;
    max-height: 100%;
}

.watermark-preview span {
    position: absolute;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
}

/* Стили для расширенных настроек */
.advanced-settings {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: rgba(40, 40, 60, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(106, 90, 249, 0.2);
}

.settings-toggle {
    margin-top: 15px;
    text-align: center;
}

.settings-toggle-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0 auto;
}

/* Стили для пакетного редактирования */
.batch-edit-notice {
    background: rgba(0,207,200,0.1);
    border-left: 4px solid var(--accent);
    padding: 10px;
    margin-top: 10px;
    border-radius: 0 8px 8px 0;
    display: none;
    color: var(--text-dark);
}

/* Стили для прогрессивного JPEG */
.progressive-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text-dark);
}

/* Стили для метаданных */
.metadata-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text-dark);
}

/* Стили для улучшенного предпросмотра */
.comparison-slider {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    margin: 15px 0;
}

.comparison-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    border-right: 2px solid white;
}

.comparison-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10;
}

/* Стили для истории с превью */
.history-preview {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
    display: flex;
}

.history-preview-img {
    width: 50%;
    height: 100%;
    object-fit: cover;
}

/* Стили для сенсорного управления */
.touch-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    display: none;
}

.touch-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Стили для коррекции изображения */
.adjust-controls {
    display: none;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: rgba(40, 40, 60, 0.3);
    border-radius: 12px;
    color: var(--text-dark);
}

.adjust-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 10px;
}

.adjust-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

/* Новые стили для кадрирования */
.crop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.crop-ratios {
    display: grid;
    grid-template-columns: repeat(3, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.crop-ratio {
    padding: 10px;
    border: 2px solid var(--gray);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dark);
    background: var(--light);
}

.crop-ratio.active {
    border-color: var(--accent);
    background-color: rgba(74, 130, 255, 0.1);
}

.crop-ratio i {
    display: block;
    font-size: 20px;
    margin-bottom: 5px;
}

.crop-tips {
    background: #2d2d44;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #a0a0c0;
}

/* Адаптивные улучшения */
@media (max-width: 768px) {
    .touch-controls {
        display: flex;
    }
    
    .editor-controls {
        display: none;
    }
    
    .header-text h1 {
        font-size: 1.5rem;
    }
    
    .header-text .subtitle {
        font-size: 0.9rem;
    }
    
    .user-info {
        font-size: 0.8rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 20px;
    }
    
    .preview-container {
        grid-template-columns: 1fr;
    }
    
    .history-panel {
        width: 100%;
        right: -100%;
    }
    
    .editor-preview {
        height: 300px;
    }

    .crop-overlay {
        height: 100%;
    }

    .crop-ratios {
        grid-template-columns: repeat(2, 1fr));
    }
    
    .watermark-controls,
    .crop-controls {
        padding: 10px;
    }
    
    .watermark-row {
        flex-direction: column;
    }
}

/* Новые стили для улучшения UX */
.info-box {
    background: rgba(0, 207, 200, 0.1);
    border-left: 4px solid var(--accent);
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin: 15px 0;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.info-box i {
    color: var(--accent);
    margin-right: 10px;
    font-size: 1.2rem;
}

.btn-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(106, 90, 249, 0.2);
    color: var(--accent);
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.control-label-text {
    font-weight: 600;
    color: #e0e0ff;
}

.control-value {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
}

.explanation-icon {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 8px;
}

/* Custom changes */
body {
    background: #121212 !important;
}

.advanced-settings {
    display: block !important;
}

.settings-toggle-btn {
    display: none;
}

/* Стиль для кнопки улучшения качества */
#improveQualityBtn {
    background: linear-gradient(135deg, #ff9a00, #ffd700);
    color: #333;
}

#improveQualityBtn:hover {
    background: linear-gradient(135deg, #ff8c00, #ffcc00);
    transform: scale(1.05);
}

#improveQualityBtn i {
    color: #fff;
    text-shadow: 0 0 3px rgba(0,0,0,0.3);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    #improveQualityBtn span {
        display: none;
    }
    #improveQualityBtn {
        padding: 10px;
        width: 40px;
        justify-content: center;
    }
    
    .header-left {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        margin-top: 15px;
    }
    
    .main-grid {
        gap: 20px;
    }
}

@media (max-width: 1100px) {
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pdf-btn {
        margin: 5px;
    }
}

/* Гарантируем видимость скрытых элементов при активации */
.watermark-controls.active,
.crop-controls.active {
    display: block;
}