/* Полностью безопасные стили конвертера */
/* Селекторы максимально специфичные, чтобы не влиять на основной сайт */

/* Основной контейнер - добавляем еще один уровень специфичности */
.converter-container .converter-card .converter-workflow {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Кнопки workflow */
.converter-container .converter-card .converter-workflow .workflow-steps {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: stretch;
    width: 100%;
    margin: 0;
    padding: 0;
}

.converter-container .converter-card .converter-workflow .workflow-step {
    flex: 1;
    position: relative;
}

/* Кнопки */
.converter-container .converter-card .converter-workflow .converter-button {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: inherit;
}

.converter-container .converter-card .converter-workflow .converter-button.primary {
    background: #4caf50;
    color: white;
}

.converter-container .converter-card .converter-workflow .converter-button.primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.converter-container .converter-card .converter-workflow .converter-button.secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.converter-container .converter-card .converter-workflow .converter-button.secondary:hover:not(.disabled) {
    background: white;
    transform: translateY(-2px);
}

.converter-container .converter-card .converter-workflow .converter-button.success {
    background: #2196f3;
    color: white;
}

.converter-container .converter-card .converter-workflow .converter-button.success:hover:not(.disabled) {
    background: #1976d2;
    transform: translateY(-2px);
}

.converter-container .converter-card .converter-workflow .converter-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.converter-container .converter-card .converter-workflow .button-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.converter-container .converter-card .converter-workflow .converter-dropdown.open .button-arrow {
    transform: rotate(180deg);
}

/* Выпадающие меню */
.converter-container .converter-card .converter-workflow .converter-dropdown {
    position: relative;
}

.converter-container .converter-card .converter-workflow .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.5rem;
    display: none;
}

.converter-container .converter-card .converter-workflow .converter-dropdown.open .dropdown-menu {
    display: block;
    animation: slideDownSafe 0.3s ease;
}

@keyframes slideDownSafe {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.converter-container .converter-card .converter-workflow .dropdown-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.converter-container .converter-card .converter-workflow .dropdown-option:last-child {
    border-bottom: none;
}

.converter-container .converter-card .converter-workflow .dropdown-option:hover {
    background: #f5f5f5;
}

.converter-container .converter-card .converter-workflow .dropdown-option.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.converter-container .converter-card .converter-workflow .option-icon {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

/* Загруженные файлы */
.converter-container .converter-card .converter-workflow .uploaded-files {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 1.5rem;
}

.converter-container .converter-card .converter-workflow .file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.converter-container .converter-card .converter-workflow .file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.converter-container .converter-card .converter-workflow .file-preview {
    max-width: 80px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.converter-container .converter-card .converter-workflow .file-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.converter-container .converter-card .converter-workflow .file-info {
    flex: 1;
    min-width: 0;
}

.converter-container .converter-card .converter-workflow .file-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.converter-container .converter-card .converter-workflow .file-metadata {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.3;
}

.converter-container .converter-card .converter-workflow .remove-file {
    background: #f44336;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.converter-container .converter-card .converter-workflow .remove-file:hover {
    background: #d32f2f;
}

/* Специальный стиль для img.file-preview */
img.file-preview {
    max-width: 80px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    background: transparent;
}

/* Адаптивность */
@media (max-width: 768px) {
    .converter-container .converter-card .converter-workflow .workflow-steps {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .converter-container .converter-card .converter-workflow .workflow-step {
        width: 100%;
    }
    
    .converter-container .converter-card .converter-workflow .file-item {
        padding: 0.5rem;
        gap: 0.75rem;
    }
    
    .converter-container .converter-card .converter-workflow .file-preview,
    .converter-container .converter-card .converter-workflow .file-icon {
        max-width: 60px;
        max-height: 45px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .converter-container .converter-card .converter-workflow .workflow-steps {
        gap: 0.5rem;
    }
    
    .converter-container .converter-card .converter-workflow .file-metadata {
        font-size: 0.8rem;
    }
}