/* PEREFILE Converter CSS - Database-First Design */

/* Основные стили */
#converter-app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Экраны */
.screen {
    display: none;
    min-height: 400px;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Экран загрузки */
.upload-area {
    border: 2px dashed #007bff;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #0056b3;
    /* Только цвет границы меняется */
}

.upload-area.dragover {
    border-color: #28a745;
    background: #d4edda;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-area h2 {
    margin: 0 0 0.5rem;
    color: #333;
    font-weight: 600;
}

.upload-area p {
    margin: 0 0 1.5rem;
    color: #666;
}

/* btn-primary styles moved to shared-layout.css */

.supported-formats {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #e8f4fd;
    border-radius: 8px;
    color: #0c5460;
    font-size: 14px;
}

/* Информация о файле */
.file-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 2rem;
}

.file-details h4 {
    margin: 0 0 5px;
    color: #333;
}

.file-meta {
    color: #666;
    font-size: 14px;
}

.file-actions {
    margin-left: auto;
}

/* btn-secondary styles moved to shared-layout.css */

/* Рекомендации */
.recommendations-section h3 {
    margin: 0 0 20px;
    color: #333;
    font-weight: 600;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.recommendation-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.recommendation-card.selected {
    border-color: #007bff;
    background: #e3f2fd;
}

.recommendation-card.primary {
    border-color: #28a745;
    background: #d4edda;
}

.recommendation-card.primary .format-icon {
    color: #28a745;
}

.format-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.format-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.format-hint {
    font-size: 12px;
    color: #666;
}

.format-badge {
    display: inline-block;
    background: #0967d3;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 5px;
}

/* Дополнительные опции */
.additional-options {
    margin-top: 20px;
}

.options-toggle {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
}

.options-toggle:hover {
    background: #e9ecef;
}

.toggle-arrow {
    float: right;
    transition: transform 0.3s ease;
}

.options-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.secondary-recommendations {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
}

/* Настройки */
.converter-settings {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

.converter-settings h4 {
    margin: 0 0 15px;
    color: #333;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.setting-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.setting-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* Обработка */
.processing-content {
    text-align: center;
    padding: 40px 20px;
}

.file-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.processing-status h3 {
    margin: 0 0 20px;
    color: #333;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    width: 0;
    transition: width 0.3s ease;
    border-radius: 6px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.progress-fill.websocket-active {
    background: linear-gradient(90deg, #28a745, #20c997);
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

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

.progress-text {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.operation-info {
    color: #666;
    font-size: 14px;
    margin-top: 15px;
}

/* Результаты */
.results-content {
    text-align: center;
    padding: 20px;
}

.success-message h3 {
    margin: 0 0 30px;
    color: #28a745;
    font-weight: 600;
}

.results-list {
    margin-bottom: 30px;
}

.result-file {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-icon {
    font-size: 2rem;
}

.result-info {
    flex-grow: 1;
    text-align: left;
}

.result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.result-meta {
    color: #666;
    font-size: 14px;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.download-btn:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

/* Сообщения об ошибках */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 400px;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-text {
    flex-grow: 1;
}

.error-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Пресеты */
.presets-container {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.presets-container.enhanced {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.presets-header h4 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.presets-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-text {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.power-badge {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.presets-grid.enhanced {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.preset-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.preset-card.enhanced {
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
    position: relative;
}

.preset-card:hover {
    border-color: #007bff;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.preset-card.enhanced:hover {
    border-color: #007bff;
    background: #f0f8ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.2);
}

.preset-card.selected {
    border-color: #007bff;
    background: #e3f2fd;
}

.preset-card.drag-active {
    border-color: #28a745 !important;
    background: #d4edda !important;
}

.preset-card.drag-over {
    border-color: #28a745 !important;
    background: #c3e6cb !important;
    transform: scale(1.05);
}

.preset-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.preset-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.preset-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preset-badge {
    font-size: 8px;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    min-width: 20px;
}

.preset-badge.popular {
    background: #ff6b35;
    color: white;
}

.preset-badge.new {
    background: #28a745;
    color: white;
}

.preset-badge.hq {
    background: #6f42c1;
    color: white;
}

.preset-content {
    text-align: left;
}

.preset-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 15px;
}

.preset-description {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.preset-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.preset-time {
    font-size: 11px;
    color: #28a745;
    font-weight: 500;
}

.preset-format {
    font-size: 10px;
    background: #0967d3;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.preset-usage {
    font-size: 10px;
    color: #6c757d;
    text-align: center;
    margin-top: 8px;
}

.preset-drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.drop-zone-content {
    text-align: center;
}

.drop-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.drop-text {
    font-weight: 600;
    font-size: 14px;
}

.presets-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.create-preset-btn,
.manage-presets-btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-preset-btn:hover,
.manage-presets-btn:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

/* Drag & Drop Animations */
@keyframes bounceIn {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    70% {
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes presetDragPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
}

.preset-card.drag-active {
    animation: presetDragPulse 1.5s infinite;
}

/* Пакетные стратегии */
.batch-strategies-container h4 {
    margin: 0 0 15px;
    color: #0056b3;
    font-weight: 600;
}

.batch-strategies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.batch-strategy-card {
    background: white;
    border: 2px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.batch-strategy-card:hover {
    border-color: #007bff;
    background: #f0f8ff;
    transform: translateY(-2px);
}

.batch-strategy-card.selected {
    border-color: #007bff;
    background: #e3f2fd;
}

.strategy-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.strategy-name {
    font-weight: 600;
    color: #0056b3;
    margin-bottom: 6px;
    font-size: 15px;
}

.strategy-description {
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
}

.strategy-time {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
}

/* Персонализация */
.personalization-hint {
    animation: slideIn 0.5s ease-in;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Power User Features - Progressive Disclosure */
.power-user-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    border-left: 4px solid #007bff;
}

.power-toggle {
    cursor: pointer;
    font-weight: 600;
    color: #007bff;
    user-select: none;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.power-toggle:hover {
    background: #e3f2fd;
}

.power-arrow {
    float: right;
    transition: transform 0.3s ease;
}

.advanced-settings {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.setting-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
}

.setting-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Keyboard Shortcuts */
.keyboard-shortcuts-section {
    margin-top: 15px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 6px;
    border: 1px solid #90EE90;
}

.shortcuts-title {
    font-weight: 600;
    color: #2d5a2d;
    margin-bottom: 10px;
    font-size: 14px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    font-size: 13px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #90EE90;
}

.shortcut-key {
    background: #2d5a2d;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.shortcut-description {
    color: #2d5a2d;
    font-size: 12px;
}

/* Progressive Disclosure Animations */
.power-user-section {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

.advanced-settings {
    animation: fadeIn 0.3s ease-in;
}

/* Power Mode Badge */
.power-mode-badge {
    display: inline-block;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 10px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Numbered Recommendations for Keyboard Navigation */
.recommendation-card {
    position: relative;
}

.recommendation-card::before {
    content: attr(data-number);
    position: absolute;
    top: -8px;
    right: -8px;
    background: #0967d3;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.recommendation-card:nth-child(1)::before { content: "1"; }
.recommendation-card:nth-child(2)::before { content: "2"; }
.recommendation-card:nth-child(3)::before { content: "3"; }
.recommendation-card:nth-child(4)::before { content: "4"; }
.recommendation-card:nth-child(5)::before { content: "5"; }
.recommendation-card:nth-child(6)::before { content: "6"; }
.recommendation-card:nth-child(7)::before { content: "7"; }
.recommendation-card:nth-child(8)::before { content: "8"; }
.recommendation-card:nth-child(9)::before { content: "9"; }

/* Адаптивность */
@media (max-width: 768px) {
    #converter-app {
        padding: 15px;
    }
    
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
    
    .presets-grid {
        grid-template-columns: 1fr;
    }
    
    .batch-strategies-grid {
        grid-template-columns: 1fr;
    }
    
    .file-info {
        flex-direction: column;
        text-align: center;
    }
    
    .file-actions {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .result-file {
        flex-direction: column;
        text-align: center;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
    
    .power-user-section {
        padding: 12px;
    }
}

/* Batch Upload Styles */
.batch-content {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.batch-header {
    text-align: center;
    margin-bottom: 30px;
}

.batch-header h2 {
    margin: 0 0 15px;
    color: #333;
    font-weight: 600;
}

.batch-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.batch-stat {
    text-align: center;
}

.converter-container .stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.batch-files-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    margin-bottom: 20px;
}

.batch-file-item {
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
}

.batch-file-item:last-child {
    border-bottom: none;
}

.batch-file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.batch-file-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.batch-file-details {
    flex-grow: 1;
}

.batch-file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.batch-file-meta {
    font-size: 12px;
    color: #666;
}

.batch-file-status {
    margin-left: auto;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #e9ecef;
    color: #6c757d;
}

.status-badge.processing {
    background: #fff3cd;
    color: #856404;
    animation: pulse 1.5s infinite;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.failed {
    background: #f8d7da;
    color: #721c24;
}

.batch-file-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar.small {
    height: 6px;
    flex-grow: 1;
}

.batch-file-progress .progress-text {
    font-size: 11px;
    color: #666;
    font-weight: 600;
    min-width: 35px;
    text-align: right;
}

.batch-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.batch-actions button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

.batch-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Batch Processing Animations */
@keyframes batchSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.batch-file-item {
    animation: batchSlideIn 0.3s ease-out;
}

.batch-file-item:nth-child(1) { animation-delay: 0ms; }
.batch-file-item:nth-child(2) { animation-delay: 100ms; }
.batch-file-item:nth-child(3) { animation-delay: 200ms; }
.batch-file-item:nth-child(4) { animation-delay: 300ms; }
.batch-file-item:nth-child(5) { animation-delay: 400ms; }

/* Responsive Batch Upload */
@media (max-width: 768px) {
    .batch-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .batch-file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .batch-file-status {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .batch-actions {
        flex-direction: column;
    }
    
    .batch-actions button {
        width: 100%;
    }
}
/* Real-time Progress Styles */
.conversion-progress {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin: 15px 0;
}

.conversion-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.conversion-progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.4) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s ease-in-out infinite;
}

#status-indicator {
    font-weight: 600;
    margin: 10px 0;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 4px solid #3b82f6;
}

#connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    font-size: 12px;
    font-weight: 500;
    z-index: 999;
}

#intermediate-results {
    display: none;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease-out;
}

.notification.success { background: #10b981; }
.notification.error { background: #ef4444; }
.notification.warning { background: #f59e0b; }
.notification.info { background: #3b82f6; }

/* ====== УЛУЧШЕННЫЕ АНИМАЦИИ СОГЛАСНО СПЕЦИФИКАЦИИ ====== */

/* Переходы между экранами */
.screen {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(20px);
    opacity: 0;
}

.screen.active {
    transform: translateY(0);
    opacity: 1;
    animation: screenSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes screenSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Анимации для карточек рекомендаций */
.recommendation-card {
    animation: cardAppear 0.4s ease-out;
    animation-fill-mode: both;
}

.recommendation-card:nth-child(1) { animation-delay: 0.1s; }
.recommendation-card:nth-child(2) { animation-delay: 0.2s; }
.recommendation-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Анимация toggle секций */
#more-options-container {
    transition: all 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
}

#more-options-container.visible {
    max-height: 1000px;
    animation: expandSection 0.4s ease-out;
}

@keyframes expandSection {
    0% {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
}

#presets-section {
    transition: all 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
}

#presets-section.visible {
    max-height: 800px;
    animation: expandSection 0.4s ease-out;
}

/* Hover эффекты для кнопок */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

/* Анимация загрузки файлов */
.upload-area {
    position: relative;
    overflow: hidden;
}

.upload-area::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 ease;
}

/* Убрана анимация при hover
.upload-area:hover::before {
    left: 100%;
} */

/* Убрана пульсирующая анимация
.upload-area.dragover {
    animation: dragPulse 1s ease-in-out infinite;
}

@keyframes dragPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
} */

/* Анимация прогресса */
.processing-progress {
    position: relative;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(-45deg, #007bff, #28a745, #007bff, #28a745);
    background-size: 400% 400%;
    animation: progressGradient 2s ease infinite;
    transition: width 0.3s ease;
}

@keyframes progressGradient {
    0% { background-position: 0 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Эффекты наведения для карточек */
.recommendation-card,
.preset-card,
.compact-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.recommendation-card:hover,
.preset-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.compact-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Анимация появления уведомлений */
.notification {
    animation: notificationSlide 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes notificationSlide {
    0% {
        opacity: 0;
        transform: translateX(100%) translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

/* Плавные переходы для текста */
h1, h2, h3, h4, h5, h6, p {
    transition: color 0.3s ease;
}

/* Fade-in для загружаемого контента */
.fade-in {
    animation: fadeInSmooth 0.6s ease-out;
}

@keyframes fadeInSmooth {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
    .screen.active {
        animation-duration: 0.3s; /* Быстрее на мобильных */
    }
    
    .recommendation-card:hover {
        transform: none; /* Отключаем hover на мобильных */
    }
}

/* ====== LOADING SKELETON ДЛЯ PERFORMANCE OPTIMIZATION ====== */

.loading-skeleton {
    padding: 20px;
}

.skeleton-header {
    height: 40px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 20px;
}

.skeleton-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.skeleton-card {
    height: 160px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 12px;
}

.skeleton-card:nth-child(1) { animation-delay: 0.1s; }
.skeleton-card:nth-child(2) { animation-delay: 0.2s; }
.skeleton-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes skeletonLoading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Индикатор кеша */
.cache-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(40, 167, 69, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.cache-indicator.cached {
    background: rgba(40, 167, 69, 0.8);
}

.cache-indicator.fresh {
    background: rgba(0, 123, 255, 0.8);
}

